/// <summary>
        /// Creates a new EmailConfirmationLanguage record using async
        /// </summary>
        public static async Task<int> CreateAsync(EmailConfirmationLanguageDO DO)
        {
            SqlParameter _EmailConfirmationType = new SqlParameter("EmailConfirmationType", SqlDbType.VarChar);
            SqlParameter _Subject = new SqlParameter("Subject", SqlDbType.VarChar);
            SqlParameter _Body = new SqlParameter("Body", SqlDbType.VarChar);
            
            _EmailConfirmationType.Value = DO.EmailConfirmationType;
            _Subject.Value = DO.Subject;
            _Body.Value = DO.Body;
            
            SqlParameter[] _params = new SqlParameter[] {
                _EmailConfirmationType,
                _Subject,
                _Body
            };

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

            return await DataCommon.ExecuteScalarAsync("[dbo].[EmailConfirmationLanguage_Insert]", _params, pid);
            
        }
        /// <summary>
        /// Updates a EmailConfirmationLanguage record and returns the number of records affected
        /// </summary>
        public static int Update(EmailConfirmationLanguageDO DO)
        {
            SqlParameter _EmailConfirmationLanguageID = new SqlParameter("EmailConfirmationLanguageID", SqlDbType.Int);
            SqlParameter _EmailConfirmationType = new SqlParameter("EmailConfirmationType", SqlDbType.VarChar);
            SqlParameter _Subject = new SqlParameter("Subject", SqlDbType.VarChar);
            SqlParameter _Body = new SqlParameter("Body", SqlDbType.VarChar);
            
            _EmailConfirmationLanguageID.Value = DO.EmailConfirmationLanguageID;
            _EmailConfirmationType.Value = DO.EmailConfirmationType;
            _Subject.Value = DO.Subject;
            _Body.Value = DO.Body;
            
            SqlParameter[] _params = new SqlParameter[] {
                _EmailConfirmationLanguageID,
                _EmailConfirmationType,
                _Subject,
                _Body
            };

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

            return DataCommon.ExecuteScalar("[dbo].[EmailConfirmationLanguage_Update]", _params, pid);
        }
        /// <summary>
        /// Gets all EmailConfirmationLanguage records
        /// </summary>
        public static async Task<EmailConfirmationLanguageDO[]> GetAllAsync()
        {

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

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

                EmailConfirmationLanguageDO obj = new EmailConfirmationLanguageDO();
                
                obj.EmailConfirmationLanguageID = sr.GetInt32(sr.GetOrdinal("EmailConfirmationLanguageID"));
                obj.EmailConfirmationType = sr.GetString(sr.GetOrdinal("EmailConfirmationType"));
                obj.Subject = sr.GetString(sr.GetOrdinal("Subject"));
                obj.Body = sr.GetString(sr.GetOrdinal("Body"));
                


                objs.Add(obj);
            }

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

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

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

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


            List<EmailConfirmationLanguageDO> objs = new List<EmailConfirmationLanguageDO>();
			
            while(sr.Read())
            {
                EmailConfirmationLanguageDO obj = new EmailConfirmationLanguageDO();
				
                obj.EmailConfirmationLanguageID = sr.GetInt32(sr.GetOrdinal("EmailConfirmationLanguageID"));
                obj.EmailConfirmationType = sr.GetString(sr.GetOrdinal("EmailConfirmationType"));
                obj.Subject = sr.GetString(sr.GetOrdinal("Subject"));
                obj.Body = sr.GetString(sr.GetOrdinal("Body"));
                

                objs.Add(obj);
            }

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

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

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