Пример #1
0
        /// <summary>
        /// 删除试剂2表中对应的数据,修改或者删除试剂R1R2表中对应的数据
        /// </summary>
        /// <param name="strDBMethod"></param>
        /// <param name="DeletereagentSettingsInfo"></param>
        /// <returns></returns>
        public int DeletereagentSettingsInfo2(string strDBMethod, ReagentSettingsInfo DeletereagentSettingsInfo)
        {
            if (DeletereagentSettingsInfo.ReagentType == "清洗剂")
            {
                return(myBatis.DeletereagentSettingsInfoAndStateInfo("R2", DeletereagentSettingsInfo));
            }
            ReagentStateInfoR1R2 reagentR1AndR2 = myBatis.SelectReagentStateForR1R2("SelectReagentStateForR1R2", DeletereagentSettingsInfo);

            // 判断试剂1设置是否存在同一项目的试剂,如果存在,更新试剂状态表,如果不存在,删除试剂表对应数据
            if ((reagentR1AndR2.ReagentName == null && reagentR1AndR2.ReagentType == null) ||
                (reagentR1AndR2.ReagentName == "" && reagentR1AndR2.ReagentType == ""))
            {
                //myBatis.DeletereagentStateInfoR2("DeletereagentStateInfoR2", DeletereagentSettingsInfo);
                //根据删除试剂R1R2表中试剂2对应的数据
                myBatis.DeletereagentStateInfoR1R2("DeletereagentStateInfoR1R2", DeletereagentSettingsInfo);
            }
            else
            {
                //myBatis.UpdateReagentStateForDeleteR2("UpdateReagentStateForDeleteR2", DeletereagentSettingsInfo);
                //根据项目名称修改试剂R1R2表中试剂2对应的数据
                myBatis.UpdateReagentStateForR1R2("UpdateReagentStateForR1R2", DeletereagentSettingsInfo);
            }
            //根据项目名称删除试剂2表对应数据
            return(myBatis.DeletereagentSettingsInfo2(strDBMethod, DeletereagentSettingsInfo));
        }
Пример #2
0
 /// <summary>
 /// 处理试剂状态R1R2表信息
 /// </summary>
 /// <param name="r"></param>
 /// <param name="reagent"></param>
 private void ReagentStateInfoHandle(ReagentStateInfoR1R2 r, ReagentSettingsInfo reagent)
 {
     if (Disk == 1)
     {
         if (string.IsNullOrEmpty(r.ReagentName2) && string.IsNullOrEmpty(r.Pos2))
         {
             mybatis.DeletereagentStateInfoR1R2("DeletereagentStateInfoR1R2", reagent);
         }
         else
         {
             mybatis.UpdateReagentStateForR1R2CorrespondenceR1("UpdateReagentStateForR1R2CorrespondenceR1", reagent);
         }
     }
     else if (Disk == 2)
     {
         if (string.IsNullOrEmpty(r.ReagentName) && string.IsNullOrEmpty(r.Pos))
         {
             mybatis.DeletereagentStateInfoR1R2("DeletereagentStateInfoR1R2", reagent);
         }
         else
         {
             mybatis.UpdateReagentStateForR1R2("UpdateReagentStateForR1R2", reagent);
         }
     }
 }
