private void btnSave_Click(object sender, EventArgs e) { if (PEMRBusinessLogic.ActivePEMRObject != null) { if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_Pupillary == null || PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_Pupillary.Count == 0) { Active_VisitTiming_Pupillary = PEMRBusinessLogic.CreateNew_VisitTiming_Pupillary(this, DB_PEMRSavingMode.SaveImmediately); if (Active_VisitTiming_Pupillary == null) { return; } if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_Pupillary == null) { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_Pupillary = new List <VisitTiming_Pupillary>(); } PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_Pupillary.Add(Active_VisitTiming_Pupillary); XtraMessageBox.Show("Saved Successfully", "Saved", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (Active_VisitTiming_Pupillary == null) { return; } if (PEMRBusinessLogic.Update_VisitTiming_Pupillary(this, Active_VisitTiming_Pupillary)) { XtraMessageBox.Show("Saved Successfully", "Saved", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }