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

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

            return DataCommon.ExecuteScalar("[dbo].[OtherPermitStatus_Update]", _params, pid);
        }
        /// <summary>
        /// Creates a new OtherPermitStatus record using async
        /// </summary>
        public static async Task CreateAsync(OtherPermitStatusDO DO)
        {
            SqlParameter _OtherPermitStatusID = new SqlParameter("OtherPermitStatusID", SqlDbType.VarChar);
            
            _OtherPermitStatusID.Value = DO.OtherPermitStatusID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _OtherPermitStatusID
            };

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

            await DataCommon.ExecuteNonQueryAsync("[dbo].[OtherPermitStatus_Insert]", _params, pid);
            
        }
        /// <summary>
        /// Selects OtherPermitStatus records by PK
        /// </summary>
        public static async Task<OtherPermitStatusDO[]> GetByPKAsync(String OtherPermitStatusID)
        {

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

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

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


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

                objs.Add(obj);
            }

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

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

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

                OtherPermitStatusDO obj = new OtherPermitStatusDO();
                
                obj.OtherPermitStatusID = sr.GetString(sr.GetOrdinal("OtherPermitStatusID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }