コード例 #1
0
        /// <summary>
        /// Updates a NonComplianceType record and returns the number of records affected
        /// </summary>
        public static int Update(NonComplianceTypeDO DO)
        {
            SqlParameter _NonComplianceTypeID = new SqlParameter("NonComplianceTypeID", SqlDbType.VarChar);
            
            _NonComplianceTypeID.Value = DO.NonComplianceTypeID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _NonComplianceTypeID
            };

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

            return DataCommon.ExecuteScalar("[dbo].[NonComplianceType_Update]", _params, pid);
        }
コード例 #2
0
        /// <summary>
        /// Creates a new NonComplianceType record using async
        /// </summary>
        public static async Task CreateAsync(NonComplianceTypeDO DO)
        {
            SqlParameter _NonComplianceTypeID = new SqlParameter("NonComplianceTypeID", SqlDbType.VarChar);
            
            _NonComplianceTypeID.Value = DO.NonComplianceTypeID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _NonComplianceTypeID
            };

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

            await DataCommon.ExecuteNonQueryAsync("[dbo].[NonComplianceType_Insert]", _params, pid);
            
        }
コード例 #3
0
        /// <summary>
        /// Selects NonComplianceType records by PK
        /// </summary>
        public static async Task<NonComplianceTypeDO[]> GetByPKAsync(String NonComplianceTypeID)
        {

            SqlParameter _NonComplianceTypeID = new SqlParameter("NonComplianceTypeID", SqlDbType.VarChar);
			
            _NonComplianceTypeID.Value = NonComplianceTypeID;
			
            SqlParameter[] _params = new SqlParameter[] {
                _NonComplianceTypeID
            };

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

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


            List<NonComplianceTypeDO> objs = new List<NonComplianceTypeDO>();
			
            while(sr.Read())
            {
                NonComplianceTypeDO obj = new NonComplianceTypeDO();
				
                obj.NonComplianceTypeID = sr.GetString(sr.GetOrdinal("NonComplianceTypeID"));
                

                objs.Add(obj);
            }

            return objs.ToArray();
        }
コード例 #4
0
        /// <summary>
        /// Gets all NonComplianceType records
        /// </summary>
        public static async Task<NonComplianceTypeDO[]> GetAllAsync()
        {

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

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

                NonComplianceTypeDO obj = new NonComplianceTypeDO();
                
                obj.NonComplianceTypeID = sr.GetString(sr.GetOrdinal("NonComplianceTypeID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }