예제 #1
0
        /// <summary>
        /// 接收数据传到窗体
        /// </summary>
        /// <param name="strMethod"></param>
        /// <param name="sender"></param>
        public void DataTransfer_Event(string strMethod, object sender)
        {
            switch (strMethod)
            {
            case "QueryProjectResultUnits":
                projectParameter.LstUnits = (List <string>)XmlUtility.Deserialize(typeof(List <string>), sender as string);
                break;

            case "QueryAssayProAllInfo":
                lstAssayProInfos = (List <AssayProjectInfo>)XmlUtility.Deserialize(typeof(List <AssayProjectInfo>), sender as string);
                this.Invoke(new EventHandler(delegate
                {
                    if (xtraTabControl1.SelectedTabPageIndex == 0)
                    {
                        projectParameter.LstAssayProInfos = lstAssayProInfos;
                    }
                    else if (xtraTabControl1.SelectedTabPageIndex == 1)
                    {
                        calibrationParameter.LstAssayProInfos = lstAssayProInfos;
                    }
                    else
                    {
                        rangeParameter.LstAssayProInfos = lstAssayProInfos;
                    }
                }));
                break;

            case "AssayProjectAdd":
                AssayProjectParamInfo assayProjectParamInfo = (AssayProjectParamInfo)XmlUtility.Deserialize(typeof(AssayProjectParamInfo), sender as string);
                projectParameter.AssayProjectParamInfos = assayProjectParamInfo;
                break;

            case "AssayProjectEdit":
                projectParameter.EnditOrDeleteProInfoHandle = (int)sender;
                if ((int)sender == 0)
                {
                    this.Invoke(new EventHandler(delegate
                    {
                        chemicalParamDic.Clear();
                        chemicalParamDic.Add("QueryAssayProAllInfo", new object[] { "" });
                        AssayProInfo_Event(chemicalParamDic);
                        QueryResultSetTb queryRsult              = new QueryResultSetTb(true);
                        List <ResultSetInfo> lstqueryResult      = QueryResultSetTb.QueryResultSetInfo;
                        projectParameter.LstAssayProParamInfoAll = new SettingsChemicalParameter().QueryAssayProjectParamInfoAll("QueryAssayProjectParamInfoAll", QueryResultSetTb.QueryResultSetInfo);
                    }));
                }
                else
                {
                    MessageBoxDraw.ShowMsg("请检查校准品、质控品、计算项目和组合项目是否包含修改的项目,如果存在,不能修改!", MsgType.Warning);
                    return;
                }
                break;

            case "AssayProjectDelete":
                if ((int)sender == 0)
                {
                    this.Invoke(new EventHandler(delegate
                    {
                        chemicalParamDic.Clear();
                        chemicalParamDic.Add("QueryAssayProAllInfo", new object[] { "" });
                        AssayProInfo_Event(chemicalParamDic);
                        QueryResultSetTb queryRsult         = new QueryResultSetTb(true);
                        List <ResultSetInfo> lstqueryResult = QueryResultSetTb.QueryResultSetInfo;
                    }));
                }
                else
                {
                    MessageBoxDraw.ShowMsg("请检查校准品、质控品、计算项目和组合项目是否包含被删除的项目,如果存在,不能删除!", MsgType.Warning);
                    return;
                }
                break;

            case "UpdateCalibParamByProNameAndType":
                calibrationParameter.ProcessSuccessOrFailureInfo(sender as string);
                break;

            case "UpdateAssayProjectParamInfo":
                if ((int)sender == 0)
                {
                    projectParameter.StrReceiveInfo = "保存失败!";
                }
                else
                {
                    projectParameter.StrReceiveInfo = "保存成功!";
                }
                break;

            case "QueryAssayProAllInfoForCalibParam":       // 为校准参数界面获取所有项目信息
                //lstAssayProInfos = (List<AssayProjectInfo>)XmlUtility.Deserialize(typeof(List<AssayProjectInfo>), sender as string);
                //calibrationParameter.LstAssayProInfos = lstAssayProInfos;
                break;

            case "QueryCalibParamInfoAll":
                //List<AssayProjectCalibrationParamInfo> lstCalibParamInfo = (List<AssayProjectCalibrationParamInfo>)XmlUtility.Deserialize(typeof(List<AssayProjectCalibrationParamInfo>), sender as string);
                //calibrationParameter.LstCalibParamInfo = lstCalibParamInfo;
                //calibrationParameter.LstAssayProInfos = lstAssayProInfos;
                break;

            case "QueryAssayProAllInfoForRangeParam":
                //lstAssayProInfos = (List<AssayProjectInfo>)XmlUtility.Deserialize(typeof(List<AssayProjectInfo>), sender as string);
                //rangeParameter.LstAssayProInfos = lstAssayProInfos;
                break;

            case "QueryRangeParamByProNameAndType":
                AssayProjectRangeParamInfo rangeParamInfo = (AssayProjectRangeParamInfo)XmlUtility.Deserialize(typeof(AssayProjectRangeParamInfo), sender as string);
                rangeParameter.RangeParamInfo = rangeParamInfo;
                break;

            case "QueryCalibratorProinfo":
                //List<CalibratorProjectinfo> calibratorProjectinfo = (List<CalibratorProjectinfo>)XmlUtility.Deserialize(typeof(List<CalibratorProjectinfo>), sender as string);
                //this.Invoke(new EventHandler(delegate { calibrationParameter.AddCalibrator(calibratorProjectinfo); }));
                break;

            case "QueryCalib":
                //List<Calibratorinfo> lisCalibratorinfo = (List<Calibratorinfo>)XmlUtility.Deserialize(typeof(List<Calibratorinfo>), sender as string);
                //calibrationParameter.lisCalibratorinfo(lisCalibratorinfo);
                break;

            case "QueryCalibrationCurve":
                //List<CalibrationCurveInfo> calibrationCurveInfo = (List<CalibrationCurveInfo>)XmlUtility.Deserialize(typeof(List<CalibrationCurveInfo>), sender as string);
                //calibrationParameter.AddcalibrationCurveInfo(calibrationCurveInfo);
                break;

            default:
                break;
            }
        }
