/// <summary>
        /// Updates a DeficiencyType record and returns the number of records affected
        /// </summary>
        public static int Update(DeficiencyTypeDO DO)
        {
            SqlParameter _DeficiencyTypeID = new SqlParameter("DeficiencyTypeID", SqlDbType.VarChar);
            
            _DeficiencyTypeID.Value = DO.DeficiencyTypeID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _DeficiencyTypeID
            };

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

            return DataCommon.ExecuteScalar("[dbo].[DeficiencyType_Update]", _params, pid);
        }
        /// <summary>
        /// Creates a new DeficiencyType record using async
        /// </summary>
        public static async Task CreateAsync(DeficiencyTypeDO DO)
        {
            SqlParameter _DeficiencyTypeID = new SqlParameter("DeficiencyTypeID", SqlDbType.VarChar);
            
            _DeficiencyTypeID.Value = DO.DeficiencyTypeID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _DeficiencyTypeID
            };

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

            await DataCommon.ExecuteNonQueryAsync("[dbo].[DeficiencyType_Insert]", _params, pid);
            
        }
        /// <summary>
        /// Selects DeficiencyType records by PK
        /// </summary>
        public static async Task<DeficiencyTypeDO[]> GetByPKAsync(String DeficiencyTypeID)
        {

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

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

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


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

                objs.Add(obj);
            }

            return objs.ToArray();
        }
        /// <summary>
        /// Gets all DeficiencyType records
        /// </summary>
        public static async Task<DeficiencyTypeDO[]> GetAllAsync()
        {

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

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

                DeficiencyTypeDO obj = new DeficiencyTypeDO();
                
                obj.DeficiencyTypeID = sr.GetString(sr.GetOrdinal("DeficiencyTypeID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }