public void Initialize() { lstAdnexaSegment_OD.SelectedIndex = -1; lstAdnexaSegment_OS.SelectedIndex = -1; FullScreenMode = FullScreenMode.NotFullScreen; txtReccommednations_OD.EnterMoveNextControl = false; if (PEMRBusinessLogic.ActivePEMRObject == null || PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAdnexaSegmentSign == null || PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAdnexaSegmentSign.Count == 0 || PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AdnexaSegmentSign == null || PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AdnexaSegmentSign.Count == 0) { return; } txtReccommednations_OD.EditValue = PEMRBusinessLogic.ActivePEMRObject .List_VisitTiming_MainAdnexaSegmentSign[0].GeneralDescription_OD; txtReccommednations_OS.EditValue = PEMRBusinessLogic.ActivePEMRObject .List_VisitTiming_MainAdnexaSegmentSign[0].GeneralDescription_OS; AddedAdnexaSegmentSign_OD = null; AddedAdnexaSegmentSign_OS = null; foreach (VisitTiming_AdnexaSegmentSign visitTimingAdnexa in PEMRBusinessLogic.ActivePEMRObject .List_VisitTiming_AdnexaSegmentSign.FindAll(item => !Convert.ToInt32(item.PEMRElementStatus).Equals(Convert.ToInt32(PEMRElementStatus.Removed)))) { SegmentSign_cu segmentSign = SegmentSign_cu.ItemsList.Find(item => Convert.ToInt32(item.ID).Equals(Convert.ToInt32(visitTimingAdnexa.SegmentSign_CU_ID))); if (segmentSign != null) { DB_EyeType_p eyeTpe = (DB_EyeType_p)visitTimingAdnexa.Eye_P_ID; switch (eyeTpe) { case DB_EyeType_p.OD: if (AddedAdnexaSegmentSign_OD == null) { AddedAdnexaSegmentSign_OD = new List <SegmentSign_cu>(); } AddedAdnexaSegmentSign_OD.Add(segmentSign); break; case DB_EyeType_p.OS: if (AddedAdnexaSegmentSign_OS == null) { AddedAdnexaSegmentSign_OS = new List <SegmentSign_cu>(); } AddedAdnexaSegmentSign_OS.Add(segmentSign); break; } } } ClearControls(false); CommonViewsActions.FillListBoxControl(lstAddedAdnexaSegment_OD, AddedAdnexaSegmentSign_OD); CommonViewsActions.FillListBoxControl(lstAddedAdnexaSegment_OS, AddedAdnexaSegmentSign_OS); lstAddedAdnexaSegment_OD.Refresh(); lstAddedAdnexaSegment_OS.Refresh(); SetCount_OD(); SetCount_OS(); PEMRBusinessLogic.PEMR_Adnexa = this; }
private void btnAddList_OS_Click(object sender, EventArgs e) { if (TempAdnexaSegmentSignListToBeAdded_OS == null || TempAdnexaSegmentSignListToBeAdded_OS.Count == 0) { XtraMessageBox.Show( "You should select at least one Adnexa Segment Sign to be added." + "\r\n" + "You can select one or more Adnexa Segment Sign to add", "Note", MessageBoxButtons.OK, MessageBoxIcon.Hand); return; } if (AddedAdnexaSegmentSign_OS == null) { AddedAdnexaSegmentSign_OS = new List <SegmentSign_cu>(); } if (TempAdnexaSegmentSignListToBeAdded_OS != null && TempAdnexaSegmentSignListToBeAdded_OS.Count > 0) { foreach (SegmentSign_cu segmentSign in TempAdnexaSegmentSignListToBeAdded_OS) { if (!AddedAdnexaSegmentSign_OS.Exists(item => Convert.ToInt32(item.ID).Equals(Convert.ToInt32(segmentSign.ID)))) { AddedAdnexaSegmentSign_OS.Add(segmentSign); if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAdnexaSegmentSign == null) { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAdnexaSegmentSign = new List <VisitTiming_MainAdnexaSegmentSign>(); _mainAdnexaSegmentSign = PEMRBusinessLogic.CreateNew_VisitTiming_MainAdnexaSegmentSign( FurtherDetails_OD, FurtherDetails_OD, ApplicationStaticConfiguration.PEMRSavingMode); PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAdnexaSegmentSign.Add( _mainAdnexaSegmentSign); } if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAdnexaSegmentSign[0] != null) { if (!string.IsNullOrEmpty(txtReccommednations_OD.Text) || !string.IsNullOrWhiteSpace(txtReccommednations_OD.Text)) { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAdnexaSegmentSign[0].GeneralDescription_OD = txtReccommednations_OD.Text; } else { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAdnexaSegmentSign[0] .GeneralDescription_OD = null; } } if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AdnexaSegmentSign == null) { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AdnexaSegmentSign = new List <VisitTiming_AdnexaSegmentSign>(); } _visitTimingAdnexaSegment = PEMRBusinessLogic.CreateNew_VisitTiming_AdnexaSegmentSign( PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAdnexaSegmentSign[0], segmentSign, DB_EyeType_p.OS, DB_PEMRSavingMode.SaveImmediately); if (_visitTimingAdnexaSegment != null) { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AdnexaSegmentSign.Add( _visitTimingAdnexaSegment); } } } } TempAdnexaSegmentSignListToBeAdded_OS = null; CommonViewsActions.FillListBoxControl(lstAddedAdnexaSegment_OS, AddedAdnexaSegmentSign_OS); lstAddedAdnexaSegment_OS.Refresh(); SetCount_OS(); SetCount_OS(); lstAdnexaSegment_OS.SelectedIndex = -1; }