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

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

            return DataCommon.ExecuteScalar("[dbo].[LifeOfMinePhaseType_Update]", _params, pid);
        }
        /// <summary>
        /// Creates a new LifeOfMinePhaseType record using async
        /// </summary>
        public static async Task CreateAsync(LifeOfMinePhaseTypeDO DO)
        {
            SqlParameter _LifeOfMinePhaseTypeID = new SqlParameter("LifeOfMinePhaseTypeID", SqlDbType.VarChar);
            
            _LifeOfMinePhaseTypeID.Value = DO.LifeOfMinePhaseTypeID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _LifeOfMinePhaseTypeID
            };

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

            await DataCommon.ExecuteNonQueryAsync("[dbo].[LifeOfMinePhaseType_Insert]", _params, pid);
            
        }
        /// <summary>
        /// Selects LifeOfMinePhaseType records by PK
        /// </summary>
        public static async Task<LifeOfMinePhaseTypeDO[]> GetByPKAsync(String LifeOfMinePhaseTypeID)
        {

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

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

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


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

                objs.Add(obj);
            }

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

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

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

                LifeOfMinePhaseTypeDO obj = new LifeOfMinePhaseTypeDO();
                
                obj.LifeOfMinePhaseTypeID = sr.GetString(sr.GetOrdinal("LifeOfMinePhaseTypeID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }