/// <summary> /// Updates a NonComplianceType record and returns the number of records affected /// </summary> public static int Update(NonComplianceTypeDO DO) { SqlParameter _NonComplianceTypeID = new SqlParameter("NonComplianceTypeID", SqlDbType.VarChar); _NonComplianceTypeID.Value = DO.NonComplianceTypeID; SqlParameter[] _params = new SqlParameter[] { _NonComplianceTypeID }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; return DataCommon.ExecuteScalar("[dbo].[NonComplianceType_Update]", _params, pid); }
/// <summary> /// Creates a new NonComplianceType record using async /// </summary> public static async Task CreateAsync(NonComplianceTypeDO DO) { SqlParameter _NonComplianceTypeID = new SqlParameter("NonComplianceTypeID", SqlDbType.VarChar); _NonComplianceTypeID.Value = DO.NonComplianceTypeID; SqlParameter[] _params = new SqlParameter[] { _NonComplianceTypeID }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; await DataCommon.ExecuteNonQueryAsync("[dbo].[NonComplianceType_Insert]", _params, pid); }
/// <summary> /// Selects NonComplianceType records by PK /// </summary> public static async Task<NonComplianceTypeDO[]> GetByPKAsync(String NonComplianceTypeID) { SqlParameter _NonComplianceTypeID = new SqlParameter("NonComplianceTypeID", SqlDbType.VarChar); _NonComplianceTypeID.Value = NonComplianceTypeID; SqlParameter[] _params = new SqlParameter[] { _NonComplianceTypeID }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; SafeReader sr = await DataCommon.ExecuteSafeReaderAsync("[dbo].[NonComplianceType_GetByPK]", _params, pid); List<NonComplianceTypeDO> objs = new List<NonComplianceTypeDO>(); while(sr.Read()) { NonComplianceTypeDO obj = new NonComplianceTypeDO(); obj.NonComplianceTypeID = sr.GetString(sr.GetOrdinal("NonComplianceTypeID")); objs.Add(obj); } return objs.ToArray(); }
/// <summary> /// Gets all NonComplianceType records /// </summary> public static async Task<NonComplianceTypeDO[]> GetAllAsync() { string pid = ConfigurationManager.AppSettings["ePermitDAL"]; SafeReader sr = await DataCommon.ExecuteSafeReaderAsync("[dbo].[NonComplianceType_GetAll]", new SqlParameter[] { }, pid); List<NonComplianceTypeDO> objs = new List<NonComplianceTypeDO>(); while(sr.Read()){ NonComplianceTypeDO obj = new NonComplianceTypeDO(); obj.NonComplianceTypeID = sr.GetString(sr.GetOrdinal("NonComplianceTypeID")); objs.Add(obj); } return objs.ToArray(); }