///<summary>When appt is null you must provide aptNum and HistApptAction will be set to deleted.</summary> public static void CreateHistoryEntry(Appointment appt, HistAppointmentAction action, long aptNum = 0) { HistAppointment hist = new HistAppointment(); hist.HistUserNum = Security.CurUser.UserNum; hist.ApptSource = Security.CurUser.EServiceType; hist.HistApptAction = action; if (appt != null) //Null if deleted { hist.SetAppt(appt); } else { hist.AptNum = aptNum; hist.HistApptAction = HistAppointmentAction.Deleted; } HistAppointments.Insert(hist); }
///<summary>When appt is null you must provide aptNum and HistApptAction will be set to deleted.</summary> public static void CreateHistoryEntry(Appointment appt, HistAppointmentAction action, long aptNum = 0) { if (Security.CurUser == null) { return; //There is no user currently logged on so do not create a HistAppointment. } HistAppointment hist = new HistAppointment(); hist.HistUserNum = Security.CurUser.UserNum; hist.ApptSource = Security.CurUser.EServiceType; hist.HistApptAction = action; if (appt != null) //Null if deleted { hist.SetAppt(appt); } else { hist.AptNum = aptNum; hist.HistApptAction = HistAppointmentAction.Deleted; } HistAppointments.Insert(hist); }