private void btnRemoveFromList_OS_Click(object sender, EventArgs e) { if (AddedAnteriorSegmentSign_OS == null || AddedAnteriorSegmentSign_OS.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 lstAddedAnteriorSegment_OS.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 (AddedAnteriorSegmentSign_OS.Exists(item => Convert.ToInt32(item.ID).Equals(Convert.ToInt32(((SegmentSign_cu)selectedItem).ID)))) { AddedAnteriorSegmentSign_OS.Remove(segment); } VisitTiming_AnteriorSegmentSign visitTimingAnteriorSegment = PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AnteriorSegmentSign.Find(item => Convert.ToInt32(item.SegmentSignID).Equals(Convert.ToInt32(segment.ID)) && Convert.ToInt32(item.Eye_P_ID).Equals(Convert.ToInt32(DB_EyeType_p.OS))); if (visitTimingAnteriorSegment != null) { visitTimingAnteriorSegment.PEMRElementStatus = PEMRElementStatus.Removed; } PEMRBusinessLogic.Remove_VisitTiming_AnteriorSegmentSign(visitTimingAnteriorSegment); } } } TempAnteriorSegmentSignListToBeAdded_OS = null; CommonViewsActions.FillListBoxControl(lstAddedAnteriorSegment_OS, AddedAnteriorSegmentSign_OS); lstAddedAnteriorSegment_OS.Refresh(); SetCount_OS(); SetCount_OS(); lstAnteriorSegment_OS.SelectedIndex = -1; }
public void Initialize() { lstAnteriorSegment_OD.SelectedIndex = -1; lstAnteriorSegment_OS.SelectedIndex = -1; FullScreenMode = FullScreenMode.NotFullScreen; txtReccommednations_OD.EnterMoveNextControl = false; if (PEMRBusinessLogic.ActivePEMRObject == null || PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAnteriorSegmentSign == null || PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAnteriorSegmentSign.Count == 0 || PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AnteriorSegmentSign == null || PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AnteriorSegmentSign.Count == 0) { return; } txtReccommednations_OD.EditValue = PEMRBusinessLogic.ActivePEMRObject .List_VisitTiming_MainAnteriorSegmentSign[0].GeneralDescription_OD; txtReccommednations_OS.EditValue = PEMRBusinessLogic.ActivePEMRObject .List_VisitTiming_MainAnteriorSegmentSign[0].GeneralDescription_OS; AddedAnteriorSegmentSign_OD = null; AddedAnteriorSegmentSign_OS = null; foreach (VisitTiming_AnteriorSegmentSign visitTimingAnterior in PEMRBusinessLogic.ActivePEMRObject .List_VisitTiming_AnteriorSegmentSign.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(visitTimingAnterior.SegmentSignID))); if (segmentSign != null) { DB_EyeType_p eyeType = (DB_EyeType_p)visitTimingAnterior.Eye_P_ID; switch (eyeType) { case DB_EyeType_p.OD: if (AddedAnteriorSegmentSign_OD == null) { AddedAnteriorSegmentSign_OD = new List <SegmentSign_cu>(); } AddedAnteriorSegmentSign_OD.Add(segmentSign); break; case DB_EyeType_p.OS: if (AddedAnteriorSegmentSign_OS == null) { AddedAnteriorSegmentSign_OS = new List <SegmentSign_cu>(); } AddedAnteriorSegmentSign_OS.Add(segmentSign); break; } } } ClearControls(false); CommonViewsActions.FillListBoxControl(lstAddedAnteriorSegment_OD, AddedAnteriorSegmentSign_OD); CommonViewsActions.FillListBoxControl(lstAddedAnteriorSegment_OS, AddedAnteriorSegmentSign_OS); lstAddedAnteriorSegment_OD.Refresh(); lstAddedAnteriorSegment_OS.Refresh(); SetCount_OD(); SetCount_OS(); PEMRBusinessLogic.PEMR_AnteriorSegmentSign = this; }
private void btnAddList_OS_Click(object sender, EventArgs e) { if (TempAnteriorSegmentSignListToBeAdded_OS == null || TempAnteriorSegmentSignListToBeAdded_OS.Count == 0) { XtraMessageBox.Show( "You should select at least one Anterior Segment Sign to be added." + "\r\n" + "You can select one or more Anterior Segment Sign to add", "Note", MessageBoxButtons.OK, MessageBoxIcon.Hand); return; } if (AddedAnteriorSegmentSign_OS == null) { AddedAnteriorSegmentSign_OS = new List <SegmentSign_cu>(); } if (TempAnteriorSegmentSignListToBeAdded_OS != null && TempAnteriorSegmentSignListToBeAdded_OS.Count > 0) { foreach (SegmentSign_cu segmentSign in TempAnteriorSegmentSignListToBeAdded_OS) { if (!AddedAnteriorSegmentSign_OS.Exists(item => Convert.ToInt32(item.ID).Equals(Convert.ToInt32(segmentSign.ID)))) { AddedAnteriorSegmentSign_OS.Add(segmentSign); if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAnteriorSegmentSign == null) { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAnteriorSegmentSign = new List <VisitTiming_MainAnteriorSegmentSign>(); _mainAnteriorSegmentSign = PEMRBusinessLogic.CreateNew_VisitTiming_MainAnteriorSegmentSign( FurtherDetails_OD, FurtherDetails_OS, ApplicationStaticConfiguration.PEMRSavingMode); PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAnteriorSegmentSign.Add( _mainAnteriorSegmentSign); } if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAnteriorSegmentSign[0] != null) { if (!string.IsNullOrEmpty(txtReccommednations_OD.Text) || !string.IsNullOrWhiteSpace(txtReccommednations_OD.Text)) { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAnteriorSegmentSign[0].GeneralDescription_OD = txtReccommednations_OD.Text; } else { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAnteriorSegmentSign[0] .GeneralDescription_OD = null; } } if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AnteriorSegmentSign == null) { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AnteriorSegmentSign = new List <VisitTiming_AnteriorSegmentSign>(); } _visitTimingAnteriorSegment = PEMRBusinessLogic.CreateNew_VisitTiming_AnteriorSegmentSign( PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainAnteriorSegmentSign[0], segmentSign, DB_EyeType_p.OS, DB_PEMRSavingMode.SaveImmediately); if (_visitTimingAnteriorSegment != null) { PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_AnteriorSegmentSign.Add( _visitTimingAnteriorSegment); } } } } TempAnteriorSegmentSignListToBeAdded_OS = null; CommonViewsActions.FillListBoxControl(lstAddedAnteriorSegment_OS, AddedAnteriorSegmentSign_OS); lstAddedAnteriorSegment_OS.Refresh(); SetCount_OS(); SetCount_OS(); lstAnteriorSegment_OS.SelectedIndex = -1; }