Exemplo n.º 1
0
        public void Initialize()
        {
            lstPosteriorSegment_OD.SelectedIndex = -1;
            lstPosteriorSegment_OS.SelectedIndex = -1;
            FullScreenMode = FullScreenMode.NotFullScreen;
            txtReccommednations_OD.EnterMoveNextControl = false;

            if (PEMRBusinessLogic.ActivePEMRObject == null ||
                PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainPosteriorSegmentSign == null ||
                PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainPosteriorSegmentSign.Count == 0 ||
                PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_PosteriorSegmentSign == null ||
                PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_PosteriorSegmentSign.Count == 0)
            {
                return;
            }
            txtReccommednations_OD.EditValue = PEMRBusinessLogic.ActivePEMRObject
                                               .List_VisitTiming_MainPosteriorSegmentSign[0].GeneralDescription_OD;
            txtReccommednations_OS.EditValue = PEMRBusinessLogic.ActivePEMRObject
                                               .List_VisitTiming_MainPosteriorSegmentSign[0].GeneralDescription_OS;

            AddedPosteriorSegmentSign_OD = null;
            AddedPosteriorSegmentSign_OS = null;
            foreach (VisitTiming_PosteriorSegmentSign visitTimingPosterior in PEMRBusinessLogic.ActivePEMRObject
                     .List_VisitTiming_PosteriorSegmentSign.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(visitTimingPosterior.SegmentSign_CU_ID)));
                if (segmentSign != null)
                {
                    DB_EyeType_p eyeTpe = (DB_EyeType_p)visitTimingPosterior.Eye_P_ID;
                    switch (eyeTpe)
                    {
                    case DB_EyeType_p.OD:
                        if (AddedPosteriorSegmentSign_OD == null)
                        {
                            AddedPosteriorSegmentSign_OD = new List <SegmentSign_cu>();
                        }
                        AddedPosteriorSegmentSign_OD.Add(segmentSign);
                        break;

                    case DB_EyeType_p.OS:
                        if (AddedPosteriorSegmentSign_OS == null)
                        {
                            AddedPosteriorSegmentSign_OS = new List <SegmentSign_cu>();
                        }
                        AddedPosteriorSegmentSign_OS.Add(segmentSign);
                        break;
                    }
                }
            }

            ClearControls(false);
            CommonViewsActions.FillListBoxControl(lstAddedPosteriorSegment_OD, AddedPosteriorSegmentSign_OD);
            CommonViewsActions.FillListBoxControl(lstAddedPosteriorSegment_OS, AddedPosteriorSegmentSign_OS);
            lstAddedPosteriorSegment_OD.Refresh();
            lstAddedPosteriorSegment_OS.Refresh();
            SetCount_OD();
            SetCount_OS();

            PEMRBusinessLogic.PEMR_PosteriorSegment = this;
        }
Exemplo n.º 2
0
        private void btnAddList_OS_Click(object sender, EventArgs e)
        {
            if (TempPosteriorSegmentSignListToBeAdded_OS == null || TempPosteriorSegmentSignListToBeAdded_OS.Count == 0)
            {
                XtraMessageBox.Show(
                    "You should select at least one Posterior Segment Sign to be added." + "\r\n" +
                    "You can select one or more Posterior Segment Sign to add", "Note", MessageBoxButtons.OK,
                    MessageBoxIcon.Hand);
                return;
            }

            if (AddedPosteriorSegmentSign_OS == null)
            {
                AddedPosteriorSegmentSign_OS = new List <SegmentSign_cu>();
            }
            if (TempPosteriorSegmentSignListToBeAdded_OS != null && TempPosteriorSegmentSignListToBeAdded_OS.Count > 0)
            {
                foreach (SegmentSign_cu segmentSign in TempPosteriorSegmentSignListToBeAdded_OS)
                {
                    if (!AddedPosteriorSegmentSign_OS.Exists(item =>
                                                             Convert.ToInt32(item.ID).Equals(Convert.ToInt32(segmentSign.ID))))
                    {
                        AddedPosteriorSegmentSign_OS.Add(segmentSign);
                        if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainPosteriorSegmentSign == null)
                        {
                            PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainPosteriorSegmentSign =
                                new List <VisitTiming_MainPosteriorSegmentSign>();
                            _mainPosteriorSegmentSign = PEMRBusinessLogic.CreateNew_VisitTiming_MainPosteriorSegmentSign(
                                FurtherDetails_OD, FurtherDetails_OS,
                                ApplicationStaticConfiguration.PEMRSavingMode);
                            PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainPosteriorSegmentSign.Add(
                                _mainPosteriorSegmentSign);
                        }

                        if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainPosteriorSegmentSign[0] != null)
                        {
                            if (!string.IsNullOrEmpty(txtReccommednations_OD.Text) ||
                                !string.IsNullOrWhiteSpace(txtReccommednations_OD.Text))
                            {
                                PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainPosteriorSegmentSign[0].GeneralDescription_OD
                                    = txtReccommednations_OD.Text;
                            }
                            else
                            {
                                PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainPosteriorSegmentSign[0]
                                .GeneralDescription_OD = null;
                            }
                        }

                        if (PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_PosteriorSegmentSign == null)
                        {
                            PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_PosteriorSegmentSign =
                                new List <VisitTiming_PosteriorSegmentSign>();
                        }
                        _visitTimingPosteriorSegment = PEMRBusinessLogic.CreateNew_VisitTiming_PosteriorSegmentSign(
                            PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_MainPosteriorSegmentSign[0], segmentSign,
                            DB_EyeType_p.OS, DB_PEMRSavingMode.SaveImmediately);
                        if (_visitTimingPosteriorSegment != null)
                        {
                            PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_PosteriorSegmentSign.Add(
                                _visitTimingPosteriorSegment);
                        }
                    }
                }
            }

            TempPosteriorSegmentSignListToBeAdded_OS = null;
            CommonViewsActions.FillListBoxControl(lstAddedPosteriorSegment_OS, AddedPosteriorSegmentSign_OS);
            lstAddedPosteriorSegment_OS.Refresh();
            SetCount_OS();
            SetCount_OS();
            lstPosteriorSegment_OS.SelectedIndex = -1;
        }