private void butok_Click(object sender, EventArgs e) { DataTable tb = MZYF.Get_fyck("", Convertor.IsNull(cmbpyck.SelectedValue, ""), InstanceForm.BDatabase); string add = TrasenClasses.GeneralClasses.PubStaticFun.GetMacAddress().Trim(); if (tb.Rows.Count != 0 && radioButton2.Checked == false) { if (tb.Rows[0]["bzybz"].ToString() == "1") { if (add != tb.Rows[0]["wkdz"].ToString().Trim() && tb.Rows[0]["wkdz"].ToString().Trim() != "") { MessageBox.Show("这个窗口正在使用,您不能选择它"); return; } } if (tb.Rows[0]["bscbz"].ToString() == "1") { MessageBox.Show("该窗口已停用,您不能选择它"); return; } } if (radioButton1.Checked == true && Convertor.IsNull(cmbpyck.SelectedValue, "") == "") { MessageBox.Show("请选择当前发药窗口", "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string fyckdm = ""; string fyckmc = ""; if (radioButton1.Checked == true) { fyckdm = cmbpyck.SelectedValue.ToString(); fyckmc = cmbpyck.Text.Trim(); MZYF.Update_fyck(add, fyckdm, 1, InstanceForm.BDatabase); } Frmcffy f = new Frmcffy(_menuTag, _chineseName, _mdiParent); f._Fyckh = Convertor.IsNull(fyckdm, ""); f._Fyckmc = Convertor.IsNull(fyckmc, ""); this.Close(); if (_mdiParent != null) { f.MdiParent = _mdiParent; } f.Show(); }
/// <summary> /// 根据函数名称实例化窗体 /// </summary> public void InstanceWorkForm() { if (_functionName == "") { throw new Exception("引出函数名不能为空!"); } //★需要调用的窗口类 switch (_functionName) { case "Fun_ts_yf_zyfy_tld": case "Fun_ts_yf_zyfy_tld_by": case "Fun_ts_yf_zyfy_tld_bq": case "Fun_ts_yf_zyfy_ly": case "Fun_ts_yf_zyfy_tld_jz": //Add By Tany 2015-05-04 增加引出函数,仅仅记账 case "Fun_ts_yf_zyfy_tld_by_jz": //Add By Tany 2015-05-04 增加引出函数,仅仅记账 Frmtlfy Frmtlfy = new Frmtlfy(_menuTag, _chineseName, _mdiParent); if (_mdiParent != null) { Frmtlfy.MdiParent = _mdiParent; } Frmtlfy.Show(); break; case "Fun_ts_yf_zyfy_cf": case "Fun_ts_yf_zyfy_cf_ZCY": case "Fun_ts_yf_zyfy_cf_YFFY": case "Fun_ts_yf_zyfy_cf_cx": case "Fun_ts_yf_zyfy_cf_jy": Frmcffy Frmcffy = new Frmcffy(_menuTag, _chineseName, _mdiParent); if (_mdiParent != null) { Frmcffy.MdiParent = _mdiParent; } Frmcffy.Show(); break; case "Fun_ts_yf_zyfy_tld_cx": case "Fun_ts_yf_zyfy_tld_by_cx": Frmtlfy_cx Frmtlfy_cx = new Frmtlfy_cx(_menuTag, _chineseName, _mdiParent); if (_mdiParent != null) { Frmtlfy_cx.MdiParent = _mdiParent; } Frmtlfy_cx.Show(); break; default: throw new Exception("引出函数名称错误!"); } }
/// <summary> /// 根据函数名称实例化窗体 /// </summary> public void InstanceWorkForm() { if (_functionName == "") { throw new Exception("引出函数名不能为空!"); } //Frmmzfy Frmmzfy = null; //★需要调用的窗口类 switch (_functionName) { case "Fun_ts_yf_mzfy": case "Fun_ts_yf_mzfy_ZCY": case "Fun_ts_yf_mzfy_YFFY": case "Fun_ts_yf_mzfy_eyf": // Frmmzfy=new Frmmzfy(_menuTag,_chineseName,_mdiParent); // Frmmzfy.MdiParent=_mdiParent; // Frmmzfy.Show(); //Frmcffy Frmcffy = new Frmcffy(_menuTag, _chineseName, _mdiParent); //Frmcffy.MdiParent = _mdiParent; //Frmcffy.Show(); YpConfig s = new YpConfig(TrasenFrame.Forms.FrmMdiMain.CurrentDept.DeptId, InstanceForm.BDatabase); string add = TrasenClasses.GeneralClasses.PubStaticFun.GetMacAddress(); DataTable tb = MZYF.Get_fyck(add, "", InstanceForm.BDatabase); if (tb.Rows.Count == 0) { if (s.配药模式 == true) { Frmpyck f = new Frmpyck(_menuTag, _chineseName, _mdiParent); f.ShowDialog(); return; } } if (tb.Rows.Count > 0) { if (tb.Rows[0]["bscbz"].ToString() == "1") { MessageBox.Show("该窗口已被停用,如需使用请重新启用它!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning); if (s.配药模式 == true) { Frmpyck f = new Frmpyck(_menuTag, _chineseName, _mdiParent); f.ShowDialog(); return; } } } string fyckh = ""; string fyckmc = ""; if (tb.Rows.Count != 0) { fyckh = tb.Rows[0]["CODE"].ToString().Trim(); } if (tb.Rows.Count != 0) { fyckmc = tb.Rows[0]["name"].ToString().Trim(); } Frmcffy Frmcffy = new Frmcffy(_menuTag, _chineseName, _mdiParent); Frmcffy._Fyckh = fyckh.Trim(); Frmcffy._Fyckmc = fyckmc; MZYF.Update_fyck(add, Frmcffy._Fyckh, 1, InstanceForm.BDatabase); if (_mdiParent != null) { Frmcffy.MdiParent = _mdiParent; } Frmcffy.Show(); break; case "Fun_ts_yf_SetFyckUse": FrmSetFyckUse frm = new FrmSetFyckUse(_menuTag, _chineseName, _mdiParent); if (_mdiParent != null) { frm.MdiParent = _mdiParent; } frm.Show(); break; default: throw new Exception("引出函数名错误!"); } }