/// <summary> /// 显示监护/干预界面 /// </summary> /// <param name="_pCode"></param> /// <param name="_isIntervene"></param> /// <param name="_onOK"></param> /// <returns></returns> private static bool TPNCustodyIntervene(int _editID, string _pCode, bool _isIntervene, Action <int, string, string> _onOK) { if (!chkWin(_isIntervene)) { return(false); } ICustodyEdit win = null; if (_isIntervene) { win = new WinInterveneEdit(); } else { win = new WinCustodyEdit(); } ((Window)win).Owner = AppConst.winMain; if (0 < _editID) { win.EditID = _editID; } else { win.init(_pCode, null); } win.OnEnd = (isOK) => { WinCustodyEdit.OnSetObject = null; if (isOK && (null != _onOK)) { _onOK(win.EditID, win.getObjectStr(), win.getDesc()); } }; ((Window)win).Topmost = true; ((Window)win).Show(); WinCustodyEdit.IsIntervene = _isIntervene; WinCustodyEdit.OnSetObject = (type, objcode, objname, objvalue, valtime) => { win.setObject(type, objcode, objname, objvalue, valtime); }; return(true); }
/// <summary> /// 加载干预记录 /// </summary> private void loadIntervene() { DataTable tbl = null; if (AppConst.db.GetRecordSet(string.Format(SQL.SEL_INTERVENE_BYPNT, this.patient.PatientCode), ref tbl)) { BLPublic.BLDataReader bldr = new BLPublic.BLDataReader(tbl.CreateDataReader()); while (bldr.next()) { addIntervene(bldr.getInt("InterveneID"), WinInterveneEdit.getObjectStr(bldr.getInt("InterveneID")), bldr.getString("IntervenePlan"), bldr.getDateTime("InterveneTime"), bldr.getString("Intervener")); } bldr.close(); tbl.Clear(); } else { BLPublic.Dialogs.Error("加载干预记录失败:" + AppConst.db.Error); } }
/// <summary> /// 加载干预 /// </summary> private void loadIntervene() { string sql = ""; if (true == cbAllPatient.IsChecked) { sql = string.Format(SQL.SEL_INTERVENE_BYDATE, ((DateTime)dpSDate.SelectedDate).ToString("yyyy-MM-dd"), ((DateTime)dpEDate.SelectedDate).AddDays(1).ToString("yyyy-MM-dd")); } else if (null == this.patient) { return; } else { sql = string.Format(SQL.SEL_INTERVENE_BYPNT2, this.patient.PatientCode); } IDataReader dr = null; if (AppConst.db.GetRecordSet(sql, ref dr, true)) { BLPublic.BLDataReader bldr = new BLPublic.BLDataReader(dr); string content = ""; while (bldr.next()) { content = WinInterveneEdit.getObjectStr(bldr.getInt("InterveneID")) + ". " + bldr.getString("IntervenePlan"); this.tblOpRecord.Rows.Add(new object[] { "intervene", bldr.getInt("InterveneID"), bldr.getString("DeptName"), bldr.getString("BedNo"), bldr.getString("PatientName"), bldr.getDateTime("InterveneTime"), content, ComClass.getEmpName(bldr.getString("Intervener")) }); } dr.Close(); } else { BLPublic.Dialogs.Error("加载干预失败:" + AppConst.db.Error); } }
private void btnMod_Click(object sender, RoutedEventArgs e) { if (null == lvRecord.SelectedItem) { BLPublic.Dialogs.Alert("请选择要修改的记录."); lvRecord.Focus(); return; } DataRowView dv = (DataRowView)lvRecord.SelectedItem; string typeCode = dv["TypeCode"].ToString(); if ("note".Equals(typeCode)) { WinInput input = new WinInput(); input.Owner = AppConst.winMain; input.inputLong("笔记", "修改笔记", (_txt) => { if (AppConst.db.ExecSQL(string.Format(SQL.MOD_PM_NOTE, BLPublic.DBOperate.ACS(_txt), dv["ID"].ToString()))) { dv["Content"] = _txt; lvRecord.Items.Refresh(); return(true); } else { BLPublic.Dialogs.Error("保存笔记失败:" + AppConst.db.Error); } return(false); }, dv["Content"].ToString()); input.ShowDialog(); input = null; } else if ("custody".Equals(typeCode)) { if (dv["Content"].ToString().Contains("已完成")) { BLPublic.Dialogs.Alert("已完成监护,不可修改."); return; } WinCustodyEdit win = new WinCustodyEdit(); win.Owner = AppConst.winMain; win.EditID = Convert.ToInt32(dv["ID"].ToString()); win.OnEnd = (isOK) => { if (isOK) { dv["Content"] = win.getObjectStr() + "." + win.txtCustodyDesc.Text.Trim(); lvRecord.Items.Refresh(); } }; win.Topmost = true; win.Show(); } else if ("intervene".Equals(typeCode)) { WinInterveneEdit win = new WinInterveneEdit(); win.Owner = AppConst.winMain; win.EditID = Convert.ToInt32(dv["ID"].ToString()); win.OnEnd = (isOK) => { if (isOK) { dv["Content"] = win.getObjectStr() + "." + win.txtInterveneDesc.Text.Trim(); lvRecord.Items.Refresh(); } }; win.Topmost = true; win.Show(); } }