/// <summary> /// 保存 /// </summary> void btnSave_Click(object sender, EventArgs e) { if (_isPrint) { //修改 本界面的 事务中插入数据 } else { //新增yzgl里面的事务中插入数据 try { myEntity.Clear(); foreach (DataRow dr in _dtKss.Rows) { //特殊级药物 if (!dr["MEMO"].ToString().Equals("3")) { continue; } Entity_KjSq entity = new Entity_KjSq(); entity.drYzInfo = dr; entity.DJID = TrasenClasses.GeneralClasses.PubStaticFun.NewGuid().ToString(); entity.INPATIENT_ID = ""; entity.baby_id = ""; entity.order_id = dr["ID"].ToString(); entity.group_id = dr["嘱号"].ToString(); entity.dept_id = InstanceForm._currentDept.DeptId.ToString(); entity.zyzd = txtZyZd.Text; entity.shyj = txtShyj.Text; entity.apply_id = InstanceForm._currentUser.EmployeeId.ToString(); entity.apply_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); entity.shr = cmbDept.SelectedValue == null ? "-1" : cmbDept.SelectedValue.ToString();//审核人未取 entity.shsj = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //申请用药理由 UcApplyInfo ucSqly = ucApplyInfos1.myCts[entity.order_id]; //1、用药目的 entity.purp_1 = ucSqly.rbtYfxyy.Checked ? "1" : ucSqly.rbtZlxyy.Checked ? "0" : ""; entity.purp_1_memo = ucSqly.rbtZlxyy.Checked ? ucSqly.txtYymdZl.Text : ""; //2、是否已送病原学检查 entity.purp_2 = ucSqly.rbtByjcYes.Checked ? "1" : ucSqly.rbtByjcNo.Checked ? "0" : ""; entity.purp_2_memo = ""; //3、是否已有细菌培养及药敏结果 entity.purp_3 = ucSqly.rbtXjpyYes.Checked ? "1" : ucSqly.rbtXjpyNo.Checked ? "0" : ""; entity.purp_3_memo = ucSqly.rbtXjpyYes.Checked ? ucSqly.txtByj.Text : ""; //4、所申请药物是否对该病原菌敏感 entity.purp_4 = ucSqly.rbtYjmgYes.Checked ? "1" : ucSqly.rbtYjmgNo.Checked ? "0" : ""; entity.purp_4_memo = ""; //5、其他 entity.purp_5_memo = ucSqly.txtMemo.Text; myEntity.Add(dr["ID"].ToString(), entity); #region "sql" // string strSql = string.Format(@"insert into zy_kss_sqb(DJID // INPATIENT_ID // baby_id // order_id // group_id // dept_id // zyzd // shyj // apply_id // apply_time // shr // shsj // purp_1 // purp_1_memo // purp_2 // purp_2_memo // purp_3 // purp_3_memo // purp_4 // purp_4_memo // purp_5_memo) VALUES // ('{0}','{1}',{2},'{3}','{4}','{5}',{6},'{7}','{8}','{9}',{10},'{11}','{12}','{13}',{14},'{15}','{16}','{17}',{18},'{19}','{20}')", // entity.DJID, entity.INPATIENT_ID, entity.baby_id, entity.order_id, entity.group_id, entity.dept_id, entity.zyzd, entity.shyj, entity.apply_id, entity.apply_time, // entity.shr, entity.shsj, entity.purp_1, entity.purp_1_memo, entity.purp_2, entity.purp_2_memo, entity.purp_3, entity.purp_3_memo, entity.purp_4, entity.purp_4_memo, entity.purp_5_memo); #endregion } _isOk = true; if (MessageBox.Show("操作成功,是否打印!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { btnPrint_Click(null, null); } } catch { _isOk = false; MessageBox.Show("操作失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } }
private DataTable DoGetPrintData() { try { if (_dtKss.Rows.Count <= 0) { return(null); } DataTable dtPrint = new DataTable(); dtPrint.Columns.Add("zyh", typeof(string)); dtPrint.Columns.Add("age", typeof(string)); dtPrint.Columns.Add("name", typeof(string)); dtPrint.Columns.Add("sex", typeof(string)); dtPrint.Columns.Add("bed", typeof(string)); dtPrint.Columns.Add("zyzd", typeof(string)); dtPrint.Columns.Add("mc", typeof(string)); dtPrint.Columns.Add("yf", typeof(string)); dtPrint.Columns.Add("gg", typeof(string)); dtPrint.Columns.Add("num", typeof(string)); dtPrint.Columns.Add("yfxyy", typeof(string)); dtPrint.Columns.Add("zlxyy", typeof(string)); dtPrint.Columns.Add("grzd", typeof(string)); dtPrint.Columns.Add("byjcyes", typeof(string)); dtPrint.Columns.Add("byjcno", typeof(string)); dtPrint.Columns.Add("ymjgyes", typeof(string)); dtPrint.Columns.Add("ymjgno", typeof(string)); dtPrint.Columns.Add("byj", typeof(string)); dtPrint.Columns.Add("byjmgyes", typeof(string)); dtPrint.Columns.Add("byjmgno", typeof(string)); dtPrint.Columns.Add("memo", typeof(string)); dtPrint.Columns.Add("applyer", typeof(string)); dtPrint.Columns.Add("kszr", typeof(string)); dtPrint.Columns.Add("sqrq", typeof(string)); dtPrint.Columns.Add("shyj", typeof(string)); foreach (KeyValuePair <string, Entity_KjSq> kvp in myEntity) { DataRow dr = dtPrint.NewRow(); Entity_KjSq entity = kvp.Value; string id = kvp.Key; string grpId = entity.group_id; DataTable dtGrp = dataGrid_LongOrder.DataSource as DataTable; dr["gg"] = entity.drYzInfo["单位"]; for (int i = 0; i < dtGrp.Rows.Count; i++) { if (id.Equals(dtGrp.Rows[i]["ID"].ToString())) { if (dtGrp.Columns.Contains("规格")) { dr["gg"] = dtGrp.Rows[i]["规格"].ToString(); } } if (dtGrp.Rows[i]["嘱号"].ToString().Equals(grpId)) { if (!dtGrp.Rows[i]["用法"].ToString().Trim().Equals("")) { dr["yf"] = dtGrp.Rows[i]["用法"].ToString().Trim(); } } } dr["zyh"] = _patientInfo.lbID.Text; dr["age"] = _patientInfo.lbAge.Text; dr["name"] = _patientInfo.lbName.Text; dr["sex"] = _patientInfo.lbSex.Text; dr["bed"] = _patientInfo.lbBed.Text; dr["zyzd"] = txtZyZd.Text; dr["mc"] = entity.drYzInfo["医嘱内容"]; dr["num"] = entity.drYzInfo["剂量"]; dr["yfxyy"] = entity.purp_1.Equals("1") ? "√" : ""; dr["zlxyy"] = entity.purp_1.Equals("0") ? "√" : ""; dr["grzd"] = entity.purp_1_memo; dr["byjcyes"] = entity.purp_2.Equals("1") ? "√" : ""; dr["byjcno"] = entity.purp_2.Equals("0") ? "√" : ""; dr["ymjgyes"] = entity.purp_3.Equals("1") ? "√" : ""; dr["ymjgno"] = entity.purp_3.Equals("0") ? "√" : ""; dr["byj"] = entity.purp_3_memo; dr["byjmgyes"] = entity.purp_4.Equals("1") ? "√" : ""; dr["byjmgno"] = entity.purp_4.Equals("0") ? "√" : ""; dr["memo"] = entity.purp_5_memo; dr["applyer"] = txtSqYs.Text; dr["kszr"] = cmbDept.Text; dr["sqrq"] = dtpDate.Value.ToString("yyyy年MM月dd日"); dr["shyj"] = txtShyj.Text; dtPrint.Rows.Add(dr); } return(dtPrint); } catch { return(null); } }
private void FrmKssSpecialApply_Load(object sender, EventArgs e) { //绑定主任医生 try { string sql = string.Format(@"select distinct b.py_code 拼音码, b.name as 姓名, b.wb_code 五笔码,a.doc_id 数字码,b.employee_id from jc_role_doctor a ,jc_employee_property b,jc_EMP_DEPT_ROLE c where a.employee_id=b.employee_id and c.employee_id=b.employee_id and c.dept_id='{0}' and b.delete_bit=0", InstanceForm._currentDept.DeptId); DataTable dt = InstanceForm._database.GetDataTable(sql); cmbDept.DataSource = dt; cmbDept.DisplayMember = "姓名"; cmbDept.ValueMember = "employee_id"; cmbDept.SelectedIndex = 0; } catch { } try { txtZyZd.ReadOnly = false; dataGrid_LongOrder.ReadOnly = true; //初始化申请用药目的控件 ucApplyInfos1.DoIniCt(_dtKss); lblDept.Text = InstanceForm._currentDept.DeptName; txtXm.Text = _patientInfo.lbName.Text; txtZyh.Text = _patientInfo.lbID.Text; txtNn.Text = _patientInfo.lbAge.Text; txtXb.Text = _patientInfo.lbSex.Text; txtCh.Text = _patientInfo.lbBed.Text; txtZyZd.Text = _patientInfo.lbRYZD.Text; txtSqYs.Text = InstanceForm._currentUser.Name; //dataGridView1.DataSource = _dtKss; InitGrd_LongOrder(); //长期医嘱网格 loadGrid_LongOrder(); } catch { } try { //如果是打印界面 if (_isPrint) { myEntity.Clear(); foreach (DataRow dr in _dtKss.Rows) { //特殊级药物 if (!dr["MEMO"].ToString().Equals("3")) { continue; } string id = dr["ID"].ToString(); string grpId = "";// dr[""].ToString(); if (_dtKss.Columns.Contains("嘱号")) { grpId = dr["嘱号"].ToString(); } else if (_dtKss.Columns.Contains("group_id".ToUpper())) { grpId = dr["group_id".ToUpper()].ToString(); } //申请用药理由 UcApplyInfo ucSqly = ucApplyInfos1.myCts[id]; //查询初始化给控件赋值 ucSqly.rbtYfxyy.Checked = dr["purp_1".ToUpper()].ToString().Equals("1"); ucSqly.rbtZlxyy.Checked = dr["purp_1".ToUpper()].ToString().Equals("0"); ucSqly.txtYymdZl.Text = dr["purp_1_memo".ToUpper()].ToString(); ucSqly.rbtByjcYes.Checked = dr["purp_2".ToUpper()].ToString().Equals("1"); ucSqly.rbtByjcNo.Checked = dr["purp_2".ToUpper()].ToString().Equals("0"); ucSqly.rbtXjpyYes.Checked = dr["purp_3".ToUpper()].ToString().Equals("1"); ucSqly.rbtXjpyNo.Checked = dr["purp_3".ToUpper()].ToString().Equals("0"); ucSqly.txtByj.Text = dr["purp_3_memo".ToUpper()].ToString(); ucSqly.rbtYjmgYes.Checked = dr["purp_4".ToUpper()].ToString().Equals("1"); ucSqly.rbtYjmgNo.Checked = dr["purp_4".ToUpper()].ToString().Equals("0"); ucSqly.txtMemo.Text = dr["purp_5_memo".ToUpper()].ToString(); //打印界面初始化参数变量 Entity_KjSq entity = new Entity_KjSq(); entity.drYzInfo = dr; entity.order_id = id; entity.group_id = grpId; //1、用药目的 entity.purp_1 = ucSqly.rbtYfxyy.Checked ? "1" : ucSqly.rbtZlxyy.Checked ? "0" : ""; entity.purp_1_memo = ucSqly.rbtZlxyy.Checked ? ucSqly.txtYymdZl.Text : ""; //2、是否已送病原学检查 entity.purp_2 = ucSqly.rbtByjcYes.Checked ? "1" : ucSqly.rbtByjcNo.Checked ? "0" : ""; entity.purp_2_memo = ""; //3、是否已有细菌培养及药敏结果 entity.purp_3 = ucSqly.rbtXjpyYes.Checked ? "1" : ucSqly.rbtXjpyNo.Checked ? "0" : ""; entity.purp_3_memo = ucSqly.rbtXjpyYes.Checked ? ucSqly.txtByj.Text : ""; //4、所申请药物是否对该病原菌敏感 entity.purp_4 = ucSqly.rbtYjmgYes.Checked ? "1" : ucSqly.rbtYjmgNo.Checked ? "0" : ""; entity.purp_4_memo = ""; //5、其他 entity.purp_5_memo = ucSqly.txtMemo.Text; myEntity.Add(dr["ID"].ToString(), entity); } } } catch { } }