/// <summary> /// GetList /// Calls [usp_selectAll_SiteSection] /// </summary> public override List <SiteSectionDetails> GetList() { SqlConnection cn = null; SqlCommand cmd = null; try { cn = new SqlConnection(this.ConnectionString); cmd = new SqlCommand("usp_selectAll_SiteSection", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandTimeout = 30; cn.Open(); DbDataReader reader = ExecuteReader(cmd); List <SiteSectionDetails> lst = new List <SiteSectionDetails>(); while (reader.Read()) { SiteSectionDetails obj = new SiteSectionDetails(); obj.SiteSectionId = GetReaderValue_Int32(reader, "SiteSectionId", 0); obj.SiteSectionName = GetReaderValue_String(reader, "SiteSectionName", ""); obj.Description = GetReaderValue_String(reader, "Description", ""); obj.URL = GetReaderValue_String(reader, "URL", ""); lst.Add(obj); obj = null; } return(lst); } catch (SqlException sqlex) { //LogException(sqlex); throw new Exception("Failed to get SiteSections", sqlex); } finally { cmd.Dispose(); cn.Close(); cn.Dispose(); } }
private static SiteSection PopulateFromDBDetailsObject(SiteSectionDetails obj) { SiteSection objNew = new SiteSection(); objNew.SiteSectionId = obj.SiteSectionId; objNew.SiteSectionName = obj.SiteSectionName; objNew.Description = obj.Description; objNew.URL = obj.URL; return(objNew); }