public frmzz(Guid ghxxid, Fz_Zq zq)//,bool bhs { InitializeComponent(); // Bhs = bhs; _CurrentZq = zq; _CurrentGhxxid = ghxxid; // string ssql = @"select brxm 姓名,dbo.FUN_ZY_SEEKSEXNAME(xb) 性别,dbo.fun_zy_age(csrq,3,getdate()) 年龄,ghsj 挂号时间,blh 门诊号, // dbo.fun_getdeptname(ghks) 挂号科室,type_name 挂号级别,dbo.fun_getempname(ghys) 挂号医生,a.ghxxid,ghks,ghys,ghjb,pdxh // from mz_ghxx a inner join yy_brxx b on a.brxxid=b.brxxid // left join yy_kdjb c on a.kdjid=c.kdjid left join jc_doctor_type d // on a.ghjb= d.type_id where ghxxid='"+ghxxid+"' and bqxghbz=0 "; // DataTable tb = InstanceForm.BDatabase.GetDataTable(ssql); dt_ghxx = MZHS_FZJL.GetMzGhxxToZz(ghxxid, InstanceForm.BDatabase); if (dt_ghxx.Rows.Count == 0) { return; } lblbrxm.Text = Convertor.IsNull(dt_ghxx.Rows[0]["姓名"], ""); lblxb.Text = Convertor.IsNull(dt_ghxx.Rows[0]["性别"], ""); lblnl.Text = Convertor.IsNull(dt_ghxx.Rows[0]["年龄"], ""); lblblh.Text = Convertor.IsNull(dt_ghxx.Rows[0]["门诊号"], ""); lblghsj.Text = Convertor.IsNull(dt_ghxx.Rows[0]["挂号时间"], ""); lblghks.Text = Convertor.IsNull(dt_ghxx.Rows[0]["挂号科室"], ""); lblghks.Tag = Convertor.IsNull(dt_ghxx.Rows[0]["ghks"], ""); lblghys.Text = Convertor.IsNull(dt_ghxx.Rows[0]["挂号医生"], ""); lblghys.Tag = Convertor.IsNull(dt_ghxx.Rows[0]["ghys"], ""); lblghjb.Text = Convertor.IsNull(dt_ghxx.Rows[0]["挂号级别"], ""); lblghjb.Tag = Convertor.IsNull(dt_ghxx.Rows[0]["ghjb"], ""); // if (bhs == true) cmbks.Enabled = false; }
private void butref1_Click(object sender, EventArgs e) { try { if (cmbks.ComboBox.SelectedValue == null) { return; } if (cmbks.ComboBox.SelectedValue.ToString() == "System.Data.DataRowView") { return; } int ksdm = Convert.ToInt32(Convertor.IsNull(cmbks.ComboBox.SelectedValue, "0"));//DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToShortDateString() string rq1 = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToShortDateString() + " 00:00:00"; string rq2 = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToShortDateString() + " 23:59:59"; int klx = 0; string kh = ""; string blh = ""; DataTable tb = MZHS_FZJL.Select_whzbr(ksdm, rq1, rq2, klx, kh, blh, InstanceForm.BDatabase).Tables[0]; AddListView1(tb); } catch (System.Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnOK_Click(object sender, EventArgs e) { bool bReturn = MZHS_FZJL.KzzZz(Convert.ToInt32(_CurrentZq.Zqid), Convert.ToInt32(this.cmbDept.SelectedValue), blh, InstanceForm.BDatabase); if (bReturn) { this.DialogResult = DialogResult.OK; this.Close(); } else { this.DialogResult = DialogResult.No; this.Close(); } }
private void butref2_Click(object sender, EventArgs e) { try { int ksdm = 0;//DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToShortDateString() string rq1 = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToShortDateString() + " 00:00:00"; string rq2 = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToShortDateString() + " 23:59:59"; int klx = 0; string kh = ""; string blh = ""; DataTable tb = MZHS_FZJL.Select_yhzbr(ksdm, rq1, rq2, klx, kh, blh, InstanceForm.BDatabase).Tables[0]; AddListView2(tb); } catch (System.Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void butqxhz_Click(object sender, EventArgs e) { try { if (listView2.SelectedIndices.Count == 0) { return; } ListViewItem item = (ListViewItem)listView2.SelectedItems[0]; if (MessageBox.Show(this, "您确认要取消[" + item.SubItems["姓名"].Text + "]的候诊吗?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } MZHS_FZJL.Delete_Hz(new Guid(item.SubItems["fzid"].Text), InstanceForm.BDatabase); item.Remove(); UpdatePxxh(); } catch (System.Exception ERR) { MessageBox.Show(ERR.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void SaveZz() { try { /*转诊需要先验证挂号金额,如果挂号金额不一致则不允许转诊 */ #region 限制转诊 if (dt_ghxx == null || dt_ghxx.Rows.Count <= 0) { MessageBox.Show("未获取挂号信息!转诊失败!", "提示"); return; } if (this.cmbks.SelectedValue == null) { MessageBox.Show("请选择转入科室!", "提示"); return; } if (this.cmbys.SelectedValue == null) { MessageBox.Show("请选择指定医生!", "提示"); return; } int ghlb = Convert.ToInt32(dt_ghxx.Rows[0]["GHLB"]); int oldghks = Convert.ToInt32(lblghks.Tag); int oldghjb = Convert.ToInt32(lblghjb.Tag); int oldghys = Convert.ToInt32(lblghys.Tag); Jgbm = TrasenFrame.Forms.FrmMdiMain.Jgbm; int err_code = 0; string err_text = ""; decimal oldghje = 0; decimal newghje = 0; /*先获取原有科室的挂号费用*/ DataSet mxds = mz_ghxx.mzgh_get_sfmx(ghlb, 1, 0, oldghks, oldghjb, oldghys, "", 0, 0, Guid.Empty, Jgbm, out err_code, out err_text, "", InstanceForm.BDatabase); if (err_code != 0) { MessageBox.Show(err_text, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } oldghje = Convert.ToDecimal(mxds.Tables[0].Compute("sum(zje)", "")); //计算结果集1表的总金额 int newghks = Convert.ToInt32(this.cmbks.SelectedValue); int newghys = Convert.ToInt32(this.cmbys.SelectedValue); DataSet dset = mz_ghxx.mzgh_get_sfmx(ghlb, 1, 0, newghks, oldghjb, newghys, "", 0, 0, Guid.Empty, Jgbm, out err_code, out err_text, "", InstanceForm.BDatabase); if (err_code != 0) { MessageBox.Show(err_text, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } newghje = Convert.ToDecimal(dset.Tables[0].Compute("sum(zje)", "")); //计算结果集1表的总金额 if (new SystemCfg(3110).Config != "1") { if (oldghje != newghje) { MessageBox.Show("挂号金额不同!不允许转诊!", "提示"); return; } } #endregion /*金额相同,那还需要处理候诊号问题 将mzhs_fzjl的候诊号设置为0 将pdsj设置为转诊目的科室的最后时间*/ Guid _Zzid = Guid.NewGuid(); MZHS_FZJL.HsZzSave(newghks, newghys, _CurrentGhxxid, InstanceForm.BDatabase); //转诊记录更新为存储到MZYS_JZJL Modify By zp 2013-11-04 err_code = -1; err_text = ""; Guid jzid = Guid.Empty; string date = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToString("yyyy-MM-dd HH:mm:ss"); //Modify By ZJ 2012-11-13 登记时间加格式化处理 ts_mzys_class.mzys_jzjl.jz(Jgbm, _CurrentGhxxid, newghys, newghks, date, "转诊", out jzid, out err_code, out err_text, 0, InstanceForm.BDatabase); if (err_code != 0) { throw new Exception(err_text); } // MZHS_FZJL.SetMzZzJl(oldghks, oldghys, newghks, newghys, InstanceForm.BCurrentUser.EmployeeId, _Zzid,_CurrentGhxxid, InstanceForm.BDatabase); MessageBox.Show("转诊成功!", "提示"); this.Close(); } catch (Exception ea) { MessageBox.Show("出现异常!原因:" + ea.Message, "错误"); } }
private void txtkh_KeyPress(object sender, KeyPressEventArgs e) { try { if ((int)e.KeyChar != 13) { return; } Guid NewFzid = Guid.Empty; int err_code = -1; string err_text = ""; Control control = (Control)sender; int ksdm = Convert.ToInt32(Convertor.IsNull(cmbks.ComboBox.SelectedValue, "0")); string rq1 = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToShortDateString() + " 00:00:00"; string rq2 = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToShortDateString() + " 23:59:59"; int klx = Convert.ToInt32(Convertor.IsNull(cmbklx.SelectedValue, "0")); if (control.Name == "txtkh") { txtkh.Text = Fun.returnKh(klx, txtkh.Text.Trim(), InstanceForm.BDatabase); txtkh.SelectAll(); } if (control.Name == "txtmzh" || control.Name == "listView1") { txtmzh.Text = Fun.returnMzh(txtmzh.Text.Trim(), InstanceForm.BDatabase); txtmzh.SelectAll(); } string kh = control.Name == "txtkh" ? Fun.returnKh(klx, txtkh.Text.Trim(), InstanceForm.BDatabase) : ""; string blh = control.Name == "txtmzh" || control.Name == "listView1" ? Fun.returnMzh(txtmzh.Text.Trim(), InstanceForm.BDatabase) : ""; DataSet dset = MZHS_FZJL.Select_whzbr(ksdm, rq1, rq2, klx, kh, blh, InstanceForm.BDatabase); DataTable tb = dset.Tables[0]; //如果多行,则由用户选择 if (tb.Rows.Count > 1) { AddListView1(tb); } //如果找到一行。则直接候诊 if (tb.Rows.Count == 1) { try { InstanceForm.BDatabase.BeginTransaction(); MZHS_FZJL.AddHz(TrasenFrame.Forms.FrmMdiMain.Jgbm, new Guid(tb.Rows[0]["ghxxid"].ToString()), Convert.ToInt32(tb.Rows[0]["hzks"]), out NewFzid, out err_code, out err_text, InstanceForm.BDatabase); if (NewFzid == Guid.Empty || err_code != 0) { throw new Exception(err_text); } InstanceForm.BDatabase.CommitTransaction(); butref1_Click(sender, e); butref2_Click(sender, e); control.Text = ""; } catch (System.Exception err) { InstanceForm.BDatabase.RollbackTransaction(); throw new Exception(err.Message); } } //如果没有找到行 if (tb.Rows.Count == 0 && ksdm != 0) { DataTable tbxx = dset.Tables[1]; if (tbxx.Rows.Count == 0) { throw new Exception("没有找到这个病人的挂号信息"); } } } catch (System.Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }