private void dataGridView1_DoubleClick(object sender, EventArgs e) { DataTable tb = (DataTable)dataGridView1.DataSource; if (tb == null) { return; } if (tb.Rows.Count == 0) { return; } int nrow = dataGridView1.CurrentCell.RowIndex; int sqks = Convert.ToInt32(tb.Rows[nrow]["sqks"]); int sqys = Convert.ToInt32(tb.Rows[nrow]["sqys"]); string blh = Convert.ToString(tb.Rows[nrow]["门诊号"]); Frmblcf frm = new Frmblcf(_menuTag, _chineseName, _mdiParent, new Employee(sqys, InstanceForm.BDatabase), new Department(sqks, InstanceForm.BDatabase), blh); if (_mdiParent != null) { frm.MdiParent = _mdiParent; } frm.Show(); frm.txtmzh_KeyPress(sender, new KeyPressEventArgs((char)Keys.Enter)); }
private void butsave_Click(object sender, EventArgs e) { string ssql; string jzid = Convertor.IsNull(cmbzj.SelectedValue, "0"); DateTime djsj = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); ssql = "select * from jc_zjsz where zjid=" + jzid + ""; DataTable tbjz = InstanceForm.BDatabase.GetDataTable(ssql); if (tbjz.Rows.Count == 0) { return; } if (tbjz.Rows[0]["BDLBZ"].ToString() == "1") { if (tbjz.Rows[0]["wkdz"].ToString() != PubStaticFun.GetMacAddress()) { if (MessageBox.Show(this, "该诊室已被其它电脑占用,您确定要强制占用该诊间吗?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } } } if (Convert.ToInt16(cg.Config) == 0) { ssql = "update jc_zjsz set BDLBZ=1,ZZYS=" + InstanceForm.BCurrentUser.EmployeeId.ToString() + ", wkdz='" + PubStaticFun.GetMacAddress() + "',dlsj='" + djsj.ToString() + "' where zjid=" + jzid + " "; } else { ssql = "update jc_zjsz set BDLBZ=1,ZZYS=" + InstanceForm.BCurrentUser.EmployeeId.ToString() + ",wkdz='" + PubStaticFun.GetMacAddress() + "',dlsj='" + djsj.ToString() + "' , ksdm=" + Convertor.IsNull(cmbks.SelectedValue, "0") + " where zjid=" + jzid + " "; } InstanceForm.BDatabase.DoCommand(ssql); ReturnZsID = Convert.ToInt32(jzid); this.Hide(); if (this.Text != "重新确认诊间") { Frmblcf Frmhjsf = new Frmblcf(_menuTag, _chineseName, _mdiParent, Convert.ToInt32(jzid)); if (_mdiParent != null) { Frmhjsf.MdiParent = _mdiParent; } Frmhjsf.Show(); } }
/// <summary> /// 根据函数名称实例化窗体 /// </summary> public void InstanceWorkForm() { if (_functionName == "") { throw new Exception("引出函数名不能为空!"); } switch (_functionName) { case "Fun_ts_mzys_blcflr": case "Fun_ts_mzys_blcflr_grmb": case "Fun_ts_mzys_blcflr_kjmb": case "Fun_ts_mzys_blcflr_yjmb": case "Fun_ts_mzys_blcflr_xdcf_yj": case "Fun_ts_mzys_blcflr_xdcf_kj": case "Fun_ts_zyys_blcflr": DateTime djsj = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); //验证科室是否需要分诊 string ssql = "select * from MZYS_FZKS where ksdm=" + InstanceForm.BCurrentDept.DeptId + ""; bool IsSelect_Room = IsSelectRoom(djsj); DataTable tbks = InstanceForm.BDatabase.GetDataTable(ssql); if (tbks.Rows.Count == 0 || (!IsSelect_Room) || (_functionName != "Fun_ts_zyys_blcflr" && _functionName != "Fun_ts_mzys_blcflr")) { Frmblcf Frmhjsf = new Frmblcf(_menuTag, _chineseName, _mdiParent, 0); if (_mdiParent != null) { Frmhjsf.MdiParent = _mdiParent; } Frmhjsf.Show(); return; } //如果需要分诊 SystemCfg cg = new SystemCfg(3001); ssql = "select * from jc_zjsz where wkdz='" + PubStaticFun.GetMacAddress() + "'"; DataTable tbjz = InstanceForm.BDatabase.GetDataTable(ssql); //判断是否启用分时段叫号系统 如果未启用则用老的选择诊室模式 Modify By zp 2013-06-18 if (new SystemCfg(3070).Config == "1") { #region 未用新分诊系统 则用老的模式选择诊室 if (tbjz.Rows.Count == 1) { if (Convert.ToInt16(cg.Config) == 0) { ssql = "update jc_zjsz set BDLBZ=1,ZZYS=" + InstanceForm.BCurrentUser.EmployeeId.ToString() + ", wkdz='" + PubStaticFun.GetMacAddress() + "',dlsj='" + djsj.ToString() + "' where zjid=" + tbjz.Rows[0]["zjid"].ToString() + " "; } else { ssql = "update jc_zjsz set BDLBZ=1,ZZYS=" + InstanceForm.BCurrentUser.EmployeeId.ToString() + ",wkdz='" + PubStaticFun.GetMacAddress() + "',dlsj='" + djsj.ToString() + "' , ksdm=" + InstanceForm.BCurrentDept.DeptId + " where zjid=" + tbjz.Rows[0]["zjid"].ToString() + " "; } InstanceForm.BDatabase.DoCommand(ssql); Frmblcf Frmhjsf = new Frmblcf(_menuTag, _chineseName, _mdiParent, Convert.ToInt32(tbjz.Rows[0]["zjid"])); if (_mdiParent != null) { Frmhjsf.MdiParent = _mdiParent; } Frmhjsf.Show(); break; } else { Frmzjqr f = new Frmzjqr(_menuTag, _chineseName, _mdiParent); f.ShowDialog(); break; } #endregion } else { #region 启用新分诊系统 if (tbjz.Rows.Count == 1 && int.Parse(Convertor.IsNull(tbjz.Rows[0]["ZZYS"], "-1")) == InstanceForm.BCurrentUser.EmployeeId && int.Parse(Convertor.IsNull(tbjz.Rows[0]["KSDM"], "-1")) == InstanceForm.BCurrentDept.DeptId) //得到结果后需要判断诊室记录的科室代码和医生代码与当前坐诊科室、坐诊医生是否一致 { if (Convert.ToInt16(cg.Config) == 0) { ssql = "update jc_zjsz set BDLBZ=1,ZZYS=" + InstanceForm.BCurrentUser.EmployeeId.ToString() + ", wkdz='" + PubStaticFun.GetMacAddress() + "',dlsj='" + djsj.ToString() + "' where zjid=" + tbjz.Rows[0]["zjid"].ToString() + " "; } else { ssql = "update jc_zjsz set BDLBZ=1,ZZYS=" + InstanceForm.BCurrentUser.EmployeeId.ToString() + ",wkdz='" + PubStaticFun.GetMacAddress() + "',dlsj='" + djsj.ToString() + "' , ksdm=" + InstanceForm.BCurrentDept.DeptId + " where zjid=" + tbjz.Rows[0]["zjid"].ToString() + " "; } InstanceForm.BDatabase.DoCommand(ssql); Frmblcf Frmhjsf = new Frmblcf(_menuTag, _chineseName, _mdiParent, Convert.ToInt32(tbjz.Rows[0]["zjid"])); if (_mdiParent != null) { Frmhjsf.MdiParent = _mdiParent; } Frmhjsf.Show(); break; } else //通过参数3065决定诊室选择模式 { DataTable dt = BindRoom(); Frmzjqr f = new Frmzjqr(_menuTag, _chineseName, _mdiParent, dt); f.ShowDialog(); break; } #endregion } #region 注释代码 Modify By zp 2013-07-09 //if (tbjz.Rows.Count == 1) //{ // if (Convert.ToInt16(cg.Config) == 0) // ssql = "update jc_zjsz set BDLBZ=1,ZZYS=" + InstanceForm.BCurrentUser.EmployeeId.ToString() + ", wkdz='" + PubStaticFun.GetMacAddress() + "',dlsj='" + djsj.ToString() + "' where zjid=" + tbjz.Rows[0]["zjid"].ToString() + " "; // else // ssql = "update jc_zjsz set BDLBZ=1,ZZYS=" + InstanceForm.BCurrentUser.EmployeeId.ToString() + ",wkdz='" + PubStaticFun.GetMacAddress() + "',dlsj='" + djsj.ToString() + "' , ksdm=" + InstanceForm.BCurrentDept.DeptId + " where zjid=" + tbjz.Rows[0]["zjid"].ToString() + " "; // InstanceForm.BDatabase.DoCommand(ssql); // Frmblcf Frmhjsf = new Frmblcf(_menuTag, _chineseName, _mdiParent, Convert.ToInt32(tbjz.Rows[0]["zjid"])); // if (_mdiParent != null) // { // Frmhjsf.MdiParent = _mdiParent; // } // Frmhjsf.Show(); // break; //} //else //{ // Frmzjqr f = new Frmzjqr(_menuTag, _chineseName, _mdiParent); // f.ShowDialog(); // break; //} #endregion case "Fun_ts_mzys_jzlscx": case "Fun_ts_mzys_jzlscx_all": Frmjzlscx Frmjzlscx = new Frmjzlscx(_menuTag, _chineseName, _mdiParent); if (_mdiParent != null) { Frmjzlscx.MdiParent = _mdiParent; } Frmjzlscx.Show(); break; case "Fun_ts_mzys_blcflr_wtsq": Frmwtsqcx Frmwtsqcx = new Frmwtsqcx(_menuTag, _chineseName, _mdiParent); if (_mdiParent != null) { Frmwtsqcx.MdiParent = _mdiParent; } Frmwtsqcx.Show(); break; case "Fun_ts_mzys_zymbwh": FrmZyMbWh frmzymbwh = new FrmZyMbWh(_menuTag, _chineseName, _mdiParent); if (_mdiParent != null) { frmzymbwh.MdiParent = _mdiParent; } frmzymbwh.Show(); break; case "Fun_ts_mztfsh": case "Fun_ts_mztfsq_ys": //add by zouchihua 2014-9-14 医生申请也可以挂菜单 Frm_TF_Apply frm_tfsq = new Frm_TF_Apply(_menuTag, _chineseName, _mdiParent); if (_mdiParent != null) { frm_tfsq.MdiParent = _mdiParent; } frm_tfsq.Show(); break; case "Fun_ts_mztfsq_hj": //add by zouchihua 2014-9-14 如果是划价的话,也可以挂菜单 Frm_TF_Apply frm_tfsq1 = new Frm_TF_Apply(_menuTag, _chineseName, _mdiParent); frm_tfsq1.Show(); break; case "Fun_ts_mzys_yyjbsh": 用药级别审核 Frmyyjbsh = new 用药级别审核(_menuTag, _chineseName, _mdiParent); if (_mdiParent != null) { Frmyyjbsh.MdiParent = _mdiParent; } Frmyyjbsh.Show(); break; case "Fun_ts_zyzCx": frmZyzCx frmActon = new frmZyzCx(); if (frmActon != null) { frmActon.MdiParent = _mdiParent; } frmActon.Show(); frmActon.WindowState = FormWindowState.Maximized; break; default: throw new Exception("引出函数名称错误!"); } }
private void butsave_Click(object sender, EventArgs e) { string ssql; string jzid = Convertor.IsNull(cmbzj.SelectedValue, "0"); DateTime djsj = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); ssql = "select * from jc_zjsz where zjid=" + jzid + ""; DataTable tbjz = InstanceForm.BDatabase.GetDataTable(ssql); if (tbjz.Rows.Count == 0) { return; } if (tbjz.Rows[0]["BDLBZ"].ToString() == "1") { if (cfg3141.Config.Trim() == "0") //如果允许强制占用则只给提示 Add by zp 2014-08-22 { if (tbjz.Rows[0]["wkdz"].ToString() != PubStaticFun.GetMacAddress()) { if (MessageBox.Show(this, "该诊室已被其它电脑占用,您确定要强制占用该诊间吗?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } } } else //否则,限制不允许占用已登陆的诊间 Add by zp 2014-08-22 { if (tbjz.Rows[0]["wkdz"].ToString() != PubStaticFun.GetMacAddress()) { MessageBox.Show(this, "该诊室已被其它电脑占用!系统部允许强制占用已被其他医生占用的诊间!如果异议请联系管理员!,", "确认"); return; } } //End Modify by zp 2014-08-22 } if (Convert.ToInt16(cg.Config) == 0) { ssql = "update jc_zjsz set BDLBZ=1,ZZYS=" + InstanceForm.BCurrentUser.EmployeeId.ToString() + ", wkdz='" + PubStaticFun.GetMacAddress() + "',dlsj='" + djsj.ToString() + "' where zjid=" + jzid + " "; } else { ssql = "update jc_zjsz set BDLBZ=1,ZZYS=" + InstanceForm.BCurrentUser.EmployeeId.ToString() + ",wkdz='" + PubStaticFun.GetMacAddress() + "',dlsj='" + djsj.ToString() + "' , ksdm=" + Convertor.IsNull(cmbks.SelectedValue, "0") + " where zjid=" + jzid + " "; } InstanceForm.BDatabase.DoCommand(ssql); if (new SystemCfg(3103).Config == "1") { string strSql = string.Format(@"update mzhs_fzjl set zsid= {0} where fzys ={1} and BJZBZ in (1,2,4)", jzid, InstanceForm.BCurrentUser.EmployeeId.ToString()); InstanceForm.BDatabase.DoCommand(strSql); } ReturnZsID = Convert.ToInt32(jzid); this.Hide(); if (this.Text != "重新确认诊间") { Frmblcf Frmhjsf = new Frmblcf(_menuTag, _chineseName, _mdiParent, Convert.ToInt32(jzid)); if (_mdiParent != null) { Frmhjsf.MdiParent = _mdiParent; } Frmhjsf.Show(); } }