/// <summary>
        /// Creates a new PondSpecificDesignAndAsBuilt record using async
        /// </summary>
        public static async Task<int> CreateAsync(PondSpecificDesignAndAsBuiltDO DO)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);
            SqlParameter _PondID = new SqlParameter("PondID", SqlDbType.VarChar);
            SqlParameter _DesignAttachmentID = new SqlParameter("DesignAttachmentID", SqlDbType.Int);
            SqlParameter _AsBuiltAttachmentID = new SqlParameter("AsBuiltAttachmentID", SqlDbType.Int);
            
            _PermitKey.Value = DO.PermitKey;
            _PondID.Value = DO.PondID;
            _DesignAttachmentID.Value = DO.DesignAttachmentID;
            _AsBuiltAttachmentID.Value = DO.AsBuiltAttachmentID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _PermitKey,
                _PondID,
                _DesignAttachmentID,
                _AsBuiltAttachmentID
            };

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

            return await DataCommon.ExecuteScalarAsync("[dbo].[PondSpecificDesignAndAsBuilt_Insert]", _params, pid);
            
        }
        /// <summary>
        /// Gets all PondSpecificDesignAndAsBuilt records
        /// </summary>
        public static PondSpecificDesignAndAsBuiltDO[] GetAll()
        {

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

            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[PondSpecificDesignAndAsBuilt_GetAll]", new SqlParameter[] { }, pid);
            
            List<PondSpecificDesignAndAsBuiltDO> objs = new List<PondSpecificDesignAndAsBuiltDO>();
            
            while(sr.Read()){

                PondSpecificDesignAndAsBuiltDO obj = new PondSpecificDesignAndAsBuiltDO();
                
                obj.PondSpecificDesignAndAsBuiltID = sr.GetInt32(sr.GetOrdinal("PondSpecificDesignAndAsBuiltID"));
                obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey"));
                obj.PondID = sr.GetString(sr.GetOrdinal("PondID"));
                obj.DesignAttachmentID = sr.GetInt32(sr.GetOrdinal("DesignAttachmentID"));
                if (sr.IsDBNull(sr.GetOrdinal("AsBuiltAttachmentID"))) { obj.AsBuiltAttachmentID = null; } else { obj.AsBuiltAttachmentID = sr.GetInt32(sr.GetOrdinal("AsBuiltAttachmentID")); }


                objs.Add(obj);
            }

            return objs.ToArray();
        }
        /// <summary>
        /// Selects PondSpecificDesignAndAsBuilt records by PK
        /// </summary>
        public static async Task<PondSpecificDesignAndAsBuiltDO[]> GetByPKAsync(Int32 PondSpecificDesignAndAsBuiltID)
        {

            SqlParameter _PondSpecificDesignAndAsBuiltID = new SqlParameter("PondSpecificDesignAndAsBuiltID", SqlDbType.Int);
			
            _PondSpecificDesignAndAsBuiltID.Value = PondSpecificDesignAndAsBuiltID;
			
            SqlParameter[] _params = new SqlParameter[] {
                _PondSpecificDesignAndAsBuiltID
            };

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

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


            List<PondSpecificDesignAndAsBuiltDO> objs = new List<PondSpecificDesignAndAsBuiltDO>();
			
            while(sr.Read())
            {
                PondSpecificDesignAndAsBuiltDO obj = new PondSpecificDesignAndAsBuiltDO();
				
                obj.PondSpecificDesignAndAsBuiltID = sr.GetInt32(sr.GetOrdinal("PondSpecificDesignAndAsBuiltID"));
                obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey"));
                obj.PondID = sr.GetString(sr.GetOrdinal("PondID"));
                obj.DesignAttachmentID = sr.GetInt32(sr.GetOrdinal("DesignAttachmentID"));
                if (sr.IsDBNull(sr.GetOrdinal("AsBuiltAttachmentID"))) { obj.AsBuiltAttachmentID = null; } else { obj.AsBuiltAttachmentID = sr.GetInt32(sr.GetOrdinal("AsBuiltAttachmentID")); }

                objs.Add(obj);
            }

            return objs.ToArray();
        }
        /// <summary>
        /// Deletes a PondSpecificDesignAndAsBuilt record
        /// </summary>
        public static async Task<int> DeleteAsync(PondSpecificDesignAndAsBuiltDO DO)
        {
            SqlParameter _PondSpecificDesignAndAsBuiltID = new SqlParameter("PondSpecificDesignAndAsBuiltID", SqlDbType.Int);
            
            _PondSpecificDesignAndAsBuiltID.Value = DO.PondSpecificDesignAndAsBuiltID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _PondSpecificDesignAndAsBuiltID
            };

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

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