/// <summary>
        /// GetList
        /// Calls [usp_selectAll_ReportCategoryGroup]
        /// </summary>
        public override List <ReportCategoryGroupDetails> GetList()
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_selectAll_ReportCategoryGroup", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cn.Open();
                DbDataReader reader = ExecuteReader(cmd);
                List <ReportCategoryGroupDetails> lst = new List <ReportCategoryGroupDetails>();
                while (reader.Read())
                {
                    ReportCategoryGroupDetails obj = new ReportCategoryGroupDetails();
                    obj.ReportCategoryGroupId = GetReaderValue_Int32(reader, "ReportCategoryGroupId", 0);
                    obj.Name      = GetReaderValue_String(reader, "Name", "");
                    obj.SortOrder = GetReaderValue_String(reader, "SortOrder", "");
                    lst.Add(obj);
                    obj = null;
                }
                return(lst);
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to get ReportCategoryGroups", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
Esempio n. 2
0
        private static ReportCategoryGroup PopulateFromDBDetailsObject(ReportCategoryGroupDetails obj)
        {
            ReportCategoryGroup objNew = new ReportCategoryGroup();

            objNew.ReportCategoryGroupId = obj.ReportCategoryGroupId;
            objNew.Name      = obj.Name;
            objNew.SortOrder = obj.SortOrder;
            return(objNew);
        }