private static void AddNotification(int to_user_id, int from_user_id, string notification_type, string job_type, int jobid) { try { ERP_Notification n = new ERP_Notification(); n.to_user_id = to_user_id; n.from_user_id = from_user_id; n.application_id = Constants.CRM_APP_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 = 1; n.created_at = DateTime.Now; n.updated_at = DateTime.Now; Database.Erp.ERP_Notifications.InsertOnSubmit(n); Database.Erp.SubmitChanges(); } catch (Exception e) { Constants.Comment("Error adding notification: "+e.Message); } }
private static void SaveNotification(ERP_Notification nf) { try { nf.modified_by = _defaultUserId; nf.updated_at = DateTime.Now; Database.Erp.SubmitChanges(); } catch (Exception e) { Constants.Comment("Error saving notification: " + e.Message); } }
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; }