/// <summary> /// Updates a PerformanceStandard record and returns the number of records affected /// </summary> public static int Update(PerformanceStandardDO DO) { SqlParameter _PerformanceStandardTypeID = new SqlParameter("PerformanceStandardTypeID", SqlDbType.Int); SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _Section = new SqlParameter("Section", SqlDbType.VarChar); _PerformanceStandardTypeID.Value = DO.PerformanceStandardTypeID; _PermitKey.Value = DO.PermitKey; _Section.Value = DO.Section; SqlParameter[] _params = new SqlParameter[] { _PerformanceStandardTypeID, _PermitKey, _Section }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; return DataCommon.ExecuteScalar("[dbo].[PerformanceStandard_Update]", _params, pid); }
/// <summary> /// Creates a new PerformanceStandard record using async /// </summary> public static async Task CreateAsync(PerformanceStandardDO DO) { SqlParameter _PerformanceStandardTypeID = new SqlParameter("PerformanceStandardTypeID", SqlDbType.Int); SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _Section = new SqlParameter("Section", SqlDbType.VarChar); _PerformanceStandardTypeID.Value = DO.PerformanceStandardTypeID; _PermitKey.Value = DO.PermitKey; _Section.Value = DO.Section; SqlParameter[] _params = new SqlParameter[] { _PerformanceStandardTypeID, _PermitKey, _Section }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; await DataCommon.ExecuteNonQueryAsync("[dbo].[PerformanceStandard_Insert]", _params, pid); }
/// <summary> /// Selects PerformanceStandard records by PK /// </summary> public static async Task<PerformanceStandardDO[]> GetByPKAsync(Int32 PermitKey, String Section) { SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _Section = new SqlParameter("Section", SqlDbType.VarChar); _PermitKey.Value = PermitKey; _Section.Value = Section; SqlParameter[] _params = new SqlParameter[] { _PermitKey, _Section }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; SafeReader sr = await DataCommon.ExecuteSafeReaderAsync("[dbo].[PerformanceStandard_GetByPK]", _params, pid); List<PerformanceStandardDO> objs = new List<PerformanceStandardDO>(); while(sr.Read()) { PerformanceStandardDO obj = new PerformanceStandardDO(); obj.PerformanceStandardTypeID = sr.GetInt32(sr.GetOrdinal("PerformanceStandardTypeID")); obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey")); obj.Section = sr.GetString(sr.GetOrdinal("Section")); objs.Add(obj); } return objs.ToArray(); }
/// <summary> /// Selects PerformanceStandard records by PerformanceStandardTypeIDPermitKey /// </summary> public static PerformanceStandardDO[] GetByPerformanceStandardTypeIDPermitKey(Int32 PerformanceStandardTypeID, Int32 PermitKey) { SqlParameter _PerformanceStandardTypeID = new SqlParameter("PerformanceStandardTypeID", SqlDbType.Int); SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); _PerformanceStandardTypeID.Value = PerformanceStandardTypeID; _PermitKey.Value = PermitKey; SqlParameter[] _params = new SqlParameter[] { _PerformanceStandardTypeID, _PermitKey }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[PerformanceStandard_GetByPerformanceStandardTypeIDPermitKey]", _params, pid); List<PerformanceStandardDO> objs = new List<PerformanceStandardDO>(); while(sr.Read()) { PerformanceStandardDO obj = new PerformanceStandardDO(); obj.PerformanceStandardTypeID = sr.GetInt32(sr.GetOrdinal("PerformanceStandardTypeID")); obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey")); obj.Section = sr.GetString(sr.GetOrdinal("Section")); objs.Add(obj); } return objs.ToArray(); }
/// <summary> /// Gets all PerformanceStandard records /// </summary> public static async Task<PerformanceStandardDO[]> GetAllAsync() { string pid = ConfigurationManager.AppSettings["ePermitDAL"]; SafeReader sr = await DataCommon.ExecuteSafeReaderAsync("[dbo].[PerformanceStandard_GetAll]", new SqlParameter[] { }, pid); List<PerformanceStandardDO> objs = new List<PerformanceStandardDO>(); while(sr.Read()){ PerformanceStandardDO obj = new PerformanceStandardDO(); obj.PerformanceStandardTypeID = sr.GetInt32(sr.GetOrdinal("PerformanceStandardTypeID")); obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey")); obj.Section = sr.GetString(sr.GetOrdinal("Section")); objs.Add(obj); } return objs.ToArray(); }
/// <summary> /// Deletes a PerformanceStandard record /// </summary> public static async Task<int> DeleteAsync(PerformanceStandardDO DO) { SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _Section = new SqlParameter("Section", SqlDbType.VarChar); _PermitKey.Value = DO.PermitKey; _Section.Value = DO.Section; SqlParameter[] _params = new SqlParameter[] { _PermitKey, _Section }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; return await DataCommon.ExecuteScalarAsync("[dbo].[PerformanceStandard_Delete]", _params, pid); }