コード例 #1
0
ファイル: TOCRules.cs プロジェクト: nathantownsend/ePermitDAL
        /// <summary>
        /// Creates a new TOCRules record using async
        /// </summary>
        public static async Task<int> CreateAsync(TOCRulesDO DO)
        {
            SqlParameter _Section = new SqlParameter("Section", SqlDbType.VarChar);
            SqlParameter _SubSection = new SqlParameter("SubSection", SqlDbType.VarChar);
            SqlParameter _TOCID = new SqlParameter("TOCID", SqlDbType.Int);
            
            _Section.Value = DO.Section;
            _SubSection.Value = DO.SubSection;
            _TOCID.Value = DO.TOCID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _Section,
                _SubSection,
                _TOCID
            };

            string pid = ConfigurationManager.AppSettings["ePermitDAL"];

            return await DataCommon.ExecuteScalarAsync("[dbo].[TOCRules_Insert]", _params, pid);
            
        }
コード例 #2
0
ファイル: TOCRules.cs プロジェクト: nathantownsend/ePermitDAL
        /// <summary>
        /// Updates a TOCRules record and returns the number of records affected
        /// </summary>
        public static int Update(TOCRulesDO DO)
        {
            SqlParameter _TOCRulesID = new SqlParameter("TOCRulesID", SqlDbType.Int);
            SqlParameter _Section = new SqlParameter("Section", SqlDbType.VarChar);
            SqlParameter _SubSection = new SqlParameter("SubSection", SqlDbType.VarChar);
            SqlParameter _TOCID = new SqlParameter("TOCID", SqlDbType.Int);
            
            _TOCRulesID.Value = DO.TOCRulesID;
            _Section.Value = DO.Section;
            _SubSection.Value = DO.SubSection;
            _TOCID.Value = DO.TOCID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _TOCRulesID,
                _Section,
                _SubSection,
                _TOCID
            };

            string pid = ConfigurationManager.AppSettings["ePermitDAL"];

            return DataCommon.ExecuteScalar("[dbo].[TOCRules_Update]", _params, pid);
        }
コード例 #3
0
ファイル: TOCRules.cs プロジェクト: nathantownsend/ePermitDAL
        /// <summary>
        /// Selects TOCRules records by TOCRulesSubSectionTOCID
        /// </summary>
        public static async Task<TOCRulesDO[]> GetByTOCRulesSubSectionTOCIDAsync(String SubSection,
 Int32 TOCID)
        {

            SqlParameter _SubSection = new SqlParameter("SubSection", SqlDbType.VarChar);
            SqlParameter _TOCID = new SqlParameter("TOCID", SqlDbType.Int);
			
            _SubSection.Value = SubSection;
            _TOCID.Value = TOCID;
			
            SqlParameter[] _params = new SqlParameter[] {
                _SubSection,
                _TOCID
            };

            string pid = ConfigurationManager.AppSettings["ePermitDAL"];

            SafeReader sr = await DataCommon.ExecuteSafeReaderAsync("[dbo].[TOCRules_GetByTOCRulesSubSectionTOCID]", _params, pid);


            List<TOCRulesDO> objs = new List<TOCRulesDO>();
			
            while(sr.Read())
            {
                TOCRulesDO obj = new TOCRulesDO();
				
                obj.TOCRulesID = sr.GetInt32(sr.GetOrdinal("TOCRulesID"));
                obj.Section = sr.GetString(sr.GetOrdinal("Section"));
                obj.SubSection = sr.GetString(sr.GetOrdinal("SubSection"));
                obj.TOCID = sr.GetInt32(sr.GetOrdinal("TOCID"));
                

                objs.Add(obj);
            }

            return objs.ToArray();
        }
コード例 #4
0
ファイル: TOCRules.cs プロジェクト: nathantownsend/ePermitDAL
/// <summary>
        /// Selects TOCRules records by SectionSubSection
        /// </summary>
        public static TOCRulesDO[] GetBySectionSubSection(String Section,
 String SubSection)
        {

            SqlParameter _Section = new SqlParameter("Section", SqlDbType.VarChar);
            SqlParameter _SubSection = new SqlParameter("SubSection", SqlDbType.VarChar);
			
            _Section.Value = Section;
            _SubSection.Value = SubSection;
			
            SqlParameter[] _params = new SqlParameter[] {
                _Section,
                _SubSection
            };

            string pid = ConfigurationManager.AppSettings["ePermitDAL"];

            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[TOCRules_GetBySectionSubSection]", _params, pid);


            List<TOCRulesDO> objs = new List<TOCRulesDO>();
			
            while(sr.Read())
            {
                TOCRulesDO obj = new TOCRulesDO();
				
                obj.TOCRulesID = sr.GetInt32(sr.GetOrdinal("TOCRulesID"));
                obj.Section = sr.GetString(sr.GetOrdinal("Section"));
                obj.SubSection = sr.GetString(sr.GetOrdinal("SubSection"));
                obj.TOCID = sr.GetInt32(sr.GetOrdinal("TOCID"));
                

                objs.Add(obj);
            }

            return objs.ToArray();
        }
コード例 #5
0
ファイル: TOCRules.cs プロジェクト: nathantownsend/ePermitDAL
        /// <summary>
        /// Gets all TOCRules records
        /// </summary>
        public static async Task<TOCRulesDO[]> GetAllAsync()
        {

            string pid = ConfigurationManager.AppSettings["ePermitDAL"];

            SafeReader sr = await DataCommon.ExecuteSafeReaderAsync("[dbo].[TOCRules_GetAll]", new SqlParameter[] { }, pid);
            
            List<TOCRulesDO> objs = new List<TOCRulesDO>();
            
            while(sr.Read()){

                TOCRulesDO obj = new TOCRulesDO();
                
                obj.TOCRulesID = sr.GetInt32(sr.GetOrdinal("TOCRulesID"));
                obj.Section = sr.GetString(sr.GetOrdinal("Section"));
                obj.SubSection = sr.GetString(sr.GetOrdinal("SubSection"));
                obj.TOCID = sr.GetInt32(sr.GetOrdinal("TOCID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }
コード例 #6
0
ファイル: TOCRules.cs プロジェクト: nathantownsend/ePermitDAL
        /// <summary>
        /// Deletes a TOCRules record
        /// </summary>
        public static async Task<int> DeleteAsync(TOCRulesDO DO)
        {
            SqlParameter _TOCRulesID = new SqlParameter("TOCRulesID", SqlDbType.Int);
            
            _TOCRulesID.Value = DO.TOCRulesID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _TOCRulesID
            };

            string pid = ConfigurationManager.AppSettings["ePermitDAL"];

            return await DataCommon.ExecuteScalarAsync("[dbo].[TOCRules_Delete]", _params, pid);
        }