/// <summary> /// Description : Get ModeOfAppointment Details from database. /// Created By : Pavan /// Created Date : 23 August 2014 /// Modified By : /// Modified Date: /// </summary> /// <returns></returns> public static List<ModeOfDesignations> GetModeOfDesignations() { var data = new List<ModeOfDesignations>(); System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame(); System.Reflection.MethodBase methodBase = stackFrame.GetMethod(); log.Debug("Start: " + methodBase.Name); try { var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "[SpGetModeOfDesignations]"); var safe = new SafeDataReader(reader); while (reader.Read()) { var designations = new ModeOfDesignations(); designations.FetchModeOfDesignations(designations, safe); data.Add(designations); } return data; } catch (Exception ex) { log.Error("Error: " + ex); return data; } finally { log.Debug("End: " + methodBase.Name); } }
private ModeOfDesignations FetchModeOfDesignations(ModeOfDesignations designations, SafeDataReader dr) { designations.ID = dr.GetInt32("ID"); designations.Name = dr.GetString("Name"); return designations; }