private void Note_Click(object sender, RoutedEventArgs e) { if (null == patient) { BLPublic.Dialogs.Alert("请先选择病人."); return; } WinInput input = new WinInput(); input.Owner = AppConst.winMain; input.inputLong("记录", "输入笔记", (_txt) => { int noteID = 0; if (AppConst.db.InsertAndGetId(string.Format(SQL.ADD_PM_NOTE, patient.PatientCode, BLPublic.DBOperate.ACS(_txt), AppConst.LoginEmpCode), out noteID)) { addNote(noteID, _txt); return(true); } else { BLPublic.Dialogs.Error("保存笔记失败:" + AppConst.db.Error); } return(false); }); input.ShowDialog(); input = null; }
private void miModOp_Click(object sender, RoutedEventArgs e) { if (null == lbOpRecord.SelectedItem) { BLPublic.Dialogs.Alert("请选择要修改的记录."); lbOpRecord.Focus(); return; } DataRowView dv = (DataRowView)lbOpRecord.SelectedItem; string typeCode = dv["OpType"].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["OpID"].ToString()))) { dv["OpContent"] = _txt; lbOpRecord.Items.Refresh(); return(true); } else { BLPublic.Dialogs.Error("保存笔记失败:" + AppConst.db.Error); } return(false); }, dv["OpContent"].ToString()); input.ShowDialog(); input = null; } else if ("custody".Equals(typeCode)) { WinCustodyEdit.TPNCustodyIntervene(Convert.ToInt32(dv["OpID"].ToString()), false, (id, objStr, desc) => { dv["OpContent"] = objStr + "\r\n" + desc; lbOpRecord.Items.Refresh(); }); } else if ("intervene".Equals(typeCode)) { WinCustodyEdit.TPNCustodyIntervene(Convert.ToInt32(dv["OpID"].ToString()), true, (id, objStr, desc) => { dv["OpContent"] = objStr + "\r\n" + desc; lbOpRecord.Items.Refresh(); }); } }
public static string getInput(Window _parent, string _title, string _tip, string _def = "", int _maxLen = 50) { WinInput win = new WinInput(); win.Owner = _parent; win.Title = _title; win.txtTip.Text = _tip; win.txtInput.MaxLength = _maxLen; win.txtInput.Text = _def; if (true == win.ShowDialog()) { return(win.txtInput.Text.Trim()); } else { return(null); } }
private void btnSet_Click(object sender, RoutedEventArgs e) { if (null == lvItem.SelectedItem) { BLPublic.Dialogs.Alert("请选择要设置的项目."); return; } tpnmonitor.TPNItem item = (tpnmonitor.TPNItem)lvItem.SelectedItem; string input = WinInput.getInput(this, "TPN项目关联", "请输入关联的检查项目编码", item.Value); if (null == input) { return; } if (!string.IsNullOrWhiteSpace(input)) { input = "[" + input + "]"; } if (AppConst.db.ExecSQL(string.Format(SQL.SET_TPNTEIM_EXP, input, item.ID))) { DataRow row = this.tblTPNItem.Rows.Find(item.ID); if (null != row) { row["Express"] = input; } item.Value = input; lvItem.Items.Refresh(); BLPublic.Dialogs.Info("设置成功."); } 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(); } }