public void LoadingReagentBlocking_Load(object sender, EventArgs e) { dtpValidDate.DateTime = DateTime.Now.AddMonths(1); rs = ReagentConfigInfoConstrunction.ReagentStateInfo; rc = ReagentConfigInfoConstrunction.ReagentConfig; //异步方法调用 this.loadFrmReagent(); }
/// <summary> /// 保存试剂条码配制信息 /// </summary> /// <param name="rc"></param> public void SaveReagentConfigInfo(ReagentConfigInfo rc) { try { string Sql = string.Format("insert ReagentConfigTb(IsSampBarcodeOpen,IsReagentBarcodeOpen,IsHandheldBarcodeOpen,SampleBracodeLength,ReagentBarcodeLength) values('{0}','{1}','{2}',{3},{4})", rc.IsSampBarcodeOpen, rc.IsReagentBarcodeOpen, rc.IsHandheldBarcodeOpen, rc.SampleBracodeLength, rc.ReagentBarcodeLength); ism_SqlMap.Insert("ReagentInfo.DeleteAndSaveReagentConfig", Sql); } catch (Exception ex) { LogInfo.WriteErrorLog("SaveReagentConfigInfo(ReagentConfigInfo rc) == " + ex.Message, Module.Reagent); } }
/// <summary> /// 获取条码配置信息 /// </summary> /// <returns></returns> public ReagentConfigInfo GetReagentConfigInfo() { ReagentConfigInfo rc = null; try { rc = ism_SqlMap.QueryForObject("ReagentInfo.GetReagentConfigInfo", string.Format("select * from ReagentConfigTb")) as ReagentConfigInfo; } catch (Exception ex) { LogInfo.WriteErrorLog("ReagentConfigInfo GetReagentConfigInfo() == " + ex.Message, Module.Reagent); } return(rc); }
/// <summary> /// 保存条码配制功能 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void chekSaveConfig_CheckedChanged(object sender, EventArgs e) { ReagentConfigInfo rc = new ReagentConfigInfo(); rc.IsSampBarcodeOpen = this.chkSDBROpen.Checked; rc.IsReagentBarcodeOpen = this.chkRDBROpen.Checked; rc.IsHandheldBarcodeOpen = this.chkHBROpen.Checked; if (textBox1.Text.Trim() == "" || textBox1.Text.Trim() == "0") { MessageBox.Show("样本条码长度不能为空,而且必须大于0!"); return; } if (textBox2.Text.Trim() == "" || textBox2.Text.Trim() == "0") { MessageBox.Show("试剂条码长度不能为空,而且必须大于0!"); return; } rc.SampleBracodeLength = Convert.ToInt32(textBox1.Text.Trim()); rc.ReagentBarcodeLength = Convert.ToInt32(textBox2.Text.Trim()); new BioA.Service.ReagentState().ISaveReagentConfigInfo(rc); ReagentConfigInfoConstrunction.ReagentConfig = null; }
/// <summary> /// 显示条码配置和试剂状态设置数据 /// </summary> /// <param name="rs"></param> /// <param name="rc"></param> private void DisplayReagentConfig(ReagentStateInfo rs, ReagentConfigInfo rc) { if (rc != null) { this.chkSDBROpen.Checked = rc.IsSampBarcodeOpen; this.chkRDBROpen.Checked = rc.IsReagentBarcodeOpen; this.chkHBROpen.Checked = rc.IsHandheldBarcodeOpen; this.textBox1.Text = rc.SampleBracodeLength.ToString(); this.textBox2.Text = rc.ReagentBarcodeLength.ToString(); } if (rs != null) { switch (rs.ReagentStatusModule) { case 1: this.checkReagentOpen.Checked = true; break; case 2: this.checkReagentSemiBlocking.Checked = true; this.grpChannleNumber.Enabled = true; break; } if (rs.ReagentNumberList.Count > 0) { for (int i = 0; i < rs.ReagentNumberList.Count; i++) { if (rs.ReagentNumberList[i] == 1) { this.checkEdit1.Checked = true; continue; } else if (rs.ReagentNumberList[i] == 2) { this.checkEdit2.Checked = true; continue; } else if (rs.ReagentNumberList[i] == 3) { this.checkEdit3.Checked = true; continue; } else if (rs.ReagentNumberList[i] == 4) { this.checkEdit4.Checked = true; continue; } else if (rs.ReagentNumberList[i] == 5) { this.checkEdit5.Checked = true; continue; } else if (rs.ReagentNumberList[i] == 6) { this.checkEdit6.Checked = true; continue; } else if (rs.ReagentNumberList[i] == 7) { this.checkEdit7.Checked = true; continue; } else if (rs.ReagentNumberList[i] == 8) { this.checkEdit8.Checked = true; continue; } else if (rs.ReagentNumberList[i] == 9) { this.checkEdit9.Checked = true; continue; } else if (rs.ReagentNumberList[i] == 10) { this.checkEdit10.Checked = true; continue; } } } } }
/// <summary> /// 保存试剂条码配制信息 /// </summary> public void ISaveReagentConfigInfo(ReagentConfigInfo rc) { myBatis.DeleteReagentConfigInfo(); myBatis.SaveReagentConfigInfo(rc); }