PageRenderTime 36ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/Songhay.Data.GenericWeb/Procedures/List/List.Segments.cs

http://GenericWeb.codeplex.com
C# | 47 lines | 26 code | 7 blank | 14 comment | 2 complexity | 6526353c07201ad5cf63f468d67c3eeb MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data.Common;
  4. namespace Songhay.Data.GenericWeb.Procedures
  5. {
  6. using Songhay.Data.GenericWeb.Properties;
  7. /// <summary>
  8. /// List procedures into the DBMS.
  9. /// </summary>
  10. public static partial class List
  11. {
  12. /// <summary>
  13. /// Lists all Segment data in the DBMS catalogue.
  14. /// </summary>
  15. /// <param name="commonConnection">The Common connection.</param>
  16. /// <returns>Returns an XML <see cref="System.String"/>.</returns>
  17. public static string Segments(DbConnection commonConnection)
  18. {
  19. Dictionary<string, object> param = new Dictionary<string, object>(1);
  20. param.Add("@GlobalDateFormat", CommandHandler.GlobalDateFormat);
  21. string s = Common.CommonScalar.GetString(commonConnection, Resources.ListSegments, param);
  22. return s;
  23. }
  24. /// <summary>
  25. /// Lists all child Segment data of the specified parent Segment.
  26. /// </summary>
  27. /// <param name="commonConnection">The Common connection.</param>
  28. /// <param name="uniqueIdentifier">The unique identifier of the parent Segment.</param>
  29. /// <returns>Returns an XML <see cref="System.String"/>.</returns>
  30. public static string Segments(DbConnection commonConnection, string uniqueIdentifier)
  31. {
  32. if(uniqueIdentifier == null) throw new ArgumentNullException("uniqueIdentifier", "The unique identifer is null.");
  33. Dictionary<String, Object> paramSet = new Dictionary<string, object>(2);
  34. paramSet.Add("@SegmentId", uniqueIdentifier);
  35. paramSet.Add("@GlobalDateFormat", CommandHandler.GlobalDateFormat);
  36. string s = Common.CommonScalar.GetString(commonConnection, Resources.ListChildSegments, paramSet);
  37. return s;
  38. }
  39. }
  40. }