Exemple #1
0
 private ShareClass FetchPartialShareClassContent(ShareClass shareClass, SafeDataReader dr)
 {
     shareClass.ShareClassID = dr.GetInt32("ShareClassID");
     shareClass.ClassName = dr.GetString("ClassName");
     return shareClass;
 }
Exemple #2
0
            /// <summary>
            /// Description  : Get Share Class Details from database.
            /// Created By   : Sudheer
            /// Created Date : 30 July 2014
            /// Modified By  :
            /// Modified Date:
            /// </summary>
            /// <returns></returns>
            public static List<ShareClass> GetShareClassDetails(int WOID)
            {
                var data = new List<ShareClass>();

                System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
                System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
                log.Debug("Start: " + methodBase.Name);
                try
                {
                    SqlParameter[] sqlParams = new SqlParameter[1];
                    sqlParams[0] = new SqlParameter("@WOID", WOID);
                    var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "[SpGetCSS1ShareClassDetails]", sqlParams);
                    var safe = new SafeDataReader(reader);
                    while (reader.Read())
                    {
                        var shareClass = new ShareClass();
                        shareClass.FetchPartialShareClassContent(shareClass, safe);
                        data.Add(shareClass);
                    }
                    if (data.Count == 0)
                    {
                        data.Add(new ShareClass { ShareClassID = -1, ClassName = "Select" });
                    }
                    return data;
                }
                catch (Exception ex)
                {
                    log.Error("Error: " + ex);
                    return data;
                }
                finally
                {
                    log.Debug("End: " + methodBase.Name);
                }
            }