/Songhay.Data.GenericWeb/Procedures/List/List.Segments.cs
C# | 47 lines | 26 code | 7 blank | 14 comment | 2 complexity | 6526353c07201ad5cf63f468d67c3eeb MD5 | raw file
- using System;
- using System.Collections.Generic;
- using System.Data.Common;
-
- namespace Songhay.Data.GenericWeb.Procedures
- {
- using Songhay.Data.GenericWeb.Properties;
-
- /// <summary>
- /// List procedures into the DBMS.
- /// </summary>
- public static partial class List
- {
- /// <summary>
- /// Lists all Segment data in the DBMS catalogue.
- /// </summary>
- /// <param name="commonConnection">The Common connection.</param>
- /// <returns>Returns an XML <see cref="System.String"/>.</returns>
- public static string Segments(DbConnection commonConnection)
- {
- Dictionary<string, object> param = new Dictionary<string, object>(1);
- param.Add("@GlobalDateFormat", CommandHandler.GlobalDateFormat);
- string s = Common.CommonScalar.GetString(commonConnection, Resources.ListSegments, param);
-
- return s;
- }
-
- /// <summary>
- /// Lists all child Segment data of the specified parent Segment.
- /// </summary>
- /// <param name="commonConnection">The Common connection.</param>
- /// <param name="uniqueIdentifier">The unique identifier of the parent Segment.</param>
- /// <returns>Returns an XML <see cref="System.String"/>.</returns>
- public static string Segments(DbConnection commonConnection, string uniqueIdentifier)
- {
- if(uniqueIdentifier == null) throw new ArgumentNullException("uniqueIdentifier", "The unique identifer is null.");
-
- Dictionary<String, Object> paramSet = new Dictionary<string, object>(2);
- paramSet.Add("@SegmentId", uniqueIdentifier);
- paramSet.Add("@GlobalDateFormat", CommandHandler.GlobalDateFormat);
-
- string s = Common.CommonScalar.GetString(commonConnection, Resources.ListChildSegments, paramSet);
-
- return s;
- }
- }
- }