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