private void btnAdd_Click(object sender, EventArgs e) { DialogResult result = XtraMessageBox.Show("Do you to add this Readings?", "Note", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation); switch (result) { case DialogResult.Yes: VisitTiming_EOMReading visitTiming_EOMReading = PEMRBusinessLogic.CreateNew_VisitTiming_EOMReading(this, ApplicationStaticConfiguration.PEMRSavingMode); if (visitTiming_EOMReading != null) { if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_EOMReading == null) { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_EOMReading = new List <VisitTiming_EOMReading>(); } PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_EOMReading.Add(visitTiming_EOMReading); List <GetPreviousVisitTiming_EOMReading_Result> list = PEMRBusinessLogic.GetPrevious_VisitTiming_EOMReading_Result( PEMRBusinessLogic.ActivePEMRObject.Active_Patient.ID, dtSearchFrom.EditValue, dtSearchTo.EditValue); if (list != null) { list = list.OrderByDescending(item => item.TakenDateTime).ToList(); } grdControl.DataSource = list; grdControl.RefreshDataSource(); SetToolTip(list); ClearControls(true); } break; } }