private void menuItem2_Click(object sender, System.EventArgs e) { Neusoft.HISFC.Models.Base.UserText obj = this.GetSelectedObject(this.treeView1.SelectedNode); if (obj == null) { return; } if (MessageBox.Show("是否确认删除?", "警告", MessageBoxButtons.YesNo) == DialogResult.No) { return; } Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); Neusoft.HISFC.BizLogic.Manager.UserText m = new Neusoft.HISFC.BizLogic.Manager.UserText(); //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(m.Connection); //t.BeginTransaction(); //m.SetTrans(t.Trans); int i = 0; i = m.Delete(obj.ID); if (i == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(m.Err); } else { Neusoft.FrameWork.Management.PublicTrans.Commit(); MessageBox.Show("删除成功!"); this.RefreshList(); } }
/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void menuItem2_Click(object sender, System.EventArgs e) { Neusoft.HISFC.Models.Base.UserText obj = this.GetSelectedObject(this.treeView1.SelectedNode); if (obj == null) { return; } Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); //Neusoft.HISFC.Management.Manager.UserText m = new Neusoft.HISFC.Management.Manager.UserText(); //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(m.Connection); //t.BeginTransaction(); //m.SetTrans(t.Trans); int i = 0; i = Neusoft.HISFC.BizProcess.Factory.Function.IntegrateManager.DeleteUserText(obj.ID); if (i == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(Neusoft.HISFC.BizProcess.Factory.Function.IntegrateManager.Err); } else { Neusoft.FrameWork.Management.PublicTrans.Commit(); MessageBox.Show("删除成功!"); this.RefreshList(); } }
private void treeView1_ItemDrag(object sender, ItemDragEventArgs e) { if (e.Button != MouseButtons.Left) { return; } Neusoft.HISFC.Models.Base.UserText obj = this.GetSelectedObject(e.Item as TreeNode); if (obj == null) { return; } DoDragDrop(obj.Text, DragDropEffects.Copy); }
/// <summary> /// 新建立 /// </summary> /// <param name="Text"></param> /// <param name="RichText"></param> /// <returns></returns> public int Add(string Text, string RichText) { Neusoft.HISFC.Models.Base.UserText obj = new Neusoft.HISFC.Models.Base.UserText(); obj.Text = Text; obj.RichText = RichText; ucUserTextControl u = new ucUserTextControl(); u.IsShowGeneral = true; u.UserText = obj; Neusoft.FrameWork.WinForms.Classes.Function.PopShowControl(u); this.RefreshList(); return(0); }
private void menuItem1_Click_1(object sender, System.EventArgs e) { try { Neusoft.HISFC.Models.Base.UserText obj = this.GetSelectedObject(this.treeView1.SelectedNode); if (obj == null) { return; } ucUserSnomedTextControl u = new ucUserSnomedTextControl(); u.UserText = obj; Neusoft.FrameWork.WinForms.Classes.Function.PopShowControl(u); this.RefreshList(); } catch { } }
private void ucUserText_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(typeof(System.String))) //Neusoft.HISFC.Models.Base.UserText { //Neusoft.HISFC.Models.Base.UserText obj = e.Data.GetData("Neusoft.HISFC.Models.Base.UserText") as Neusoft.HISFC.Models.Base.UserText; Neusoft.HISFC.Models.Base.UserText obj = new Neusoft.HISFC.Models.Base.UserText(); string s = e.Data.GetData(DataFormats.StringFormat, true).ToString(); obj.Text = s; if (s == "") { return; } try { if (sender.GetType().ToString().IndexOf("RichTextBox") > 0) { ((RichTextBox)sender).SelectedText = obj.Text; } else if (sender.GetType().ToString().IndexOf("MultiLine") > 0) { ((RichTextBox)sender).SelectedText = obj.Text; } else if (sender.GetType() == typeof(System.Windows.Forms.TextBox)) { ((TextBox)sender).SelectedText = obj.Text; } else if (sender.GetType().ToString().IndexOf("ComboBox") > 0) { ((ComboBox)sender).SelectedText = obj.Text; } else { try { ((TextBox)sender).SelectedText = obj.Text; } catch { ((Control)sender).Text = obj.Text; } } } catch { } e.Data.SetData(""); } }
/// <summary> /// 新建立 /// </summary> /// <param name="Text"></param> /// <param name="RichText"></param> /// <returns></returns> public int Add(string Text, string RichText) { Neusoft.HISFC.Models.Base.UserText obj = new Neusoft.HISFC.Models.Base.UserText(); obj.Text = Text; obj.RichText = RichText; if (this.groupInfo != null && this.groupInfo.ID != "") { obj.Group.ID = this.groupInfo.ID; obj.Group.Name = this.groupInfo.Name; } ucUserSnomedTextControl u = new ucUserSnomedTextControl(); u.UserText = obj; Neusoft.FrameWork.WinForms.Classes.Function.PopShowControl(u); this.RefreshList(); return(0); }
/// <summary> /// 更新 /// </summary> /// <param name="obj"></param> /// <returns></returns> public int Update(Neusoft.HISFC.Models.Base.UserText obj) { string sql = "Manager.UserText.Update"; if (this.Sql.GetSql(sql, ref sql) == -1) { return(-1); } if (this.ReplaceSql(obj, ref sql) == -1) { return(-1); } if (this.ExecNoQuery(sql) <= 0) { return(-1); } return(0); }
protected int ReplaceSql(Neusoft.HISFC.Models.Base.UserText obj, ref string sql) { // '{1}', --科室编码-人员编码 // '{2}', --名称 // '{3}', --组ID // '{4}', --组Name // '{5}', --文本 // '{6}', --超级文本 // '{7}', --备注 // '{8}', --拼音 // '{9}') try { Neusoft.FrameWork.Public.String.FormatString(sql, out sql, obj.ID, obj.Code, obj.Name, obj.Group.ID, obj.Group.Name, obj.Text, obj.RichText, obj.Memo, obj.SpellCode, obj.Type.ToString()); } catch { return(-1); } return(0); }
private void treeView1_ItemDrag(object sender, ItemDragEventArgs e) { if (e.Button != MouseButtons.Left) { return; } Neusoft.HISFC.Models.Base.UserText obj = this.GetSelectedObject(e.Item as TreeNode); if (obj == null) { return; } DoDragDrop(obj.Text, DragDropEffects.Copy); TreeNode node = e.Item as TreeNode; try { manager.UpdateFrequency((node.Tag as Neusoft.HISFC.Models.Base.UserText).ID, manager.Operator.ID); }//更新不到无所谓的 catch { } }
/// <summary> /// 根据组id,类别、编码获取用户文本信息 /// </summary> /// <param name="GroupId"></param> /// <param name="Code"></param> /// <param name="Type"></param> /// <returns></returns> public ArrayList GetList(string GroupId, string Code, int Type) { string sql = "Manager.UserText.Select"; if (this.Sql.GetSql(sql, ref sql) == -1) { return(null); } try { sql = string.Format(sql, GroupId, Code, Type); } catch { return(null); } if (this.ExecQuery(sql) == -1) { return(null); } ArrayList al = new ArrayList(); while (this.Reader.Read()) { Neusoft.HISFC.Models.Base.UserText obj = new Neusoft.HISFC.Models.Base.UserText(); obj.ID = this.Reader[0].ToString(); obj.Code = this.Reader[1].ToString(); obj.Name = this.Reader[2].ToString(); obj.Group.ID = this.Reader[3].ToString(); obj.Group.Name = this.Reader[4].ToString(); obj.Text = this.Reader[5].ToString(); obj.RichText = this.Reader[6].ToString(); obj.Memo = this.Reader[7].ToString(); obj.SpellCode = this.Reader[8].ToString(); obj.Type = this.Reader[9].ToString(); al.Add(obj); } return(al); }
/// <summary> /// 设置患者信息 /// </summary> /// <param name="inpatientNo"></param> /// <param name="table"></param> public void SetPatient(string inpatientNo, string table, Neusoft.FrameWork.Management.Interface ISql) { // Neusoft.HISFC.Management.File.DataFile datafileManager = new Neusoft.HISFC.Management.File.DataFile(); this.nodeRelation.Nodes.Clear(); this.nodeNormal.Nodes.Clear(); myInpatientno = inpatientNo; myTable = table; ArrayList al = Neusoft.HISFC.BizProcess.Factory.Function.IntegrateManager.GetUserTextList("RELATION", 2);//获得常用相关信息列表 if (al == null) { MessageBox.Show(Neusoft.HISFC.BizProcess.Factory.Function.IntegrateManager.Err); return; } foreach (Neusoft.HISFC.Models.Base.UserText obj in al) { TreeNode node = new TreeNode(obj.Name); string sName = obj.Name; //去掉[] if (sName.Substring(0, 1) == "[" && sName.Substring(sName.Length - 1) == "]") { sName = sName.Substring(1, sName.Length - 2); } //获得节点数值 string sValue = Neusoft.HISFC.BizProcess.Factory.Function.IntegrateEPR.GetNodeValueFormDataStore(table, inpatientNo, sName); if (sValue == "-1") { sValue = ""; } obj.Text = sValue; try { node.ImageIndex = 1; node.SelectedImageIndex = 2; } catch { } node.Tag = obj; this.nodeRelation.Nodes.Add(node);//相关信息 } if (ISql == null) { return; } this.iSql = ISql; for (int j = 0; j < ISql.Count; j++) { Neusoft.FrameWork.Models.NeuInfo obj = ISql.GetInfo(j); Neusoft.HISFC.Models.Base.UserText objText = new Neusoft.HISFC.Models.Base.UserText(); objText.Name = obj.Name; objText.Text = obj.value; if (obj.showType.Trim() == "1" && obj.type == Neusoft.FrameWork.Models.NeuInfo.infoType.Temp) { TreeNode node = new TreeNode(obj.Name); try { node.ImageIndex = 1; node.SelectedImageIndex = 2; } catch { } node.Tag = objText; this.nodeNormal.Nodes.Add(node);//常用信息 } } }
/// <summary> /// 设置数值 /// </summary> /// <returns></returns> protected int SetValue() { if (this.textBox1.Text == "") { MessageBox.Show("请输入名称!"); return(-1); } if (this.richTextBox1.Text == "") { MessageBox.Show("请输入要保存的文本!"); return(-1); } if (myUserText == null) { myUserText = new Neusoft.HISFC.Models.Base.UserText(); } curUser = Neusoft.FrameWork.Management.Connection.Operator as Neusoft.HISFC.Models.Base.Employee; if (curUser == null || curUser.Dept.ID == "" || curUser.ID == "") { MessageBox.Show("当前用户维护不了用户文本!"); return(-1); } myUserText.Name = this.textBox1.Text; myUserText.Text = this.richTextBox1.Text; myUserText.RichText = myUserText.RichText.Replace("'", "''"); if (this.bShowGeneral) { myUserText.Type = "2"; if (this.cmb.SelectedIndex == 0) { myUserText.Code = "SIGN"; } else if (this.cmb.SelectedIndex == 1) { myUserText.Code = "WORD"; } else if (this.cmb.SelectedIndex == 2) { myUserText.Code = "RELATION"; } else { MessageBox.Show("无法定位字符类型!"); return(-1); } } else { if (this.radioButton1.Checked) { myUserText.Type = "1"; myUserText.Code = curUser.Dept.ID; } else { myUserText.Type = "0"; myUserText.Code = curUser.ID; } } try { myUserText.SpellCode = manager.Get(myUserText.Name).SpellCode; } catch { } return(0); }