private void btnRemoveFromList_OD_Click(object sender, EventArgs e) { if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AdnexaSegmentSign == null || PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AdnexaSegmentSign.Count == 0) { return; } if (AddedAdnexaSegmentSign_OD == null || AddedAdnexaSegmentSign_OD.Count == 0) { XtraMessageBox.Show( "You should select at least one Segment Sign to be remove." + "\r\n" + "You can select one or more Segment Signs to remove", "Note", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1, DefaultBoolean.Default); return; } foreach (object selectedItem in lstAddedAdnexaSegment_OD.SelectedItems) { if (selectedItem is SegmentSign_cu) { SegmentSign_cu segment = SegmentSign_cu.ItemsList.Find(item => Convert.ToInt32(item.ID).Equals(Convert.ToInt32(((SegmentSign_cu)selectedItem).ID))); if (segment != null) { if (AddedAdnexaSegmentSign_OD.Exists(item => Convert.ToInt32(item.ID).Equals(Convert.ToInt32(((SegmentSign_cu)selectedItem).ID)))) { AddedAdnexaSegmentSign_OD.Remove(segment); } VisitTiming_AdnexaSegmentSign visitTimingAdnexaSegment = PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AdnexaSegmentSign.Find(item => Convert.ToInt32(item.SegmentSign_CU_ID).Equals(Convert.ToInt32(segment.ID)) && Convert.ToInt32(item.Eye_P_ID).Equals(Convert.ToInt32(DB_EyeType_p.OD))); if (visitTimingAdnexaSegment != null) { visitTimingAdnexaSegment.PEMRElementStatus = PEMRElementStatus.Removed; } PEMRBusinessLogic.Remove_VisitTiming_AdnexaSegmentSign(visitTimingAdnexaSegment); } } } TempAdnexaSegmentSignListToBeAdded_OD = null; CommonViewsActions.FillListBoxControl(lstAddedAdnexaSegment_OD, AddedAdnexaSegmentSign_OD); lstAddedAdnexaSegment_OD.Refresh(); SetCount_OD(); SetCount_OS(); lstAdnexaSegment_OD.SelectedIndex = -1; }
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_OD_Click(object sender, EventArgs e) { if (TempAdnexaSegmentSignListToBeAdded_OD == null || TempAdnexaSegmentSignListToBeAdded_OD.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_OD == null) { AddedAdnexaSegmentSign_OD = new List <SegmentSign_cu>(); } if (TempAdnexaSegmentSignListToBeAdded_OD != null && TempAdnexaSegmentSignListToBeAdded_OD.Count > 0) { foreach (SegmentSign_cu segmentSign in TempAdnexaSegmentSignListToBeAdded_OD) { if (!AddedAdnexaSegmentSign_OD.Exists(item => Convert.ToInt32(item.ID).Equals(Convert.ToInt32(segmentSign.ID)))) { AddedAdnexaSegmentSign_OD.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.OD, DB_PEMRSavingMode.SaveImmediately); if (_visitTimingAdnexaSegment != null) { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AdnexaSegmentSign.Add( _visitTimingAdnexaSegment); } } } } TempAdnexaSegmentSignListToBeAdded_OD = null; CommonViewsActions.FillListBoxControl(lstAddedAdnexaSegment_OD, AddedAdnexaSegmentSign_OD); lstAddedAdnexaSegment_OD.Refresh(); SetCount_OD(); SetCount_OS(); lstAdnexaSegment_OD.SelectedIndex = -1; }