private void form_SelectedItem(Neusoft.FrameWork.Models.NeuObject sender) { try { Neusoft.HISFC.Models.Base.Employee p = sender as Neusoft.HISFC.Models.Base.Employee; if (p != null) { this.employee = p; Neusoft.HISFC.BizLogic.Manager.Spell sm = new Neusoft.HISFC.BizLogic.Manager.Spell(); if (this.txtLoginID.Text == "") { if (p.ID != "") { this.txtLoginID.Text = p.ID; } else { this.txtLoginID.Text = sm.Get(p.Name).SpellCode; } } this.txtName.Text = p.Name; this.employee.User01 = this.txtLoginID.Text; } } catch { } }
/// <summary> /// 获取指定行的公司名称拼音码/五笔码信息 /// </summary> /// <param name="iRow">指定行名称</param> /// <returns></returns> private int GetSpell(int iRow) { if (this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnSet.ColName].Text.ToString() == "") { return(1); } Neusoft.HISFC.Models.Base.Spell spCode = new Neusoft.HISFC.Models.Base.Spell(); Neusoft.HISFC.BizLogic.Manager.Spell spellManager = new Neusoft.HISFC.BizLogic.Manager.Spell(); spCode = (Neusoft.HISFC.Models.Base.Spell)spellManager.Get(this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnSet.ColName].Text.ToString()); if (spCode != null && spCode.SpellCode != null) { if (spCode.SpellCode.Length > 10) { spCode.SpellCode = spCode.SpellCode.Substring(0, 10); } if (spCode.WBCode.Length > 10) { spCode.WBCode = spCode.WBCode.Substring(0, 10); } this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnSet.ColSpell].Value = spCode.SpellCode; this.neuSpread1_Sheet1.Cells[iRow, (int)ColumnSet.ColWB].Value = spCode.WBCode; } return(1); }
/// <summary> /// 初始化 /// </summary> private void Init() { this.ImageList = this.imageList1; this.HideSelection = false; try { if (this.IsShowContextMenu == true)//显示属性 { // 加入右键菜单 by zlw 2006-5-1 System.Windows.Forms.ContextMenu cmPatientPro = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem miPatientPro = new System.Windows.Forms.MenuItem(); #region addby xuewj 2010-9-28 查询患者费用明细 {98057398-9233-4aec-8FAF-662A8E82BF74} System.Windows.Forms.MenuItem miPatientFeeQuery = new System.Windows.Forms.MenuItem(); cmPatientPro.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { miPatientPro, miPatientFeeQuery }); #endregion miPatientPro.Text = "查看患者信息"; miPatientFeeQuery.Text = "查看患者费用明细";//addby xuewj 2010-9-28 查询患者费用明细 {98057398-9233-4aec-8FAF-662A8E82BF74} this.ContextMenu = cmPatientPro; miPatientPro.Click += new System.EventHandler(this.miPatientPro_Click); miPatientFeeQuery.Click += new EventHandler(miPatientFeeQuery_Click); } Neusoft.HISFC.BizLogic.Manager.Spell dataBase = new Neusoft.HISFC.BizLogic.Manager.Spell(); this.dtToday = dataBase.GetDateTimeFromSysDateTime(); this.InitInterface(); } catch { this.dtToday = DateTime.Today; } }
private void tbItemName_TextChanged(object sender, EventArgs e) { //各种码获得 Neusoft.HISFC.BizLogic.Manager.Spell spell = new Neusoft.HISFC.BizLogic.Manager.Spell(); Neusoft.HISFC.Models.Base.ISpell ispell = spell.Get(this.tbItemName.Text); //将拼音码和五笔码取前8位到界面,保存的时候也是8位 if (ispell == null) { this.tbSpellCode.Text = ""; return; } if (ispell.SpellCode != null && ispell.SpellCode.Length > 8) { this.tbSpellCode.Text = ispell.SpellCode.Substring(0, 8); } else { this.tbSpellCode.Text = ispell.SpellCode; } if (ispell.SpellCode != null && ispell.WBCode.Length > 8) { this.tbWbCode.Text = ispell.WBCode.Substring(0, 8); } else { this.tbWbCode.Text = ispell.WBCode; } }
protected override bool ProcessDialogKey(Keys keyData) { if (this.fpStorage.ContainsFocus) { if (keyData == Keys.Enter) { if (this.fpStorage_Sheet1.ActiveColumnIndex == 2) { Neusoft.HISFC.Models.Base.Spell spCode = new Neusoft.HISFC.Models.Base.Spell(); Neusoft.HISFC.BizLogic.Manager.Spell mySpell = new Neusoft.HISFC.BizLogic.Manager.Spell(); spCode = (Neusoft.HISFC.Models.Base.Spell)mySpell.Get(fpStorage_Sheet1.Cells[this.fpStorage_Sheet1.ActiveRowIndex, 2].Text.ToString()); if (spCode.SpellCode.Length > 10) { spCode.SpellCode = spCode.SpellCode.Substring(0, 10); } if (spCode.WBCode.Length > 10) { spCode.WBCode = spCode.WBCode.Substring(0, 10); } this.fpStorage_Sheet1.Cells[this.fpStorage_Sheet1.ActiveRowIndex, 3].Value = spCode.SpellCode; this.fpStorage_Sheet1.Cells[this.fpStorage_Sheet1.ActiveRowIndex, 4].Value = spCode.WBCode; } this.fpStorage_Sheet1.ActiveColumnIndex++; } } return(base.ProcessDialogKey(keyData)); }
/// <summary> /// 过滤 /// </summary> /// <returns></returns> protected int Filter() { if (ds.Tables.Count <= 0) { return(-1); } string strPID = null; string strNM = null; string stPY = null; strPID = Neusoft.FrameWork.Public.String.TakeOffSpecialChar(this.ntbPatientID.Text.Trim()); strNM = Neusoft.FrameWork.Public.String.TakeOffSpecialChar(this.ntbPatientNM.Text.Trim()); Neusoft.HISFC.BizLogic.Manager.Spell spellManager = new Neusoft.HISFC.BizLogic.Manager.Spell(); Neusoft.HISFC.Models.Base.ISpell spell = spellManager.Get(strNM); stPY = spell.SpellCode; try { ds.Tables[0].DefaultView.RowFilter = "住院号 like '%" + strPID + "%' AND 姓名 like '%" + stPY + "%'"; } catch (Exception ex) { MessageBox.Show("查询失败!" + ex.Message); return(-1); } return(1); }
private void neuSpread1_LeaveCell(object sender, LeaveCellEventArgs e) { if (e.Column == 3) { if (neuSpread1_Sheet1.Cells[e.Row, 3].Text.ToString() == "") { return; } Neusoft.HISFC.Models.Base.Spell spCode = new Neusoft.HISFC.Models.Base.Spell(); Neusoft.HISFC.BizLogic.Manager.Spell mySpell = new Neusoft.HISFC.BizLogic.Manager.Spell(); spCode = (Neusoft.HISFC.Models.Base.Spell)mySpell.Get(neuSpread1_Sheet1.Cells[e.Row, 3].Text.ToString()); if (spCode.SpellCode.Length > 10) { spCode.SpellCode = spCode.SpellCode.Substring(0, 10); } if (spCode.WBCode.Length > 10) { spCode.WBCode = spCode.WBCode.Substring(0, 10); } this.neuSpread1_Sheet1.Cells[e.Row, 4].Value = spCode.SpellCode; this.neuSpread1_Sheet1.Cells[e.Row, 5].Value = spCode.WBCode; } }
private void tbItemName_KeyDown(object sender, KeyEventArgs e) { //各种码获得 Neusoft.HISFC.BizLogic.Manager.Spell spell = new Neusoft.HISFC.BizLogic.Manager.Spell(); Neusoft.HISFC.Models.Base.ISpell ispell = spell.Get(this.tbItemName.Text); this.tbSpellCode.Text = ispell.SpellCode; this.tbWbCode.Text = ispell.WBCode; }
/// <summary> /// 初始化Dataset /// </summary> /// <param name="al"></param> private void AddToDataSet(ArrayList al) { Neusoft.HISFC.Models.Base.Spell spellobj = new Neusoft.HISFC.Models.Base.Spell( ); Neusoft.HISFC.BizLogic.Manager.Spell spell = new Neusoft.HISFC.BizLogic.Manager.Spell( ); if (al.Count <= 0) { return; } Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm(Neusoft.FrameWork.Management.Language.Msg("正在检索数据.请稍候...")); Application.DoEvents(); for (int i = 0; i < al.Count; i++) { Neusoft.FrameWork.Models.NeuObject obj = new Neusoft.FrameWork.Models.NeuObject( ); obj = (Neusoft.FrameWork.Models.NeuObject)al[i]; spellobj = spell.Get(obj.Name) as Neusoft.HISFC.Models.Base.Spell; if (spellobj == null) { Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg(obj.Name + " 自动生成该科拼音码时发生错误." + obj.ID + "科室")); continue; } //{BB505126-A265-4c62-9392-30D99503E36E} //替换obj.User01.tostring() 为 Neusoft.FrameWork.Function.NConvert.ToDateTime(obj.User01).ToLongTimeString() string[] key = { obj.ID, obj.User03 + this.objHelper.GetName(obj.User03), Neusoft.FrameWork.Function.NConvert.ToDateTime(obj.User01).ToLongTimeString() }; if (this.ds.Tables[0].Rows.Find(key) != null) { Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg(obj.Name + "该科已存在 不能重复添加" + obj.ID + "该科室")); continue; } this.ds.Tables[0].Rows.Add(new object[] { obj.ID, //取药科室编码 obj.Name, //取药科室名称 obj.User03 + this.objHelper.GetName(obj.User03), //药品类型 Neusoft.FrameWork.Function.NConvert.ToDateTime(obj.User01).ToLongTimeString(), //开始时间 Neusoft.FrameWork.Function.NConvert.ToDateTime(obj.User02).ToLongTimeString(), //结束时间 obj.Memo, //备注 spellobj.SpellCode.Length > 10 ? spellobj.SpellCode.Substring(0, 10):spellobj.SpellCode, //拼音码保留十位 spellobj.WBCode.Length > 10 ? spellobj.WBCode.Substring(0, 10):spellobj.WBCode //五笔码保留十位 }); } Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); this.ds.Tables[0].AcceptChanges( ); this.SetFp( ); }
/// <summary> /// .自动生成拼音码和五笔码 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtName_Leave(object sender, EventArgs e) { if (this.txtName.Text.IndexOfAny(new char[] { '@', '.', ',', '!', '-', '#', '$', '%', '^', '&', '*', '[', ']', '|', '}', '\'', '?' }) != -1) { MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("无效的药理作用名称.\n" + "无效字符: '@', '.', ',', '!', '-', '#', '$', '%', '^', '&', '*', '[', ']', '|', '}','\'','?'")); this.txtName.Focus(); this.txtName.SelectAll(); return; } Neusoft.HISFC.Models.Base.Spell spellobj = new Neusoft.HISFC.Models.Base.Spell( ); Neusoft.HISFC.BizLogic.Manager.Spell spell = new Neusoft.HISFC.BizLogic.Manager.Spell( ); spellobj = spell.Get(this.txtName.Text.Trim()) as Neusoft.HISFC.Models.Base.Spell; this.txtSpellCode.Text = spellobj.SpellCode; this.txtWBCode.Text = spellobj.WBCode; }
/// <summary> /// 生成拼音码 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void textICDName_Leave(object sender, System.EventArgs e) { try { //生成 拼音码 //定义 实例化 业务类 Neusoft.HISFC.BizLogic.Manager.Spell mySpell = new Neusoft.HISFC.BizLogic.Manager.Spell(); //声明 实例化实体类 Neusoft.HISFC.Models.Base.Spell spCode = new Neusoft.HISFC.Models.Base.Spell(); //查询 spCode = (Neusoft.HISFC.Models.Base.Spell)mySpell.Get(textICDName.Text); //出错返回 if (spCode.SpellCode == null) { return; } //判断是否超长 if (spCode.SpellCode.Length > 8) { spCode.SpellCode = spCode.SpellCode.Substring(0, 8); } //判断是否超长 if (spCode.WBCode.Length > 8) { spCode.WBCode = spCode.WBCode.Substring(0, 8); } if (textSpellCode.Text == "") { //赋值 textSpellCode.Text = spCode.SpellCode; //拼音码 } if (WBCode.Text == "") { WBCode.Text = spCode.WBCode; //五笔码 } } catch (Exception ex) { MessageBox.Show(ex.Message); } }