private void ReagentSettingLoad() { lstReagentSettingsInfo = new BioA.Service.ReagentSetting().QueryReagentSettingsInfo("QueryReagentSetting1", ""); //把获取到的数据绑定到gridControl1控件上,显示到界面 InitialReagentInfos(lstReagentSettingsInfo); lstReagentSettingsR2Info = new BioA.Service.ReagentSetting().QueryReagentSettingsInfo("QueryReagentSetting2", ""); //把获取到的数据绑定到gridControl2控件上,显示到界面 InitialReagentInfos2(lstReagentSettingsR2Info); rs = ReagentConfigInfoConstrunction.ReagentStateInfo; if (rs.ReagentStatusModule == 1) { if (frmloadingReagent == null) { frmloadingReagent = new frmLoadingReagent(); frmloadingReagent.StartPosition = FormStartPosition.CenterScreen; frmloadingReagent.GetsReagentEvent += GeTheReagentAfterPreservationEvent; } } else if (rs.ReagentStatusModule == 2) { if (lReagentBlock == null) { lReagentBlock = new LoadingReagentBlocking(); lReagentBlock.StartPosition = FormStartPosition.CenterScreen; lReagentBlock.ScannSingleReagentEvent += OnScannSingleReagentEvent; lReagentBlock.InputReagentBarcodeEvent += OnInputReagentBarcodeEvent; lReagentBlock.RefreshReagentInfoEvent += GeTheReagentAfterPreservationEvent; } } }
private void OnInputReagentBarcodeEvent(object o) { int i = int.Parse(o.ToString()); if (i == 1) { lstReagentSettingsInfo = new BioA.Service.ReagentSetting().QueryReagentSettingsInfo("QueryReagentSetting1", ""); //把获取到的数据绑定到gridControl1控件上,显示到界面 InitialReagentInfos(lstReagentSettingsInfo); } else if (i == 2) { lstReagentSettingsR2Info = new BioA.Service.ReagentSetting().QueryReagentSettingsInfo("QueryReagentSetting2", ""); //把获取到的数据绑定到gridControl2控件上,显示到界面 InitialReagentInfos2(lstReagentSettingsR2Info); } }
private void btnSave_Click(object sender, EventArgs e) { ReagentSettingsInfo reagentSettingsInfo = new ReagentSettingsInfo(); reagentSettingsInfo.Barcode = txtBarcode.Text; reagentSettingsInfo.BatchNum = txtBatchNum.Text; if (cboReagentPos.Text != "") { reagentSettingsInfo.Pos = cboReagentPos.Text; } else { //MessageBoxDraw.ShowMsg("请填写试剂位置!", MsgType.Warning); MessageBox.Show("请填写试剂位置!"); this.cboReagentPos.Focus(); return; } if (cboProjectCheck.Text != "" && cboProjectCheck.Text != "请选择") { reagentSettingsInfo.ProjectName = cboProjectCheck.Text; } else if (cboReagentType.Text == "清洗剂" || cboReagentType.Text == "稀释液") { } else { MessageBox.Show("请选择项目名称!"); this.cboProjectCheck.Focus(); return; } if (txtReagentName.Text.Trim() != "") { reagentSettingsInfo.ReagentName = txtReagentName.Text; } else { MessageBox.Show("请填写试剂名称!"); this.txtReagentName.Focus(); return; } this.btnSave.Enabled = false; this.btnCancel.Enabled = false; reagentSettingsInfo.ValidDate = dtpValidDate.DateTime; reagentSettingsInfo.ReagentContainer = cboReagentVol.Text; reagentSettingsInfo.ReagentType = cboReagentType.Text; int reagentDisk = 0; if (this.Text == "试剂装载R1") { reagentDisk = 1; } else if (this.Text == "试剂装载R2") { reagentDisk = 2; } string s = new BioA.Service.ReagentSetting().AddreagentSettingInfo(reagentDisk, reagentSettingsInfo); if (s != "试剂装载成功!") { MessageBox.Show("试剂条码R" + reagentDisk + "装载失败!"); } else { if (GetsReagentEvent != null) { GetsReagentEvent(reagentDisk, reagentSettingsInfo); } } this.btnSave.Enabled = true; this.btnCancel.Enabled = true; this.Close(); }