예제 #2
0
        public void AnalyzeResult(SampleResultInfo r)
        {
            AssayProjectParamInfo A = myBatis.GetAssayProjectParamInfoByNameAndType("GetAssayProjectParamInfoByNameAndType", new AssayProjectInfo()
            {
                ProjectName = r.ProjectName, SampleType = r.SampleType
            });

            if (A == null)
            {
                return;
            }
            TimeCourseInfo T = myBatis.GetTimeCourse(r.TCNO, r.SampleCreateTime);

            if (T == null)
            {
                return;
            }
            SampleInfo S = myBatis.GetSample(r.SampleNum, r.SampleCreateTime);

            if (S == null)
            {
                return;
            }
            AssayProjectRangeParamInfo ARP = myBatis.GetRangeParamInfo(r.ProjectName, r.SampleType);

            if (ARP == null)
            {
                return;
            }
            ProjectRunSequenceInfo proRunSequence = myBatis.QueryProjectRunSequenceByProject(new AssayProjectInfo()
            {
                ProjectName = r.ProjectName, SampleType = r.SampleType
            });

            if (proRunSequence == null)
            {
                return;
            }
            //试剂吸光度判读,检测试剂是否正常
            string RgtAbsFlag = null;
            float  RgtAbs     = ABSProcess.GetReangentAbs(T, A);

            if (A.ReagentBlankMaximum > 0.000001 && A.ReagentBlankMaximum < RgtAbs)
            {
                RgtAbsFlag = "RgtAbsMax";
            }
            if (A.ReagentBlankMaximum > 0.000001 && A.ReagentBlankMinimum > RgtAbs)
            {
                RgtAbsFlag = "RgtAbsMin";
            }
            if (RgtAbsFlag != null)
            {
                if (string.IsNullOrEmpty(r.Remarks) || string.IsNullOrWhiteSpace(r.Remarks))
                {
                    r.Remarks = RgtAbsFlag;
                }
                else
                {
                    r.Remarks += "|" + RgtAbsFlag;
                }
                myBatis.UpdateNORResultRunLog(r);
                TroubleLog trouble = new TroubleLog();
                trouble.TroubleType = TROUBLETYPE.WARN;
                trouble.TroubleUnit = @"试剂";
                trouble.TroubleCode = "000002";
                trouble.TroubleInfo = string.Format(@"{0}:{1}发生试剂吸光度越界,其反应进程:{2}。请检测试剂是否过期. ", r.SampleNum, r.ProjectName, r.TCNO);
                myBatis.TroubleLogSave("TroubleLogSave", trouble);
            }


            //底物耗尽判断处理,
            string AbsLimFlag = null;
            float  AbsLimRef  = A.LimitValue;                  //(0--3.5)
            float  AbsLim     = ABSProcess.GetAbsLimAbs(T, A); //M2E abs

            if (A.AnalysisMethod == "速率A法" || A.AnalysisMethod == "速率B法")
            {
                if (A.ReactionDirection == "正反应")//正反应
                {
                    if (AbsLimRef > 0.000001 && AbsLimRef < AbsLim)
                    {
                        AbsLimFlag = "AbsLim";
                    }
                }
                if (A.ReactionDirection == "负反应")//负反应
                {
                    if (AbsLimRef > 0.000001 && AbsLimRef > AbsLim)
                    {
                        AbsLimFlag = "AbsLim";
                    }
                }
            }
            if (AbsLimFlag != null)
            {
                if (string.IsNullOrEmpty(r.Remarks) || string.IsNullOrWhiteSpace(r.Remarks))
                {
                    r.Remarks = AbsLimFlag;
                }
                else
                {
                    r.Remarks += "|" + AbsLimFlag;
                }
                myBatis.UpdateNORResultRunLog(r);

                TroubleLog trouble = new TroubleLog();
                trouble.TroubleType = TROUBLETYPE.ERR;
                trouble.TroubleUnit = @"样本";
                trouble.TroubleCode = "000003";
                trouble.TroubleInfo = string.Format(@"{0}:{1}发生底物耗尽,其反应进程:{2}", r.SampleNum, r.ProjectName, r.TCNO);
                myBatis.TroubleLogSave("TroubleLogSave", trouble);

                if (ARP.AutoRerun == true)
                {
                    //Schedule Schedule = new ScheduleService().GetSMPSchedule(r.SMPNO, r.ItemName) as Schedule;
                    TaskInfo task = myBatis.GetTask(r.ProjectName, r.SampleNum);
                    if (task == null)
                    {
                        task             = new TaskInfo();
                        task.SampleNum   = r.SampleNum;
                        task.ProjectName = r.ProjectName;
                        task.SampleType  = r.SampleType;
                        //Schedule.WorkType = S.IsEmergency == true ? WORKTYPE.E : WORKTYPE.N;
                        task.SampleDilute = "减量体积";
                        task.SendTimes    = 0;
                        task.FinishTimes  = 0;
                        task.InspectTimes = 1;
                        task.TaskState    = 0;
                        task.IsReRun      = true;
                        //Schedule.ReRun = "AbsLim";
                        if (r.ResultVolType != task.SampleDilute)//结果体积参数和计划体积参数不同才可以提交工作计划
                        {
                            //new ScheduleService().Save(Schedule);
                            myBatis.SaveTske(task);
                        }
                    }
                }
            }

            //技术 血清/尿液范围即线性范围判读
            float LineRefMin = 0.0f; //线性参考值
            float LineRefMax = 0.0f; //线性参考值

            switch (S.SampleType)
            {
            case "尿液":
            case "血清": LineRefMin = A.FirstSlope; LineRefMax = A.FirstSlopeHigh; break;
            }

            string LinFlag = null;

            try
            {
                float v = r.ConcResult;
                if (LineRefMax > 0.00001 && v > LineRefMax)
                {
                    LinFlag = "Lin.H";
                }
                if (LineRefMax > 0.00001 && v < LineRefMin)
                {
                    LinFlag = "Lin.L";
                }
            }
            catch
            {
            }
            if (LinFlag != null)
            {
                if (string.IsNullOrEmpty(r.Remarks) || string.IsNullOrWhiteSpace(r.Remarks))
                {
                    r.Remarks = LinFlag;
                }
                else
                {
                    r.Remarks += "|" + LinFlag;
                }
                myBatis.UpdateNORResultRunLog(r);
                TroubleLog trouble = new TroubleLog();
                trouble.TroubleType = TROUBLETYPE.ERR;
                trouble.TroubleUnit = @"样本";
                trouble.TroubleCode = "00001";
                trouble.TroubleInfo = string.Format(@"{0}:{1}线性范围违规,其反应进程:{2}", r.SampleNum, r.ProjectName, r.TCNO);
                myBatis.TroubleLogSave("TroubleLogSave", trouble);

                if (ARP.AutoRerun == true)
                {
                    //Schedule Schedule = new ScheduleService().GetSMPSchedule(r.SMPNO, r.ItemName) as Schedule;
                    TaskInfo task = myBatis.GetTask(r.ProjectName, r.SampleNum);
                    if (task == null)
                    {
                        task             = new TaskInfo();
                        task.SampleNum   = r.SampleNum;
                        task.ProjectName = r.ProjectName;
                        task.SampleType  = r.SampleType;
                        //Schedule.WorkType = S.IsEmergency == true ? WORKTYPE.E : WORKTYPE.N;
                        switch (LinFlag)
                        {
                        case "Lin.L": task.SampleDilute = "增量体积"; break;

                        case "Lin.H": task.SampleDilute = "减量体积"; break;
                        }
                        task.SendTimes    = 0;
                        task.FinishTimes  = 0;
                        task.InspectTimes = 1;
                        task.TaskState    = 0;
                        task.IsReRun      = true;
                        //Schedule.ReRun = "AbsLim";
                        if (r.ResultVolType != task.SampleDilute)//结果体积参数和计划体积参数不同才可以提交工作计划
                        {
                            //new ScheduleService().Save(Schedule);
                            myBatis.SaveTske(task);
                        }
                    }
                }
            }

            //血清结果浓度临界判读,只对血清样本起作用。
            if (S.SampleType == "血清")
            {
                string PanicFlag = null;
                try
                {
                    float v = r.ConcResult;
                    if (A.SerumCriticalMaximum > 0.00001 && A.SerumCriticalMaximum < v)
                    {
                        PanicFlag = "Panic.H";
                    }
                    if (A.SerumCriticalMaximum > 0.00001 && A.SerumCriticalMinimum > v)
                    {
                        PanicFlag = "Panic.L";
                    }
                }
                catch
                {
                }
                if (PanicFlag != null)
                {
                    if (string.IsNullOrEmpty(r.Remarks) || string.IsNullOrWhiteSpace(r.Remarks))
                    {
                        r.Remarks = PanicFlag;
                    }
                    else
                    {
                        r.Remarks += "|" + PanicFlag;
                    }
                    myBatis.UpdateNORResultRunLog(r);

                    TroubleLog trouble = new TroubleLog();
                    trouble.TroubleType = TROUBLETYPE.ERR;
                    trouble.TroubleUnit = @"样本";
                    trouble.TroubleCode = "00001";
                    trouble.TroubleInfo = string.Format(@"{0}:{1}发生血清临界值违规,其反应进程:{2}", r.SampleNum, r.ProjectName, r.TCNO);
                    myBatis.TroubleLogSave("TroubleLogSave", trouble);

                    if (ARP.AutoRerun == true)
                    {
                        //Schedule Schedule = new ScheduleService().GetSMPSchedule(r.SMPNO, r.ItemName) as Schedule;
                        TaskInfo task = myBatis.GetTask(r.ProjectName, r.SampleNum);
                        if (task == null)
                        {
                            task             = new TaskInfo();
                            task.SampleNum   = r.SampleNum;
                            task.ProjectName = r.ProjectName;
                            task.SampleType  = r.SampleType;
                            //Schedule.WorkType = S.IsEmergency == true ? WORKTYPE.E : WORKTYPE.N;
                            switch (r.ResultVolType)
                            {
                            case VOLTYPE.IV: task.SampleDilute = "增量体积"; break;

                            case VOLTYPE.DV: task.SampleDilute = "减量体积"; break;

                            case VOLTYPE.NA: task.SampleDilute = "常规体积"; break;
                            }
                            task.SendTimes    = 0;
                            task.FinishTimes  = 0;
                            task.InspectTimes = 1;
                            task.TaskState    = 0;
                            task.IsReRun      = true;
                            //Schedule.ReRun = "AbsLim";
                            if (r.ResultVolType != task.SampleDilute)//结果体积参数和计划体积参数不同才可以提交工作计划
                            {
                                //new ScheduleService().Save(Schedule);
                                myBatis.SaveTske(task);
                            }
                        }
                    }
                }
            }

            //前驱界限,该值是个比例
            string ProzontLimitPanicFlag = null;
            float  ProzontLimit          = ABSProcess.GetProzontLimitValue(T, A, r.ResultVolType, S.SampleType);

            if (A.ProLowestBound > 0.000001)
            {
                if (ProzontLimit > A.ProLowestBound / 100)
                {
                    ProzontLimitPanicFlag = "P*";
                }
            }
            if (ProzontLimitPanicFlag != null)
            {
                if (string.IsNullOrEmpty(r.Remarks) || string.IsNullOrWhiteSpace(r.Remarks))
                {
                    r.Remarks = ProzontLimitPanicFlag;
                }
                else
                {
                    r.Remarks += "|" + ProzontLimitPanicFlag;
                }
                myBatis.UpdateNORResultRunLog(r);
                TroubleLog trouble = new TroubleLog();
                trouble.TroubleType = TROUBLETYPE.ERR;
                trouble.TroubleUnit = @"样本";
                trouble.TroubleCode = "00001";
                trouble.TroubleInfo = string.Format(@"{0}:{1}前驱界限违规!反应进程:{2}", r.SampleNum, r.ProjectName, r.TCNO);
                myBatis.TroubleLogSave("TroubleLogSave", trouble);
                if (ARP.AutoRerun == true)
                {
                    //Schedule Schedule = new ScheduleService().GetSMPSchedule(r.SMPNO, r.ItemName) as Schedule;
                    TaskInfo task = myBatis.GetTask(r.ProjectName, r.SampleNum);
                    if (task == null)
                    {
                        task             = new TaskInfo();
                        task.SampleNum   = r.SampleNum;
                        task.ProjectName = r.ProjectName;
                        task.SampleType  = r.SampleType;
                        //Schedule.WorkType = S.IsEmergency == true ? WORKTYPE.E : WORKTYPE.N;
                        task.SampleDilute = "减量体积";
                        task.SendTimes    = 0;
                        task.FinishTimes  = 0;
                        task.InspectTimes = 1;
                        task.TaskState    = 0;
                        task.IsReRun      = true;
                        //Schedule.ReRun = "AbsLim";
                        if (r.ResultVolType != task.SampleDilute)//结果体积参数和计划体积参数不同才可以提交工作计划
                        {
                            //new ScheduleService().Save(Schedule);
                            myBatis.SaveTske(task);
                        }
                    }
                }
            }
        }
