Esempio n. 1
0
		public LogMatrixDO(LogMatrixDO obj) : this()
		{
		    SetValues(obj);
		}
Esempio n. 2
0
		public void SetValues(LogMatrixDO obj)
		{
			if(obj == null) { return; }
			ReportNumber = obj.ReportNumber;
			GradeDescription = obj.GradeDescription;
			LogSortDescription = obj.LogSortDescription;
			Species = obj.Species;
			LogGrade1 = obj.LogGrade1;
			LogGrade2 = obj.LogGrade2;
			LogGrade3 = obj.LogGrade3;
			LogGrade4 = obj.LogGrade4;
			LogGrade5 = obj.LogGrade5;
			LogGrade6 = obj.LogGrade6;
			SEDlimit = obj.SEDlimit;
			SEDminimum = obj.SEDminimum;
			SEDmaximum = obj.SEDmaximum;
		}
        private void OnCurrentLogMatrixChanged(LogMatrixDO lm)
        {
            _currentLogMatrixChanging = true;

            foreach (CheckBox cb in grades)
            {
                cb.Checked = false;
            }

            if (string.IsNullOrEmpty(lm.Species))
            {
                _logMatrixSpeciesCB.SelectedIndex = -1;
            }

            if (!String.IsNullOrEmpty(lm.LogGrade1))
            {
                SetLogMatrixGradeView(lm.LogGrade1, true);
            }
            if (!String.IsNullOrEmpty(lm.LogGrade2))
            {
                SetLogMatrixGradeView(lm.LogGrade2, true);
            }
            if (!String.IsNullOrEmpty(lm.LogGrade3))
            {
                SetLogMatrixGradeView(lm.LogGrade3, true);
            }
            if (!String.IsNullOrEmpty(lm.LogGrade4))
            {
                SetLogMatrixGradeView(lm.LogGrade4, true);
            }
            if (!String.IsNullOrEmpty(lm.LogGrade5))
            {
                SetLogMatrixGradeView(lm.LogGrade5, true);
            }
            if (!String.IsNullOrEmpty(lm.LogGrade6))
            {
                SetLogMatrixGradeView(lm.LogGrade6, true);
            }

            if (!string.IsNullOrEmpty(lm.GradeDescription))
            {
                if (lm.GradeDescription.Contains('&'))
                {
                    this._descriptorAndRB.Checked = true;
                }
                else if (lm.GradeDescription.Contains("or"))
                {
                    this._descriptorOrRB.Checked = true;
                }
                else if (lm.GradeDescription.Contains("(camprun)"))
                {
                    this._descriptorCamprunRB.Checked = true;
                }
            }
            else
            {
                this._descriptorAndRB.Checked = false;
                this._descriptorOrRB.Checked = false;
                this._descriptorCamprunRB.Checked = false;
            }

            if (lm.ReportNumber == "R008")
            {
                _r008RB.Checked = true;
            }
            else if (lm.ReportNumber == "R009")
            {
                _r009RB.Checked = true;
            }
            else
            {
                _r008RB.Checked = true;
                //HACK editing property while current logMatrix is changind causes exception to be thrown when property changed event is thrown
                lm.SuspendEvents();//prevent property changed events from fireing
                lm.ReportNumber = "R008";
                lm.ResumeEvents();
            }

            //UpdateLogGradeCode();
            _currentLogMatrixChanging = false;
        }