Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
 public static void MarkAsSeen(ERP_Notification item)
 {
     item.status = Constants.NF_STATUS_SEEN;
     Save(item);
 }
Exemplo n.º 3
0
 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;
     }
 }
Exemplo n.º 4
0
 partial void DeleteERP_Notification(ERP_Notification instance);
Exemplo n.º 5
0
 partial void UpdateERP_Notification(ERP_Notification instance);
Exemplo n.º 6
0
 partial void InsertERP_Notification(ERP_Notification instance);
Exemplo n.º 7
0
		private void detach_ERP_Notifications(ERP_Notification entity)
		{
			this.SendPropertyChanging();
			entity.ERP_Application = null;
		}
Exemplo n.º 8
0
		private void attach_ERP_Notifications(ERP_Notification entity)
		{
			this.SendPropertyChanging();
			entity.ERP_Role = this;
		}