Пример #3
0
        /// <summary>
        /// 添加试剂参数信息
        /// </summary>
        /// <param name="disk"></param>
        /// <param name="r"></param>
        /// <returns></returns>
        public string AddreagentSettingInfo(int disk, ReagentSettingsInfo r)
        {
            //保存试剂设置参数信息 ReagentSettingsTb  ReagentSettingsTbR2
            string SQL = "";
            //保存/修改试剂状态参数信息 reagentstateinfor1r2Tb
            string SQL2 = "";

            if (disk == 1)
            {
                SQL = string.Format(@"insert into ReagentSettingsTb(Pos,ProjectName,ReagentName,ValidDate,Barcode,ReagentContainer,BatchNum,ReagentType)
                                values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')", r.Pos, r.ProjectName, r.ReagentName, r.ValidDate, r.Barcode, r.ReagentContainer, r.BatchNum, r.ReagentType);
            }
            else if (disk == 2)
            {
                SQL = string.Format(@"insert into ReagentSettingsTbR2(Pos,ProjectName,ReagentName,ValidDate,Barcode,ReagentContainer,BatchNum,ReagentType)
                                values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')", r.Pos, r.ProjectName, r.ReagentName, r.ValidDate, r.Barcode, r.ReagentContainer, r.BatchNum, r.ReagentType);
            }
            try
            {
                ReagentStateInfoR1R2 reagentState = this.QueryReagentStateInfoByProjectName("QueryReagentStateInfoByProjectName", r);
                ism_SqlMap.BeginTransaction();
                //保存试剂设置参数信息
                ism_SqlMap.Insert("ReagentInfo.SaveReagentR1AndR2Info", SQL);
                if (reagentState == null)
                {
                    if (disk == 1)
                    {
                        SQL2 = string.Format(@"insert into reagentstateinfor1r2Tb(ProjectName,Locked,ReagentName,ResidualQuantity,Pos,ReagentType,ValidPercent)
                                        values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')", r.ProjectName, r.Locked, r.ReagentName, r.ResidualQuantity, r.Pos, r.ReagentType, r.ValidPercent);
                    }
                    else if (disk == 2)
                    {
                        SQL2 = string.Format(@"insert into reagentstateinfor1r2Tb(ProjectName,Locked,ReagentName2,ResidualQuantity2,Pos2,ReagentType2,ValidPercent2)
                                        values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')", r.ProjectName, r.Locked, r.ReagentName, r.ResidualQuantity, r.Pos, r.ReagentType, r.ValidPercent);
                    }
                    ism_SqlMap.Insert("ReagentInfo.SaveReagentR1AndR2Info", SQL2);
                }
                else
                {
                    if (disk == 1)
                    {
                        SQL2 = string.Format("update reagentstateinfor1r2tb set ReagentName = '{0}',Pos = '{1}', ReagentType = '{2}', ValidPercent = '{3}', ResidualQuantity = '{4}' where ProjectName = '{5}'", r.ReagentName, r.Pos, r.ReagentType, r.ValidPercent, r.ResidualQuantity, r.ProjectName);
                    }
                    else if (disk == 2)
                    {
                        SQL2 = string.Format("update reagentstateinfor1r2tb set ReagentName2 = '{0}',Pos2 = '{1}', ReagentType2 = '{2}', ValidPercent2 = '{3}', ResidualQuantity2 = '{4}' where ProjectName = '{5}'", r.ReagentName, r.Pos, r.ReagentType, r.ValidPercent, r.ResidualQuantity, r.ProjectName);
                    }
                    ism_SqlMap.Update("ReagentInfo.UpdateReagentR1AndR2Info", SQL2);
                }
            }
            catch (Exception e)
            {
                LogInfo.WriteErrorLog("AddDataConfig(string strDBMethod, CalcProjectInfo calcProjectInfo)==" + e.ToString(), Module.Reagent);
                ism_SqlMap.RollBackTransaction();
                return("试剂装载失败!");
            }
            ism_SqlMap.CommitTransaction();
            return("试剂装载成功!");
        }
Пример #4
0
        /// <summary>
        /// 条码扫码失败
        /// </summary>
        /// <param name="disk"></param>
        /// <param name="pos"></param>
        public void BarcodeScanningFailed(int disk, string pos)
        {
            mybatis.DeleteReagentInfo(disk, pos);
            ReagentStateInfoR1R2 r = mybatis.GetReagentStateInfoR1R2(disk, pos);

            this.ReagentStateInfoHandle(r, new ReagentSettingsInfo()
            {
                ProjectName = r.ProjectName
            });
        }
Пример #5
0
 public void UpdateReagent1State(string strMethodName, ReagentStateInfoR1R2 reagentState)
 {
     try
     {
         ism_SqlMap.Update("ReagentInfo." + strMethodName, reagentState);
     }
     catch (Exception e)
     {
         LogInfo.WriteErrorLog("UpdateReagent1State(string strMethodName, ReagentStateInfoR1R2 reagentState)==" + e.ToString(), Module.Reagent);
     }
 }
Пример #6
0
        /// <summary>
        /// 删除试剂状态R1R2信息
        /// </summary>
        public ReagentStateInfoR1R2 GetReagentStateInfoR1R2(int disk, string pos)
        {
            ReagentStateInfoR1R2 r = null;

            try
            {
                r = (ReagentStateInfoR1R2)ism_SqlMap.QueryForObject("ReagentInfo.GetReagentStateInfoR1R2", string.Format("select * from reagentstateinfor1r2tb where Pos ='{0}' or Pos2 = '{1}'", pos, pos));
            }
            catch (Exception ex)
            {
                LogInfo.WriteErrorLog("DeleteReagentSettingAndStateInfo(int disk, string pos) ==" + ex.Message, Module.Reagent);
            }
            return(r);
        }
Пример #7
0
        public ReagentStateInfoR1R2 QueryReagentStateInfoByProjectName(string strMethodName, ReagentSettingsInfo reagentSettingsInfo)
        {
            ReagentStateInfoR1R2 reagentState = new ReagentStateInfoR1R2();

            try
            {
                reagentState = (ReagentStateInfoR1R2)ism_SqlMap.QueryForObject("ReagentInfo." + strMethodName, reagentSettingsInfo);
            }
            catch (Exception e)
            {
                LogInfo.WriteErrorLog("QueryReagentStateInfoByProjectName(string strMethodName, ReagentSettingsInfo reagentSettingsInfo)==" + e.ToString(), Module.Reagent);
            }
            return(reagentState);
        }
Пример #8
0
        public string AddreagentStateInfoR1R2(string strDBMethod, ReagentStateInfoR1R2 reagentStateInfoR1R2)
        {
            string strResult = "添加成功!";

            try
            {
                ism_SqlMap.Insert("ReagentInfo." + strDBMethod, reagentStateInfoR1R2);
            }
            catch (Exception e)
            {
                LogInfo.WriteErrorLog("AddDataConfig(string strDBMethod, CalcProjectInfo calcProjectInfo)==" + e.ToString(), Module.Reagent);
                strResult = "添加失败!";
            }

            return(strResult);
        }
Пример #9
0
        /// <summary>
        /// 根据项目名称获取试剂R1R2表数据
        /// </summary>
        /// <param name="strAccessDBMethod"></param>
        /// <param name="DeletereagentSettingsInfo"></param>
        /// <returns></returns>
        public ReagentStateInfoR1R2 SelectReagentStateForR1R2(string strAccessDBMethod, ReagentSettingsInfo DeletereagentSettingsInfo)
        {
            ReagentStateInfoR1R2 reagentR1AndR2 = null;

            try
            {
                Hashtable hashTable = new Hashtable();
                hashTable.Add("ProjectName", DeletereagentSettingsInfo.ProjectName);
                reagentR1AndR2 = ism_SqlMap.QueryForObject("ReagentInfo." + strAccessDBMethod, hashTable) as ReagentStateInfoR1R2;
            }
            catch (Exception e)
            {
                LogInfo.WriteErrorLog("SelectReagentStateForR1R2(string strAccessDBMethod, ReagentSettingsInfo DeletereagentSettingsInfo) ==" + e.Message, Module.Reagent);
            }
            return(reagentR1AndR2);
        }
Пример #10
0
        /// <summary>
        /// 保存或更新试剂状态信息 ReagentStateInfoR1R2tb
        /// </summary>
        /// <param name="r">试剂(R1 or R2)参数信息</param>
        private void SaveOrUpReagentStateR1R2Info(ReagentSettingsInfo r)
        {
            int MeasurableNumber      = 0;
            ReagentStateInfoR1R2 r1r2 = mybatis.SelectReagentStateForR1R2("SelectReagentStateForR1R2", r);
            int validPercent          = (int)(this.Disk == 1 ? r.ValidPercent : r.ValidPercent2);

            if (validPercent > 3)
            {
                int microlitre = int.Parse(r.ReagentContainer.Substring(0, r.ReagentContainer.IndexOf("ml"))) * (validPercent - 3) * 1000 / 100;
                MeasurableNumber = r.ReagentVol == 0 ? 0 : microlitre / r.ReagentVol;
            }
            if (r1r2 != null)
            {
                mybatis.UpdateReagentR1AndR2Info(this.Disk, r, MeasurableNumber);
            }
            else
            {
                mybatis.SaveReagentR1AndR2Info(this.Disk, r, MeasurableNumber);
            }
        }
Пример #11
0
        /// <summary>
        /// 获取试剂状态表中数据
        /// </summary>
        /// <param name="panel"></param>
        /// <param name="pos"></param>
        /// <returns></returns>
        public ReagentStateInfoR1R2 GetReagentStateInfoByPos(int panel, int pos)
        {
            ReagentStateInfoR1R2 reaStateInfo = new ReagentStateInfoR1R2();

            try
            {
                if (panel == 1)
                {
                    reaStateInfo = ism_SqlMap.QueryForObject("ReagentInfo.GetReagent1StateInfoByPos", pos.ToString()) as ReagentStateInfoR1R2;
                }
                else if (panel == 2)
                {
                    reaStateInfo = ism_SqlMap.QueryForObject("ReagentInfo.GetReagent2StateInfoByPos", pos.ToString()) as ReagentStateInfoR1R2;
                }
            }
            catch (Exception e)
            {
                LogInfo.WriteErrorLog("GetReagentStateInfoByPos(int panel, int pos)==" + e.ToString(), Module.Reagent);
            }

            return(reaStateInfo);
        }
Пример #12
0
        /// <summary>
        /// 获取试剂状态表中的试剂体积
        /// </summary>
        /// <param name="disk"></param>
        /// <param name="pos"></param>
        /// <returns></returns>
        public int GetValidPercent(int disk, int pos)
        {
            int percent = 0;

            try
            {
                Hashtable ht = new Hashtable();
                if (disk == 1)
                {
                    ht.Add("Pos", pos);
                }
                else if (disk == 2)
                {
                    ht.Add("Pos2", pos);
                }

                if (ht.Count > 0)
                {
                    ReagentStateInfoR1R2 reaState = ism_SqlMap.QueryForObject("ReagentInfo.GetValidPercent", ht) as ReagentStateInfoR1R2;
                    if (reaState != null)
                    {
                        if (disk == 1)
                        {
                            percent = reaState.ValidPercent;
                        }
                        if (disk == 2)
                        {
                            percent = reaState.ValidPercent2;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                LogInfo.WriteErrorLog("GetValidPercent(int disk, int pos)==" + e.ToString(), Module.Reagent);
            }

            return(percent);
        }
Пример #13
0
        /// <summary>
        /// 移除被占用的是试剂信息
        /// </summary>
        private void RemoveOccupiedReagentInfo(ReagentSettingsInfo barrgtpos)
        {
            ReagentBarcodeParam r = new ReagentBarcodeParam();

            r.Barcode = barrgtpos.Barcode;
            switch (Disk)
            {
            case 1:
                r.ValidPercent = Convert.ToInt32(barrgtpos.ValidPercent);
                break;

            case 2:
                r.ValidPercent = Convert.ToInt32(barrgtpos.ValidPercent2);
                break;
            }
            r.ExchangeDatetime = DateTime.Now;
            mybatis.InsertReagentBarcode(r);
            ReagentStateInfoR1R2 r1r2 = mybatis.SelectReagentStateForR1R2("SelectReagentStateForR1R2", barrgtpos);

            this.ReagentStateInfoHandle(r1r2, barrgtpos);
            mybatis.DeleteReagentInfo(Disk, barrgtpos.Pos);
        }
Пример #14
0
        /// <summary>
        /// 解锁状态
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void deblocking_Click(object sender, EventArgs e)
        {
            if (this.gridView1.GetSelectedRows().Count() == 0)
            {
                MessageBoxDraw.ShowMsg("请选择一条记录!", MsgType.OK);
                return;
            }
            List <ReagentStateInfoR1R2> ReagentStateInfo = new List <ReagentStateInfoR1R2>();

            int[] aaa = this.gridView1.GetSelectedRows();
            for (int i = 0; i < aaa.Length; i++)
            {
                ReagentStateInfoR1R2 reagentStateInfoR1R2 = new ReagentStateInfoR1R2();
                reagentStateInfoR1R2.ProjectName  = this.gridView1.GetRowCellValue(aaa[i], "项目名称").ToString();
                reagentStateInfoR1R2.ReagentName  = this.gridView1.GetRowCellValue(aaa[i], "试剂1名称").ToString();
                reagentStateInfoR1R2.ReagentType  = this.gridView1.GetRowCellValue(aaa[i], "试剂1类型").ToString();
                reagentStateInfoR1R2.ReagentName2 = this.gridView1.GetRowCellValue(aaa[i], "试剂2名称").ToString();
                reagentStateInfoR1R2.ReagentType2 = this.gridView1.GetRowCellValue(aaa[i], "试剂2类型").ToString();
                reagentStateInfoR1R2.Locked       = true;
                ReagentStateInfo.Add(reagentStateInfoR1R2);
            }

            lstReagentStateInfo.Clear();
            lstReagentStateInfo = new BioA.Service.ReagentState().UpdataUnlockReagentState("UnlockReagentState", ReagentStateInfo);
            if (lstReagentStateInfo.Count == 0)
            {
                MessageBox.Show("设置试剂状态失败!");
            }
            else
            {
                foreach (int r in aaa)
                {
                    dt.Rows[r][13] = "未锁定";
                }
                gridReagentState.RefreshDataSource();
            }
        }
Пример #15
0
        void RgtWarning(int d, int p)
        {
            float rgtwarncount  = myBatis.GetRgtWarnCount();
            float rgtleastcount = myBatis.GetRgtLeastCount();

            ReagentStateInfoR1R2 rgp = myBatis.GetReagentStateInfoByPos(d, p);
            ReagentSettingsInfo  rsi = myBatis.GetReagentSettingsInfoByPos(d, p);

            if (rgp != null)
            {
                AssayProjectParamInfo arp = myBatis.GetAssayProjectParamInfoByNameAndType("GetAssayProjectParamInfoByNameAndType", new AssayProjectInfo()
                {
                    ProjectName = rsi.ProjectName, SampleType = rsi.ReagentType
                });
                int c = 0;
                int v = System.Convert.ToInt32(rsi.ReagentContainer.Substring(0, rsi.ReagentContainer.IndexOf("ml"))) * (rgp.ValidPercent - 2) / 100 * 1000;

                switch (d)
                {
                case 1:
                    c = arp.Reagent1VolSettings == 0 ? 0 : v / arp.Reagent1VolSettings;
                    if (c < rgtleastcount)
                    {
                        //if (RunSer.IsMutiRgtEnable() == true)//多试剂位开关标志
                        //{
                        //    RGTPosition mrgt = RGTPOSMgr.GetEnableMutiRgtPosition(rgp);
                        //    if (mrgt != null)
                        //    {
                        //        RGTPOSMgr.BetweenMutiRgtPositionAndRgtPositionChange(mrgt, rgp);

                        //        TroubleLog trouble = new TroubleLog();
                        //        trouble.TroubleCode = @"0000773";
                        //        trouble.TroubleType = TROUBLETYPE.WARN;
                        //        trouble.TroubleUnit = "试剂";
                        //        trouble.TroubleInfo = "试剂位" + p + "项目" + rgp.Assay + "试剂1由于余量不足开始启用其多试剂位" + mrgt.Position;//string.Format("试剂位{0}项目{1}试剂1由于余量不足开始启用其多试剂位{2}. ", p, rgp.Assay, mrgt.Position);
                        //        TroubleLogSer.Save(trouble);
                        //    }
                        //    else
                        //    {
                        //        if (RunSer.IsLockRgtEnable() == true)
                        //        {
                        //            rgp.IsLocked = true;
                        //            RGTPOSMgr.UpdateLockState(rgp);

                        //            TroubleLog trouble = new TroubleLog();
                        //            trouble.TroubleCode = @"0000773";
                        //            trouble.TroubleType = TROUBLETYPE.WARN;
                        //            trouble.TroubleUnit = "试剂";
                        //            trouble.TroubleInfo = MyResources.Instance.FindResource("Parse0839").ToString() + p + MyResources.Instance.FindResource("Parse0832").ToString() + rgp.Assay + MyResources.Instance.FindResource("Parse08312").ToString();//string.Format("试剂位{0}项目{1}试剂1由于余量不足将锁定其对应的工作表. ", p, rgp.Assay);
                        //            TroubleLogSer.Save(trouble);
                        //        }
                        //        else
                        //        {
                        //            TroubleLog trouble = new TroubleLog();
                        //            trouble.TroubleCode = @"0000773";
                        //            trouble.TroubleType = TROUBLETYPE.ERR;
                        //            trouble.TroubleUnit = "试剂";
                        //            trouble.TroubleInfo = MyResources.Instance.FindResource("Parse0839").ToString() + p + MyResources.Instance.FindResource("Parse0832").ToString() + rgp.Assay + MyResources.Instance.FindResource("Parse08313").ToString();// string.Format("试剂位{0}项目{1}试剂1由于余量不足. ", p, rgp.Assay);
                        //            TroubleLogSer.Save(trouble);
                        //        }
                        //    }
                        //}
                        //else
                        //{
                        //if (RunSer.IsLockRgtEnable() == true)
                        //{
                        rsi.Locked = true;
                        myBatis.UpdateLockState("R1", rsi);

                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000773";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = "试剂";
                        trouble.TroubleInfo = "试剂位" + p + "项目" + rgp.ProjectName + "余量不足将锁定其对应的工作表";    //string.Format("试剂位{0}项目{1}试剂1由于余量不足将锁定其对应的工作表. ", p, rgp.Assay);
                        myBatis.TroubleLogSave("TroubleLogSave", trouble);
                        //}
                        //else
                        //{
                        //    TroubleLog trouble = new TroubleLog();
                        //    trouble.TroubleCode = @"0000773";
                        //    trouble.TroubleType = TROUBLETYPE.ERR;
                        //    trouble.TroubleUnit = "试剂";
                        //    trouble.TroubleInfo = MyResources.Instance.FindResource("Parse0839").ToString() + p + MyResources.Instance.FindResource("Parse0832").ToString() + rgp.Assay + MyResources.Instance.FindResource("Parse08315").ToString();// string.Format("试剂位{0}项目{1}试剂1由于余量不足. ", p, rgp.Assay);
                        //    TroubleLogSer.Save(trouble);
                        //}
                        //}
                    }

                    if (c < rgtwarncount && c > rgtleastcount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000773";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = "试剂";
                        trouble.TroubleInfo = "试剂位" + p + "项目" + rgp.ProjectName + "试剂1即将耗尽";    // string.Format("试剂位{0}项目{1}:试剂1余量即将耗尽. ", p, rgp.Assay);
                        myBatis.TroubleLogSave("TroubleLogSave", trouble);
                        return;
                    }
                    break;

                case 2:
                    c = arp.Reagent2VolSettings == 0 ? 0 : v / arp.Reagent2VolSettings;
                    if (c < rgtleastcount)
                    {
                        //if (RunSer.IsMutiRgtEnable() == true)//多试剂位开关标志
                        //{
                        //    RGTPosition mrgt = RGTPOSMgr.GetEnableMutiRgtPosition(rgp);
                        //    if (mrgt != null)
                        //    {
                        //        RGTPOSMgr.BetweenMutiRgtPositionAndRgtPositionChange(mrgt, rgp);

                        //        TroubleLog trouble = new TroubleLog();
                        //        trouble.TroubleCode = @"0000773";
                        //        trouble.TroubleType = TROUBLETYPE.WARN;
                        //        trouble.TroubleUnit = "试剂";
                        //        trouble.TroubleInfo = MyResources.Instance.FindResource("Parse0839").ToString() + p + MyResources.Instance.FindResource("Parse0832").ToString() + rgp.Assay + MyResources.Instance.FindResource("Parse08317").ToString() + mrgt.Position;// string.Format("试剂位{0}项目{1}试剂2由于余量不足开始启用其多试剂位{2}. ", p, rgp.Assay, mrgt.Position);
                        //        TroubleLogSer.Save(trouble);
                        //    }
                        //    else
                        //    {
                        //        if (RunSer.IsLockRgtEnable() == true)
                        //        {
                        //            rgp.IsLocked = true;
                        //            RGTPOSMgr.UpdateLockState(rgp);

                        //            TroubleLog trouble = new TroubleLog();
                        //            trouble.TroubleCode = @"0000773";
                        //            trouble.TroubleType = TROUBLETYPE.WARN;
                        //            trouble.TroubleUnit = "试剂";
                        //            trouble.TroubleInfo = MyResources.Instance.FindResource("Parse0839").ToString() + p + MyResources.Instance.FindResource("Parse0832").ToString() + rgp.Assay + MyResources.Instance.FindResource("Parse08318").ToString();// string.Format("试剂位{0}项目{1}试剂2由于余量不足将锁定其对应的工作表. ", p, rgp.Assay);
                        //            TroubleLogSer.Save(trouble);
                        //        }
                        //        else
                        //        {
                        //            TroubleLog trouble = new TroubleLog();
                        //            trouble.TroubleCode = @"0000773";
                        //            trouble.TroubleType = TROUBLETYPE.ERR;
                        //            trouble.TroubleUnit = "试剂";
                        //            trouble.TroubleInfo = MyResources.Instance.FindResource("Parse0839").ToString() + p + MyResources.Instance.FindResource("Parse0832").ToString() + rgp.Assay + MyResources.Instance.FindResource("Parse08319").ToString();// string.Format("试剂位{0}项目{1}试剂2余量不足. ", p, rgp.Assay);
                        //            TroubleLogSer.Save(trouble);
                        //        }
                        //    }
                        //}
                        //else
                        //{
                        //if (RunSer.IsLockRgtEnable() == true)
                        //{
                        rsi.Locked = true;
                        myBatis.UpdateLockState("R2", rsi);

                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000773";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = "试剂";
                        trouble.TroubleInfo = "试剂位" + p + "项目" + rgp.ProjectName + "试剂2余量不足将锁定其对应的工作表";    //string.Format("试剂位{0}项目{1}试剂2余量不足将锁定其对应的工作表. ", p, rgp.Assay);
                        myBatis.TroubleLogSave("TroubleLogSave", trouble);
                        //}
                        //else
                        //{
                        //    TroubleLog trouble = new TroubleLog();
                        //    trouble.TroubleCode = @"0000773";
                        //    trouble.TroubleType = TROUBLETYPE.ERR;
                        //    trouble.TroubleUnit = "试剂";
                        //    trouble.TroubleInfo = MyResources.Instance.FindResource("Parse0839").ToString() + p + MyResources.Instance.FindResource("Parse0832").ToString() + rgp.Assay + MyResources.Instance.FindResource("Parse08321").ToString();// string.Format("试剂位{0}项目{1}试剂2余量不足. ", p, rgp.Assay);
                        //    TroubleLogSer.Save(trouble);
                        //}
                        //}
                    }
                    if (c < rgtwarncount && c > rgtleastcount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000775";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = "试剂";
                        trouble.TroubleInfo = "试剂位" + p + "项目" + rgp.ProjectName + "试剂2余量即将耗尽";    // string.Format("试剂位{0}项目{1}:试剂2余量即将耗尽. ", p, rgp.Assay);
                        myBatis.TroubleLogSave("TroubleLogSave", trouble);
                        return;
                    }
                    break;
                }
            }
        }
Пример #16
0
        /// <summary>
        /// 获取所有项目
        ///     对所有项目进行校验,如果校验通过字体就显示为黑色,不通过就显示为橙色(提示警告信息),或者该项目没有对应的校准品,就显示灰色(不可用)
        /// </summary>
        /// <param name="strDBMethod"></param>
        /// <param name="sampleType"></param>
        /// <returns></returns>
        public List <string[]> QueryProjectNameInfoByCalib(string strDBMethod, string sampleType)
        {
            List <string>   lstProjectByCalib = myBatis.QueryProjectNameInfoByCalib(strDBMethod, sampleType);
            List <string[]> lstProjectName    = new List <string[]>();

            foreach (string project in lstProjectByCalib)
            {
                string[] projectInfo = new string[6];
                projectInfo[0] = project;
                //1.项目参数信息
                AssayProjectParamInfo assayProParam = myBatis.GetAssayProjectParamInfoByNameAndType("GetAssayProjectParamInfoByNameAndType", new AssayProjectInfo()
                {
                    ProjectName = project, SampleType = sampleType
                });
                //2.校准品信息
                List <CalibratorProjectinfo> calib = myBatis.QueryCalibProjectInfo("QueryCalibProjectInfo", new CalibratorProjectinfo()
                {
                    ProjectName = project, SampleType = sampleType
                });
                //3.试剂信息
                ReagentStateInfoR1R2 reagentState = myBatis.QueryReagentStateInfoByProjectName("QueryReagentStateInfoByProjectName", new ReagentSettingsInfo()
                {
                    ProjectName = project, ReagentType = sampleType
                });
                // 4.判断校准曲线是否可用
                string calibMethod = myBatis.CalibParamInfoByProNameAndType("CalibParamInfoByProNameAndType", new string[] { project, sampleType });
                //5.判断该项目下的任务是否已完成
                int calibTaskCout = myBatis.QueryCalibTaskByProjectAndSamType("QueryCalibTaskByProjectAndSamType", new CalibratorinfoTask()
                {
                    ProjectName = project, SampleType = sampleType
                });
                //5. 判断该项校准方法中是否有校准品为空
                string strResult = myBatis.CalibProParamInfo_CalibNameIsEmpty(project, sampleType);
                if (calib.Count == 0)
                {
                    projectInfo[2] = "此项目没有对应的校准品!";
                    lstProjectName.Add(projectInfo);
                }
                else
                {
                    if (assayProParam != null)
                    {
                        if (assayProParam.AnalysisMethod == "" || assayProParam.AnalysisMethod == null)
                        {
                            projectInfo[2] = "此项目参数录入有误!";
                        }

                        if (reagentState == null)
                        {
                            projectInfo[3] = "此项目没有对应试剂!";
                        }
                        else if (reagentState.Locked == true)
                        {
                            projectInfo[3] = "此项目对应试剂被锁定,无法使用!";
                        }
                        else if (reagentState.ReagentName != null && reagentState.ReagentName != "" && reagentState.ValidPercent < 3)
                        {
                            projectInfo[3] = "此项目对应的试剂1余量不足!";
                        }
                        else if (reagentState.ReagentName2 != null && reagentState.ReagentName2 != "" && reagentState.ValidPercent2 < 3)
                        {
                            projectInfo[3] = "此项目对应的试剂2余量不足!";
                        }
                        if (calibMethod == null)
                        {
                            projectInfo[4] = "此项目没有对应的较准方法";
                        }
                        if (calibTaskCout != 0)
                        {
                            projectInfo[5] = "此项目已下任务,请做完此项目任务后才能继续下该项目任务!";
                        }
                        else if (strResult != "")
                        {
                            projectInfo[5] = strResult;
                        }

                        if (projectInfo[2] == null && projectInfo[3] == null && projectInfo[4] == null && projectInfo[5] == null)
                        {
                            projectInfo[1] = "true";
                        }
                        else
                        {
                            projectInfo[1] = "false";
                        }
                    }
                    else
                    {
                        projectInfo[1] = "false";
                        projectInfo[2] = "此项目参数录入有误!";
                        projectInfo[4] = "此项目没有对应的较准曲线";

                        if (reagentState == null)
                        {
                            projectInfo[3] = "此项目没有对应试剂!";
                        }
                        else if (reagentState.Locked == true)
                        {
                            projectInfo[3] = "此项目对应试剂被锁定,无法使用!";
                        }
                    }
                    lstProjectName.Add(projectInfo);
                }
            }
            return(lstProjectName);
        }
Пример #17
0
        public List <string[]> QueryProNameForApplyTask(string StrmethodName, string sampleType)
        {
            List <string[]> lstProjectsInfo = new List <string[]>();

            List <string> lstProjects = myBatis.QueryProNameForApplyTask(StrmethodName, sampleType);

            foreach (string project in lstProjects)
            {
                string[] projectInfo = new string[5];
                projectInfo[0] = project;
                // 1.判断项目参数是否有效
                AssayProjectParamInfo assayProParam = myBatis.GetAssayProjectParamInfoByNameAndType("GetAssayProjectParamInfoByNameAndType", new AssayProjectInfo()
                {
                    ProjectName = project, SampleType = sampleType
                });
                // 2.判断试剂是否存在
                ReagentStateInfoR1R2 reagentState = myBatis.QueryReagentStateInfoByProjectName("QueryReagentStateInfoByProjectName", new ReagentSettingsInfo()
                {
                    ProjectName = project, ReagentType = sampleType
                });
                // 3.判断校准曲线是否可用
                bool bExist = myBatis.CalibCurveBeExistByProNameAndType("CalibCurveBeExistByProNameAndType", new string[] { project, sampleType });
                if (assayProParam != null)
                {
                    if (assayProParam.AnalysisMethod == "" || assayProParam.AnalysisMethod == null)
                    {
                        projectInfo[2] = "该项目参数录入有误!";
                    }

                    if (reagentState == null)
                    {
                        projectInfo[3] = "该项目没有对应试剂!";
                    }
                    else if (reagentState.Locked == true)
                    {
                        projectInfo[3] = "该项目对应试剂被锁定,无法使用!";
                    }
                    else if (reagentState.ReagentName != "" && reagentState.ReagentName != null && reagentState.ValidPercent < 3)
                    {
                        projectInfo[3] = "此项目对应的试剂1余量不足!";
                    }
                    else if (reagentState.ReagentName2 != "" && reagentState.ReagentName2 != null && reagentState.ValidPercent2 < 3)
                    {
                        projectInfo[3] = "此项目对应的试剂2余量不足!";
                    }

                    if (bExist == false)
                    {
                        projectInfo[4] = "该项目没有对应的较准曲线";
                    }


                    if (projectInfo[2] != null || projectInfo[3] != null || projectInfo[4] != null)
                    {
                        projectInfo[1] = "false";
                    }
                    else
                    {
                        projectInfo[1] = "true";
                    }
                }
                else
                {
                    projectInfo[1] = "false";
                    projectInfo[2] = "该项目参数录入有误!";
                    projectInfo[4] = "该项目没有对应的较准曲线";
                    if (reagentState == null)
                    {
                        projectInfo[3] = "该项目没有对应试剂!";
                    }
                    else if (reagentState.Locked == true)
                    {
                        projectInfo[3] = "该项目对应试剂被锁定,无法使用!";
                    }
                    else if (reagentState.ReagentName != "" && reagentState.ValidPercent < 3)
                    {
                        projectInfo[3] = "此项目对应的试剂1余量不足!";
                    }
                    else if (reagentState.ReagentName2 != "" && reagentState.ValidPercent2 < 3)
                    {
                        projectInfo[3] = "此项目对应的试剂2余量不足!";
                    }
                }
                lstProjectsInfo.Add(projectInfo);
            }
            return(lstProjectsInfo);
        }
Пример #18
0
        void RgtWarning(int d, int p)
        {
            float rgtwarncount  = myBatis.GetRgtWarnCount();
            float rgtleastcount = myBatis.GetRgtLeastCount();

            ReagentStateInfoR1R2 rgp = myBatis.GetReagentStateInfoByPos(d, p);
            ReagentSettingsInfo  rsi = myBatis.GetReagentSettingsInfoByPos(d, p);

            if (rgp != null)
            {
                int c = 0;
                int v = System.Convert.ToInt32(rsi.ReagentContainer.Substring(0, rsi.ReagentContainer.IndexOf("ml"))) * rgp.ValidPercent / 100 * 1000;

                switch (d)
                {
                case 1:
                    c = v / 250;
                    if (c < rgtleastcount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000772";
                        trouble.TroubleType = TROUBLETYPE.ERR;
                        trouble.TroubleUnit = "设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}清洗剂耗尽. ", p);
                        myBatis.TroubleLogSave("TroubleLogSave", trouble);

                        return;
                    }
                    if (c < rgtwarncount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000773";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = "设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}清洗剂即将耗尽. ", p);
                        myBatis.TroubleLogSave("TroubleLogSave", trouble);
                        return;
                    }
                    break;

                case 2:
                    c = v / 150;
                    if (c < rgtleastcount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000774";
                        trouble.TroubleType = TROUBLETYPE.ERR;
                        trouble.TroubleUnit = "设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}清洗剂耗尽. ", p);
                        myBatis.TroubleLogSave("TroubleLogSave", trouble);

                        return;
                    }
                    if (c < rgtwarncount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000775";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = "设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}清洗剂即将耗尽. ", p);
                        myBatis.TroubleLogSave("TroubleLogSave", trouble);
                        return;
                    }
                    break;
                }
            }
        }
Пример #19
0
        public List <string[]> QueryProjectNameInfoByQC(string strDBMethod, QualityControlInfo qcInfo, string strSampleType)
        {
            List <string> lstProjectByQC = myBatis.QueryProjectNameInfoByQC(strDBMethod, qcInfo, strSampleType, out qcId);

            //判断该项目下的任务是否已完成
            int QCcount = myBatis.QueryQCTaskByProjectAndSamType("QueryQCTaskByProjectAndSamType", qcId);

            List <string[]> lstProjectInfo = new List <string[]>();

            foreach (string project in lstProjectByQC)
            {
                string[] projectInfo = new string[6];
                projectInfo[0] = project;
                AssayProjectParamInfo assayProParam = myBatis.GetAssayProjectParamInfoByNameAndType("GetAssayProjectParamInfoByNameAndType", new AssayProjectInfo()
                {
                    ProjectName = project, SampleType = strSampleType
                });
                ReagentStateInfoR1R2 reagentState = myBatis.QueryReagentStateInfoByProjectName("QueryReagentStateInfoByProjectName", new ReagentSettingsInfo()
                {
                    ProjectName = project, ReagentType = strSampleType
                });
                // 3.判断校准曲线是否可用
                bool bExist = myBatis.CalibCurveBeExistByProNameAndType("CalibCurveBeExistByProNameAndType", new string[] { project, strSampleType });

                if (assayProParam != null)
                {
                    if (assayProParam.AnalysisMethod == "" || assayProParam.AnalysisMethod == null)
                    {
                        projectInfo[2] = "该项目参数录入有误!";
                    }

                    if (reagentState == null)
                    {
                        projectInfo[3] = "该项目没有对应试剂!";
                    }
                    else if (reagentState.ReagentName == "" || reagentState.ReagentName == null || reagentState.ValidPercent < 3)
                    {
                        projectInfo[3] = "此项目对应的试剂1余量不足!";
                    }
                    else if (reagentState.ReagentName2 == "" || reagentState.ReagentName2 == null || reagentState.ValidPercent2 < 3)
                    {
                        projectInfo[3] = "此项目对应的试剂2余量不足!";
                    }
                    else if (reagentState.Locked == true)
                    {
                        projectInfo[3] = "该项目对应试剂被锁定,无法使用!";
                    }

                    if (bExist == false)
                    {
                        projectInfo[4] = "该项目没有对应的较准曲线";
                    }
                    if (QCcount != 0)
                    {
                        projectInfo[5] = "此项目已下任务,请做完此项目任务后才能继续下该项目任务!";
                    }
                    if (projectInfo[2] == null && projectInfo[3] == null && projectInfo[4] == null && projectInfo[5] == null)
                    {
                        projectInfo[1] = "true";
                    }
                    else
                    {
                        projectInfo[1] = "false";
                    }
                }
                else
                {
                    projectInfo[1] = "false";
                    projectInfo[2] = "该项目参数录入有误!";
                    projectInfo[4] = "该项目没有对应的较准曲线";

                    if (reagentState == null)
                    {
                        projectInfo[3] = "该项目没有对应试剂!";
                    }
                    else if (reagentState.Locked == true)
                    {
                        projectInfo[3] = "该项目对应试剂被锁定,无法使用!";
                    }
                }
                lstProjectInfo.Add(projectInfo);
            }
            return(lstProjectInfo);
        }