public static void Add(int to_user_id, string notification_type, string job_type, int jobid) { try { ERP_Notification n = new ERP_Notification(); n.application_id = AppData.ApplicationId; n.to_user_id = to_user_id; n.from_user_id = Users.GetCurrentUser().id; n.notification_type = notification_type; n.job_type = job_type; n.job_id = jobid; n.times_sent = 1; n.last_sent = DateTime.Now; n.status = Constants.NF_STATUS_NEW; n.modified_by = Users.GetCurrentUser().id; n.created_at = DateTime.Now; n.updated_at = DateTime.Now; Database.ERP.ERP_Notifications.InsertOnSubmit(n); Database.ERP.SubmitChanges(); } catch (Exception) { throw; } }
public static void MarkAsSeen(ERP_Notification item) { item.status = Constants.NF_STATUS_SEEN; Save(item); }
public static void Save(ERP_Notification nf) { try { nf.modified_by = Users.GetCurrentUser().id; nf.updated_at = DateTime.Now; Database.ERP.SubmitChanges(); } catch(Exception) { throw; } }
partial void DeleteERP_Notification(ERP_Notification instance);
partial void UpdateERP_Notification(ERP_Notification instance);
partial void InsertERP_Notification(ERP_Notification instance);
private void detach_ERP_Notifications(ERP_Notification entity) { this.SendPropertyChanging(); entity.ERP_Application = null; }
private void attach_ERP_Notifications(ERP_Notification entity) { this.SendPropertyChanging(); entity.ERP_Role = this; }