예제 #3
0
 /// <summary>
 /// 通过项目名称和项目类型更新项目范围参数
 /// </summary>
 /// <param name="strDBMethod"></param>
 /// <param name="assayProInfo"></param>
 /// <returns></returns>
 public int UpdateRangeParamByProNameAndType(string strDBMethod, AssayProjectRangeParamInfo assayProInfo)
 {
     return(myBatis.UpdateRangeParamByProNameAndType(strDBMethod, assayProInfo));
 }
예제 #4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            AssayProjectRangeParamInfo parameter = new AssayProjectRangeParamInfo();

            parameter.ProjectName = this.gridView1.GetRowCellValue(this.gridView1.GetSelectedRows()[0], "项目名称").ToString();
            parameter.SampleType  = this.gridView1.GetRowCellValue(this.gridView1.GetSelectedRows()[0], "类型").ToString();

            parameter.AutoRerun = chkAutoResurvey.Checked;


            if (!Regex.IsMatch(txtRepeatLimitLow.Text.Trim(), @"^(-?\d+)(\.\d+)?$") || !Regex.IsMatch(txtRepeatLimitHigh.Text.Trim(), @"^(-?\d+)(\.\d+)?$"))
            {
                MessageBox.Show("重测检查参数输入有误,请重新输入!");
                return;
            }

            if (System.Convert.ToInt32(txtRepeatLimitLow.Text) > System.Convert.ToInt32(txtRepeatLimitHigh.Text))
            {
                MessageBox.Show("重测检查参数输入有误,请重新输入!");
                return;
            }
            // 仅仅输入数字
            if (txtSerumAgeHigh1.Text.Trim() != "")
            {
                if (txtSerumAgeHigh1.Text.Trim() != "" && !Regex.IsMatch(txtSerumAgeHigh1.Text.Trim(), "^([0-9]{1,})$") ||
                    txtSerumAgeLow1.Text.Trim() != "" && !Regex.IsMatch(txtSerumAgeLow1.Text.Trim(), "^([0-9]{1,})$") ||
                    txtSerumAgeHigh2.Text.Trim() != "" && !Regex.IsMatch(txtSerumAgeHigh2.Text.Trim(), "^([0-9]{1,})$") ||
                    txtSerumAgeLow2.Text.Trim() != "" && !Regex.IsMatch(txtSerumAgeLow2.Text.Trim(), "^([0-9]{1,})$") ||
                    txtSerumAgeHigh3.Text.Trim() != "" && !Regex.IsMatch(txtSerumAgeHigh3.Text.Trim(), "^([0-9]{1,})$") ||
                    txtSerumAgeLow3.Text.Trim() != "" && !Regex.IsMatch(txtSerumAgeLow3.Text.Trim(), "^([0-9]{1,})$") ||
                    txtSerumAgeHigh4.Text.Trim() != "" && !Regex.IsMatch(txtSerumAgeHigh4.Text.Trim(), "^([0-9]{1,})$") ||
                    txtSerumAgeLow4.Text.Trim() != "" && !Regex.IsMatch(txtSerumAgeLow4.Text.Trim(), "^([0-9]{1,})$")
                    )
                {
                    MessageBox.Show("血清期望值中的年龄输入格式有误,请重新输入!");
                    return;
                }
            }
            // 血清同一区间最高值和最低值需全部填写
            if (txtSerumAgeLow1.Text.Trim() != "" && txtSerumAgeHigh1.Text.Trim() == "" ||
                txtSerumAgeLow1.Text.Trim() == "" && txtSerumAgeHigh1.Text.Trim() != "" ||
                txtSerumAgeLow2.Text.Trim() != "" && txtSerumAgeHigh2.Text.Trim() == "" ||
                txtSerumAgeLow2.Text.Trim() == "" && txtSerumAgeHigh2.Text.Trim() != "" ||
                txtSerumAgeLow3.Text.Trim() != "" && txtSerumAgeHigh3.Text.Trim() == "" ||
                txtSerumAgeLow3.Text.Trim() == "" && txtSerumAgeHigh3.Text.Trim() != "" ||
                txtSerumAgeLow4.Text.Trim() != "" && txtSerumAgeHigh4.Text.Trim() == "" ||
                txtSerumAgeLow4.Text.Trim() == "" && txtSerumAgeHigh4.Text.Trim() != "")
            {
                MessageBox.Show("血清期望值中的年龄输入格式有误,同一区间的最高值和最低值需全部填写,请重新输入!");
                return;
            }
            // 如果上一年龄为空,则下面不能填写年龄
            if (txtSerumAgeLow4.Text.Trim() != "")
            {
                if (txtSerumAgeLow1.Text.Trim() == "" || txtSerumAgeLow2.Text.Trim() == "" || txtSerumAgeLow3.Text.Trim() == "")
                {
                    MessageBox.Show("血清期望值中的年龄输入格式有误,同一区间的最高值和最低值需全部填写,请重新输入!");
                    return;
                }
            }
            if (txtSerumAgeLow3.Text.Trim() != "")
            {
                if (txtSerumAgeLow1.Text.Trim() == "" || txtSerumAgeLow2.Text.Trim() == "")
                {
                    MessageBox.Show("血清期望值中的年龄输入格式有误,同一区间的最高值和最低值需全部填写,请重新输入!");
                    return;
                }
            }
            if (txtSerumAgeLow2.Text.Trim() != "")
            {
                if (txtSerumAgeLow1.Text.Trim() == "")
                {
                    MessageBox.Show("血清期望值中的年龄输入格式有误,同一区间的最高值和最低值需全部填写,请重新输入!");
                    return;
                }
            }
            // 年龄最小值不能大于最大值
            if (txtSerumAgeLow1.Text.Trim() != "" && System.Convert.ToInt32(txtSerumAgeHigh1.Text) < System.Convert.ToInt32(txtSerumAgeLow1.Text) ||
                txtSerumAgeLow2.Text.Trim() != "" && System.Convert.ToInt32(txtSerumAgeHigh2.Text) < System.Convert.ToInt32(txtSerumAgeLow2.Text) ||
                txtSerumAgeLow3.Text.Trim() != "" && System.Convert.ToInt32(txtSerumAgeHigh3.Text) < System.Convert.ToInt32(txtSerumAgeLow3.Text) ||
                txtSerumAgeLow4.Text.Trim() != "" && System.Convert.ToInt32(txtSerumAgeHigh4.Text) < System.Convert.ToInt32(txtSerumAgeLow4.Text))
            {
                MessageBox.Show("血清期望值中的年龄最大值不能小于最小值,请重新输入!");
                return;
            }

            // 区间不能重合
            List <int> lstValues1 = new List <int>();
            List <int> lstValues2 = new List <int>();
            List <int> lstValues3 = new List <int>();
            List <int> lstValues4 = new List <int>();

            if (txtSerumAgeLow1.Text.Trim() != "")
            {
                for (int i = System.Convert.ToInt32(txtSerumAgeLow1.Text); i <= System.Convert.ToInt32(txtSerumAgeHigh1.Text); i++)
                {
                    lstValues1.Add(i);
                }
            }

            if (txtSerumAgeLow2.Text.Trim() != "")
            {
                for (int i = System.Convert.ToInt32(txtSerumAgeLow2.Text); i <= System.Convert.ToInt32(txtSerumAgeHigh2.Text); i++)
                {
                    lstValues2.Add(i);
                }
            }

            if (txtSerumAgeLow3.Text.Trim() != "")
            {
                for (int i = System.Convert.ToInt32(txtSerumAgeLow3.Text); i <= System.Convert.ToInt32(txtSerumAgeHigh3.Text); i++)
                {
                    lstValues3.Add(i);
                }
            }

            if (txtSerumAgeLow4.Text.Trim() != "")
            {
                for (int i = System.Convert.ToInt32(txtSerumAgeLow4.Text); i <= System.Convert.ToInt32(txtSerumAgeHigh4.Text); i++)
                {
                    lstValues4.Add(i);
                }
            }

            if (lstValues1.Intersect(lstValues2).Count <int>() > 0 ||
                lstValues1.Intersect(lstValues3).Count <int>() > 0 ||
                lstValues1.Intersect(lstValues4).Count <int>() > 0)
            {
                MessageBox.Show("血清期望值中的年龄区间不能重叠,请重新输入!");
                return;
            }
            else if (lstValues2.Intersect(lstValues3).Count <int>() > 0 ||
                     lstValues2.Intersect(lstValues4).Count <int>() > 0)
            {
                MessageBox.Show("血清期望值中的年龄区间不能重叠,请重新输入!");
                return;
            }
            else if (lstValues3.Intersect(lstValues4).Count <int>() > 0)
            {
                MessageBox.Show("血清期望值中的年龄区间不能重叠,请重新输入!");
                return;
            }
            else
            {
            }
            // 当输入了对应年龄,则男、女值不为空时,值不能为非数字,男、女范围如果填写,则最大最小值需全填写,如果年龄未输入,则不允许输入男、女值(第一行除外)
            if (txtSerumManConsLow2.Text.Trim() != "" && !Regex.IsMatch(txtSerumManConsLow2.Text.Trim(), @"^(-?\d+)(\.\d+)?$") ||
                txtSerumManConsHigh2.Text.Trim() != "" && !Regex.IsMatch(txtSerumManConsHigh2.Text.Trim(), @"^(-?\d+)(\.\d+)?$"))
            {
                MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                return;
            }
            else if (txtSerumManConsLow2.Text.Trim() != "" && txtSerumManConsHigh2.Text.Trim() == "" ||
                     txtSerumManConsLow2.Text.Trim() != "" && txtSerumManConsHigh2.Text.Trim() == "")
            {
                MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                return;
            }
            else if (txtSerumManConsLow2.Text.Trim() != "" && txtSerumManConsHigh2.Text.Trim() == "" && System.Convert.ToDouble(txtSerumManConsLow2.Text) > System.Convert.ToDouble(txtSerumManConsHigh2.Text))
            {
                MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                return;
            }

            if (txtSerumWomanConsLow2.Text.Trim() != "" && !Regex.IsMatch(txtSerumWomanConsLow2.Text.Trim(), @"^(-?\d+)(\.\d+)?$") ||
                txtSerumWomanConsHigh2.Text.Trim() != "" && !Regex.IsMatch(txtSerumWomanConsHigh2.Text.Trim(), @"^(-?\d+)(\.\d+)?$"))
            {
                MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                return;
            }
            else if (txtSerumWomanConsLow2.Text.Trim() != "" && txtSerumWomanConsHigh2.Text.Trim() == "" ||
                     txtSerumWomanConsLow2.Text.Trim() != "" && txtSerumWomanConsHigh2.Text.Trim() == "")
            {
                MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                return;
            }
            else if (txtSerumWomanConsLow2.Text.Trim() != "" && txtSerumWomanConsHigh2.Text.Trim() == "" && System.Convert.ToDouble(txtSerumWomanConsLow2.Text) > System.Convert.ToDouble(txtSerumWomanConsHigh2.Text))
            {
                MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                return;
            }

            if (txtSerumAgeLow2.Text.Trim() != "")
            {
                if (txtSerumManConsLow2.Text.Trim() != "" && !Regex.IsMatch(txtSerumManConsLow2.Text.Trim(), @"^(-?\d+)(\.\d+)?$") ||
                    txtSerumManConsHigh2.Text.Trim() != "" && !Regex.IsMatch(txtSerumManConsHigh2.Text.Trim(), @"^(-?\d+)(\.\d+)?$"))
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
                else if (txtSerumManConsLow2.Text.Trim() != "" && txtSerumManConsHigh2.Text.Trim() == "" ||
                         txtSerumManConsLow2.Text.Trim() != "" && txtSerumManConsHigh2.Text.Trim() == "")
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
                else if (txtSerumManConsLow2.Text.Trim() != "" && txtSerumManConsHigh2.Text.Trim() == "" && System.Convert.ToDouble(txtSerumManConsLow2.Text) > System.Convert.ToDouble(txtSerumManConsHigh2.Text))
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }

                if (txtSerumWomanConsLow2.Text.Trim() != "" && !Regex.IsMatch(txtSerumWomanConsLow2.Text.Trim(), @"^(-?\d+)(\.\d+)?$") ||
                    txtSerumWomanConsHigh2.Text.Trim() != "" && !Regex.IsMatch(txtSerumWomanConsHigh2.Text.Trim(), @"^(-?\d+)(\.\d+)?$"))
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
                else if (txtSerumWomanConsLow2.Text.Trim() != "" && txtSerumWomanConsHigh2.Text.Trim() == "" ||
                         txtSerumWomanConsLow2.Text.Trim() != "" && txtSerumWomanConsHigh2.Text.Trim() == "")
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
                else if (txtSerumWomanConsLow2.Text.Trim() != "" && txtSerumWomanConsHigh2.Text.Trim() == "" && System.Convert.ToDouble(txtSerumWomanConsLow2.Text) > System.Convert.ToDouble(txtSerumWomanConsHigh2.Text))
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
            }
            else
            {
                if (txtSerumManConsLow2.Text.Trim() != "" || txtSerumManConsHigh2.Text.Trim() != "")
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }

                if (txtSerumWomanConsLow2.Text.Trim() != "" || txtSerumWomanConsHigh2.Text.Trim() != "")
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
            }

            if (txtSerumAgeLow3.Text.Trim() != "")
            {
                if (txtSerumManConsLow3.Text.Trim() != "" && !Regex.IsMatch(txtSerumManConsLow3.Text.Trim(), @"^(-?\d+)(\.\d+)?$") ||
                    txtSerumManConsHigh3.Text.Trim() != "" && !Regex.IsMatch(txtSerumManConsHigh3.Text.Trim(), @"^(-?\d+)(\.\d+)?$"))
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
                else if (txtSerumManConsLow3.Text.Trim() != "" && txtSerumManConsHigh3.Text.Trim() == "" ||
                         txtSerumManConsLow3.Text.Trim() != "" && txtSerumManConsHigh3.Text.Trim() == "")
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
                else if (txtSerumManConsLow3.Text.Trim() != "" && txtSerumManConsHigh3.Text.Trim() == "" && System.Convert.ToDouble(txtSerumManConsLow3.Text) > System.Convert.ToDouble(txtSerumManConsHigh3.Text))
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }

                if (txtSerumWomanConsLow3.Text.Trim() != "" && !Regex.IsMatch(txtSerumWomanConsLow3.Text.Trim(), @"^(-?\d+)(\.\d+)?$") ||
                    txtSerumWomanConsHigh3.Text.Trim() != "" && !Regex.IsMatch(txtSerumWomanConsHigh3.Text.Trim(), @"^(-?\d+)(\.\d+)?$"))
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
                else if (txtSerumWomanConsLow3.Text.Trim() != "" && txtSerumWomanConsHigh3.Text.Trim() == "" ||
                         txtSerumWomanConsLow3.Text.Trim() != "" && txtSerumWomanConsHigh3.Text.Trim() == "")
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
                else if (txtSerumWomanConsLow3.Text.Trim() != "" && txtSerumWomanConsHigh3.Text.Trim() == "" && System.Convert.ToDouble(txtSerumWomanConsLow3.Text) > System.Convert.ToDouble(txtSerumWomanConsHigh3.Text))
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
            }
            else
            {
                if (txtSerumManConsLow3.Text.Trim() != "" || txtSerumManConsHigh3.Text.Trim() != "")
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }

                if (txtSerumWomanConsLow3.Text.Trim() != "" || txtSerumWomanConsHigh3.Text.Trim() != "")
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
            }

            if (txtSerumAgeLow4.Text.Trim() != "")
            {
                if (txtSerumManConsLow4.Text.Trim() != "" && !Regex.IsMatch(txtSerumManConsLow4.Text.Trim(), @"^(-?\d+)(\.\d+)?$") ||
                    txtSerumManConsHigh4.Text.Trim() != "" && !Regex.IsMatch(txtSerumManConsHigh4.Text.Trim(), @"^(-?\d+)(\.\d+)?$"))
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
                else if (txtSerumManConsLow4.Text.Trim() != "" && txtSerumManConsHigh4.Text.Trim() == "" ||
                         txtSerumManConsLow4.Text.Trim() != "" && txtSerumManConsHigh4.Text.Trim() == "")
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
                else if (txtSerumManConsLow4.Text.Trim() != "" && txtSerumManConsHigh4.Text.Trim() == "" && System.Convert.ToDouble(txtSerumManConsLow4.Text) > System.Convert.ToDouble(txtSerumManConsHigh4.Text))
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }

                if (txtSerumWomanConsLow4.Text.Trim() != "" && !Regex.IsMatch(txtSerumWomanConsLow4.Text.Trim(), @"^(-?\d+)(\.\d+)?$") ||
                    txtSerumWomanConsHigh4.Text.Trim() != "" && !Regex.IsMatch(txtSerumWomanConsHigh4.Text.Trim(), @"^(-?\d+)(\.\d+)?$"))
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
                else if (txtSerumWomanConsLow4.Text.Trim() != "" && txtSerumWomanConsHigh4.Text.Trim() == "" ||
                         txtSerumWomanConsLow4.Text.Trim() != "" && txtSerumWomanConsHigh4.Text.Trim() == "")
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
                else if (txtSerumWomanConsLow4.Text.Trim() != "" && txtSerumWomanConsHigh4.Text.Trim() == "" && System.Convert.ToDouble(txtSerumWomanConsLow4.Text) > System.Convert.ToDouble(txtSerumWomanConsHigh4.Text))
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
            }
            else
            {
                if (txtSerumManConsLow4.Text.Trim() != "" || txtSerumManConsHigh4.Text.Trim() != "")
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }

                if (txtSerumWomanConsLow4.Text.Trim() != "" || txtSerumWomanConsHigh4.Text.Trim() != "")
                {
                    MessageBox.Show("血清期望值中的范围值输入有误,请重新输入!");
                    return;
                }
            }

            parameter.RepeatLimitLow  = txtRepeatLimitLow.Text.Trim() != "" ? System.Convert.ToInt32(txtRepeatLimitLow.Text) : 0;
            parameter.RepeatLimitHigh = txtRepeatLimitHigh.Text.Trim() != "" ? System.Convert.ToInt32(txtRepeatLimitHigh.Text) : 0;

            parameter.AgeLow1        = txtSerumAgeLow1.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumAgeLow1.Text.Trim()) : -100000000;
            parameter.AgeLow2        = txtSerumAgeLow2.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumAgeLow2.Text.Trim()) : -100000000;
            parameter.AgeLow3        = txtSerumAgeLow3.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumAgeLow3.Text.Trim()) : -100000000;
            parameter.AgeLow4        = txtSerumAgeLow4.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumAgeLow4.Text.Trim()) : -100000000;
            parameter.AgeHigh1       = txtSerumAgeHigh1.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumAgeHigh1.Text.Trim()) : 100000000;
            parameter.AgeHigh2       = txtSerumAgeHigh2.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumAgeHigh2.Text.Trim()) : 100000000;
            parameter.AgeHigh3       = txtSerumAgeHigh3.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumAgeHigh3.Text.Trim()) : 100000000;
            parameter.AgeHigh4       = txtSerumAgeHigh4.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumAgeHigh4.Text.Trim()) : 100000000;
            parameter.ManConsLow1    = txtSerumManConsLow1.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumManConsLow1.Text.Trim()) : -100000000;
            parameter.ManConsLow2    = txtSerumManConsLow2.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumManConsLow2.Text.Trim()) : -100000000;
            parameter.ManConsLow3    = txtSerumManConsLow3.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumManConsLow3.Text.Trim()) : -100000000;
            parameter.ManConsLow4    = txtSerumManConsLow4.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumManConsLow4.Text.Trim()) : -100000000;
            parameter.ManConsHigh1   = txtSerumManConsHigh1.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumManConsHigh1.Text.Trim()) : 100000000;
            parameter.ManConsHigh2   = txtSerumManConsHigh2.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumManConsHigh2.Text.Trim()) : 100000000;
            parameter.ManConsHigh3   = txtSerumManConsHigh3.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumManConsHigh3.Text.Trim()) : 100000000;
            parameter.ManConsHigh4   = txtSerumManConsHigh4.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumManConsHigh4.Text.Trim()) : 100000000;
            parameter.WomanConsLow1  = txtSerumWomanConsLow1.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumWomanConsLow1.Text.Trim()) : -100000000;
            parameter.WomanConsLow2  = txtSerumWomanConsLow2.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumWomanConsLow2.Text.Trim()) : -100000000;
            parameter.WomanConsLow3  = txtSerumWomanConsLow3.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumWomanConsLow3.Text.Trim()) : -100000000;
            parameter.WomanConsLow4  = txtSerumWomanConsLow4.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumWomanConsLow4.Text.Trim()) : -100000000;
            parameter.WomanConsHigh1 = txtSerumWomanConsHigh1.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumWomanConsHigh1.Text.Trim()) : 100000000;
            parameter.WomanConsHigh2 = txtSerumWomanConsHigh2.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumWomanConsHigh2.Text.Trim()) : 100000000;
            parameter.WomanConsHigh3 = txtSerumWomanConsHigh3.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumWomanConsHigh3.Text.Trim()) : 100000000;
            parameter.WomanConsHigh4 = txtSerumWomanConsHigh4.Text.Trim() != "" ? System.Convert.ToInt32(txtSerumWomanConsHigh4.Text.Trim()) : 100000000;

            if (AssayProInfoForRangeParamEvent != null)
            {
                //AssayProInfoForRangeParamEvent(new CommunicationEntity("UpdateRangeParamByProNameAndType", XmlUtility.Serializer(typeof(AssayProjectRangeParamInfo), parameter)));
                rangeParamDic.Clear();
                rangeParamDic.Add("UpdateRangeParamByProNameAndType", new object[] { XmlUtility.Serializer(typeof(AssayProjectRangeParamInfo), parameter) });
                AssayProInfoForRangeParamEvent(rangeParamDic);
            }
        }