コード例 #1
0
        public List <SYS_ColumnCategory> SelectAllSYS_ColumnCategory()
        {
            List <SYS_ColumnCategory> sys_columncategory = new List <SYS_ColumnCategory>();
            DbDataReader reader = null;
            DbConnection conn   = _DbHelper.CreateConnection(Common.ConnectionString);

            conn.Open();
            try
            {
                reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[SYS_ColumnCategory_SelectAll]", (DbParameter[])null);
                if (reader.HasRows)
                {
                    SYS_ColumnCategoryDataAccess.SetListSYS_ColumnCategoryInfo(ref reader, ref sys_columncategory);
                }
                return(sys_columncategory);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format(" SYS_ColumnCategoryDataAccess.SelectAll: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                conn.Close();
            }
        }
コード例 #2
0
        public List <SYS_ColumnCategory> SelectAllSYS_ColumnCategoryByIDCatManager(int IDCatManager)
        {
            List <SYS_ColumnCategory> sys_columcategory = new List <SYS_ColumnCategory>();
            DbDataReader reader = null;
            DbConnection conn   = _DbHelper.CreateConnection(Common.ConnectionString);

            conn.Open();
            try
            {
                List <DbParameter> para = new List <DbParameter>();
                para.Add(_DbHelper.CreateParameter(FIELD_IDCATEGORYMANAGER, IDCatManager, false));
                reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[SYS_ColumnCategory_SelectByIDCatManager]", para.ToArray());
                if (reader.HasRows)
                {
                    SYS_ColumnCategoryDataAccess.SetListSYS_ColumnCategoryInfo(ref reader, ref sys_columcategory);
                }
                return(sys_columcategory);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("SYS_ColumnCategoryDataAccess.SYS_ColumnCategory_SelectByNameTable: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                conn.Close();
            }
        }
コード例 #3
0
        public SYS_ColumnCategory SelectSYS_ColumnCategory(int ID)
        {
            SYS_ColumnCategory sys_columncategory = new SYS_ColumnCategory();
            DbDataReader       reader             = null;
            DbConnection       conn = _DbHelper.CreateConnection(Common.ConnectionString);

            conn.Open();
            try
            {
                List <DbParameter> para = new List <DbParameter>();
                para.Add(_DbHelper.CreateParameter(FIELD_ID, ID, false));

                reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[SYS_ColumnCategory_SelectById]", para.ToArray());
                if (reader.HasRows && reader.Read())
                {
                    SYS_ColumnCategoryDataAccess.SetSYS_ColumnCategoryInfo(reader, ref sys_columncategory);
                }
                return(sys_columncategory);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("SYS_ColumnCategoryDataAccess.SelectById: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                conn.Close();
            }
        }
コード例 #4
0
        private static void SetListSYS_ColumnCategoryInfo(ref DbDataReader reader, ref List <SYS_ColumnCategory> sys_columncategorys)
        {
            SYS_ColumnCategory sys_columncategory = null;

            while (reader.Read())
            {
                sys_columncategory = new SYS_ColumnCategory();
                SYS_ColumnCategoryDataAccess.SetSYS_ColumnCategoryInfo(reader, ref sys_columncategory);
                sys_columncategorys.Add(sys_columncategory);
            }
        }
コード例 #5
0
        private static void SetListSYS_CategoryManagerInfoAddColumnCategory(ref DbDataReader reader, ref List <SYS_CategoryManager> sys_categorymanagers)
        {
            SYS_CategoryManager          sys_categorymanager         = null;
            SYS_ColumnCategoryDataAccess sysColumnCategoryDataAccess = new SYS_ColumnCategoryDataAccess();

            while (reader.Read())
            {
                sys_categorymanager = new SYS_CategoryManager();
                SYS_CategoryManagerDataAccess.SetSYS_CategoryManagerInfo(reader, ref sys_categorymanager);
                sys_categorymanager.LstColumnCategory = sysColumnCategoryDataAccess.SelectAllSYS_ColumnCategoryByIDCategoryManager(sys_categorymanager.ID);
                sys_categorymanagers.Add(sys_categorymanager);
            }
        }