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

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

            return DataCommon.ExecuteScalar("[dbo].[OtherPermitType_Update]", _params, pid);
        }
        /// <summary>
        /// Creates a new OtherPermitType record using async
        /// </summary>
        public static async Task CreateAsync(OtherPermitTypeDO DO)
        {
            SqlParameter _OtherPermitTypeID = new SqlParameter("OtherPermitTypeID", SqlDbType.VarChar);
            
            _OtherPermitTypeID.Value = DO.OtherPermitTypeID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _OtherPermitTypeID
            };

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

            await DataCommon.ExecuteNonQueryAsync("[dbo].[OtherPermitType_Insert]", _params, pid);
            
        }
        /// <summary>
        /// Selects OtherPermitType records by PK
        /// </summary>
        public static async Task<OtherPermitTypeDO[]> GetByPKAsync(String OtherPermitTypeID)
        {

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

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

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


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

                objs.Add(obj);
            }

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

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

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

                OtherPermitTypeDO obj = new OtherPermitTypeDO();
                
                obj.OtherPermitTypeID = sr.GetString(sr.GetOrdinal("OtherPermitTypeID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }