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_VisionRefractionReading visitTimingVisionRefraction = PEMRBusinessLogic.CreateNew_VisitTiming_VisionRefractionReading(this, ApplicationStaticConfiguration.PEMRSavingMode); if (visitTimingVisionRefraction != null) { if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_VisionRefractionReading == null) { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_VisionRefractionReading = new List <VisitTiming_VisionRefractionReading>(); } PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_VisionRefractionReading.Add( visitTimingVisionRefraction); List <GetPreviousVisitTiming_VisionRefractionReading_Result> list = PEMRBusinessLogic.GetPrevious_VisitTiming_VisionRefractionReading( 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; } }