/// <summary> /// Deletes a UserNotification record /// </summary> public static int Delete(UserNotificationDO DO) { SqlParameter _RegistrationID = new SqlParameter("RegistrationID", SqlDbType.Int); SqlParameter _NotificationTypeID = new SqlParameter("NotificationTypeID", SqlDbType.VarChar); _RegistrationID.Value = DO.RegistrationID; _NotificationTypeID.Value = DO.NotificationTypeID; SqlParameter[] _params = new SqlParameter[] { _RegistrationID, _NotificationTypeID }; return DataCommon.ExecuteScalar("[dbo].[UserNotification_Delete]", _params, "dbo"); }
/// <summary> /// Creates a new UserNotification record /// </summary> public static void Create(UserNotificationDO DO) { SqlParameter _RegistrationID = new SqlParameter("RegistrationID", SqlDbType.Int); SqlParameter _NotificationTypeID = new SqlParameter("NotificationTypeID", SqlDbType.VarChar); _RegistrationID.Value = DO.RegistrationID; _NotificationTypeID.Value = DO.NotificationTypeID; SqlParameter[] _params = new SqlParameter[] { _RegistrationID, _NotificationTypeID }; DataCommon.ExecuteNonQuery("[dbo].[UserNotification_Insert]", _params, "dbo"); }
/// <summary> /// Gets all UserNotification records /// </summary> public static UserNotificationDO[] GetAll() { SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[UserNotification_GetAll]", new SqlParameter[] { }, "dbo"); List<UserNotificationDO> objs = new List<UserNotificationDO>(); while(sr.Read()){ UserNotificationDO obj = new UserNotificationDO(); obj.RegistrationID = sr.GetInt32(sr.GetOrdinal("RegistrationID")); obj.NotificationTypeID = sr.GetString(sr.GetOrdinal("NotificationTypeID")); objs.Add(obj); } return objs.ToArray(); }
/// <summary> /// Selects UserNotification records by PK /// </summary> public static UserNotificationDO[] GetByPK(Int32 RegistrationID, String NotificationTypeID) { SqlParameter _RegistrationID = new SqlParameter("RegistrationID", SqlDbType.Int); SqlParameter _NotificationTypeID = new SqlParameter("NotificationTypeID", SqlDbType.VarChar); _RegistrationID.Value = RegistrationID; _NotificationTypeID.Value = NotificationTypeID; SqlParameter[] _params = new SqlParameter[] { _RegistrationID, _NotificationTypeID }; SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[UserNotification_GetByPK]", _params, "dbo"); List<UserNotificationDO> objs = new List<UserNotificationDO>(); while(sr.Read()) { UserNotificationDO obj = new UserNotificationDO(); obj.RegistrationID = sr.GetInt32(sr.GetOrdinal("RegistrationID")); obj.NotificationTypeID = sr.GetString(sr.GetOrdinal("NotificationTypeID")); objs.Add(obj); } return objs.ToArray(); }