/// <summary> /// 设置消息状态 /// </summary> /// <param name="IsDeal"></param> /// <param name="EmployeeId"></param> /// <param name="IpAddress"></param> public void SetStatus(bool IsDeal, int EmployeeId, string IpAddress) { //0,未处理,1、仅标记为已读,2、已做处理 string sql = "update pub_message_record set DealStatus = {0},FirstReader={1},ReadTime=getdate(),ReadByIP = '{2}' where MsgId = '{3}'"; sql += " and FirstReader=0 and ReadTime is null and ReadByIP=''"; if (IsDeal) { sql = string.Format(sql, 2, EmployeeId, IpAddress, this.messageId.ToString()); } else { sql = string.Format(sql, 1, EmployeeId, IpAddress, this.messageId.ToString()); } try { RelationalDatabase database = new TrasenClasses.DatabaseAccess.MsSqlServer(); database.Initialize(WorkStaticFun.GetConnnectionString_Default(ConnectionType.SQLSERVER)); database.Open(); database.DoCommand(sql); database.Close(); } catch (Exception error) { FrmMdiMain.WriteFrameLocalLog(new string[] { "更改消息状态失败!", error.Message, error.StackTrace }, true); } }
public static void GetForm(string dllName, string functionName, string chineseName, long userID, long deptID, object[] communicateValue, bool showType) { try { User _user_id = new User(Convert.ToInt32(userID), InstanceForm.BDatabase); Department _dept_id = new Department(Convert.ToInt32(deptID), InstanceForm.BDatabase); //获得DLL中窗体 Form _dllform = (Form)WorkStaticFun.InstanceForm(dllName, functionName, chineseName, _user_id, _dept_id, null, InstanceForm.BDatabase, ref communicateValue); _dllform.StartPosition = FormStartPosition.CenterScreen; if (showType) { _dllform.ShowDialog(); } else { _dllform.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace.ToString()); return; } finally { //for (int i = 0; i < 10; i++) openForm[i] = Guid.Empty; //将已经打开的医嘱管理窗体进行初始化,如果没有这句话,在关闭医嘱窗体后再打开则会提示该医嘱窗体已经打开 } }
private void GetForm(string dllName, string functionName, string chineseName, long userID, long deptID, object[] communicateValue, bool showType) { try { User _user = new User(Convert.ToInt32(userID), FrmMdiMain.Database); Department _dept = new Department(Convert.ToInt32(deptID), FrmMdiMain.Database); //获得DLL中窗体 Form _dllform = (Form)WorkStaticFun.InstanceForm(dllName, functionName, chineseName, _user, _dept, null, FrmMdiMain.Database, ref communicateValue); _dllform.StartPosition = FormStartPosition.CenterScreen; if (showType) { _dllform.ShowDialog(); } else { _dllform.Show(); } Cursor = Cursors.Default; } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace.ToString()); Cursor = Cursors.Default; return; } finally { } }
/* * // private void cmbSS_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) * // { * // if(e.KeyValue==13) * // { * // cmbSS.DroppedDown=false; * // if(isTab==true) * // { * // isTab=false; * // SendKeys.Send("{tab}"); * // } * // else isTab=true; * // } * // else isTab=false; * // } * // * // private void cmbSS_TextChanged(object sender, System.EventArgs e) * // { * // if(isDown) return; * // try * // { * // if(cmbSS.Text.Trim()=="")return; * // DataRow[] dr=myTb.Select("py_code like '"+cmbSS.Text.Trim()+"%'","py_code"); * // cmbSS.Items.Clear(); * // for(int j=0;j<dr.Length;j++) * // { * // cmbSS.Items.Add(dr[j]["NAME"]); * // } * // if( cmbSS.Items.Count>0 ) * // { * // cmbSS.SelectionStart=cmbSS.Text.Length; * // cmbSS.DroppedDown=true; * // } * // else * // { * // cmbSS.Select(cmbSS.Text.Trim().Length-1,1); * // cmbSS.DroppedDown=false; * // } * // * // } * // catch(System.Exception err) * // { * // err.ToString(); * // } * // } * // * // private void cmbSS_SelectionChangeCommitted(object sender, System.EventArgs e) * // { * //// SendKeys.Send("{tab}"); * // * // } * // public void ComboBox_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) * // { * // ComboBox cmb=(ComboBox)sender; * // int iSelectRow=-1; * // if(e.KeyValue>=32 && e.KeyValue<=127) * // { * // string strSelect=cmb.Text.Trim(); * // if(strSelect=="")return; * // iSelectRow=cmb.FindString(strSelect); * // if(iSelectRow>=0) * // { * // cmb.SelectionStart=strSelect.Length; * // cmb.SelectionLength=cmb.Text.Length-strSelect.Length; * // cmb.DroppedDown=true; * // } * // } * // if(e.KeyValue==13 && iSelectRow>=0) * // { * // cmb.SelectedIndex=iSelectRow; * // cmb.DroppedDown=false; * // } * // } * // * // private void cmbSS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) * // { * // if(e.KeyData==Keys.Down || e.KeyData==Keys.Up) isDown=true; * // else isDown=false; * // * // } */ private void ComboBox_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { cmb = (ComboBox)sender; bool respondKey = true; DataRow dr = null; if (cmb.Name == "cmbExplain") { dr = WorkStaticFun.GetCardData(cmb, e.KeyValue, 1, dGrid_Sel, 0, ds, "explain", FilterType.智能, SearchType.前导相似, ref respondKey, "", false); } else { dr = WorkStaticFun.GetCardData(cmb, e.KeyValue, 1, dGrid_Sel, 1, ds, "ss", FilterType.智能, SearchType.前导相似, ref respondKey, "", false); } if (dr != null && respondKey) { if (gBoxExplain.Enabled == true) { default_usage = dr["CODE"].ToString().Trim(); } cmb.Text = dr["name"].ToString().Trim(); } if (e.KeyValue == 13) { btOK.Focus(); } }
private void btnRelease_Click(object sender, EventArgs e) { bool success = false; if (lvwReciveList.Items.Count == 0) { MessageBox.Show("没有指定通知消息的接收对象!", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } //add by wangzhi 2010-10-19 if (ALLOW_RELEASE_ALLSERVER == false) { if (FrmMdiMain.Jgbm != Convert.ToInt32(cmbJgbm.SelectedValue)) { MessageBox.Show("你没有向所有服务器发布消息的权限,请重新选择服务器", "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } //end add if (operatorType == 0) { //Modify By Tany 2010-08-23 根据机构编码循环保存或更新 string sql = "select * from jc_jgbm where jgbm=" + cmbJgbm.SelectedValue.ToString() + " or " + cmbJgbm.SelectedValue.ToString().Trim() + "=-1"; DataTable tb = dataBase.GetDataTable(sql); for (int i = 0; i < tb.Rows.Count; i++) { dataBase = WorkStaticFun.GetJgbmDb(Convert.ToInt32(tb.Rows[i]["jgbm"])); success = SaveMessage(); TrasenClasses.GeneralClasses.FrameEnvironment fEvt = (TrasenClasses.GeneralClasses.FrameEnvironment) this.Tag; dataBase = fEvt.Database; } } else { success = UpdateMessage(); } if (success) { step = 1; plBrower.Visible = true; plEdit.Visible = false; txtMsgTitle.Text = ""; txtMsgEdit.Text = ""; plRecvieObject.Visible = false; lvwReciveList.Items.Clear(); btnProvious.Enabled = false; btnNext.Enabled = false; btnRelease.Enabled = false; LoadMessageTitle(); } }
private Form ShowDllForm(string dllName, string functionName, string chineseName, ref object[] communicateValue, bool showModule) { try { long menuId; menuId = _menuTag.ModuleId; //获得DLL中窗体 Form dllForm = null; if (showModule) { dllForm = (Form)WorkStaticFun.InstanceForm(dllName, functionName, chineseName, InstanceForm.BCurrentUser, InstanceForm.BCurrentDept, _menuTag, menuId, this.MdiParent, InstanceForm.BDatabase, ref communicateValue); } else { dllForm = (Form)WorkStaticFun.InstanceForm(dllName, functionName, chineseName, InstanceForm.BCurrentUser, InstanceForm.BCurrentDept, _menuTag, menuId, null, InstanceForm.BDatabase, ref communicateValue); } return(dllForm); } catch (Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(null); } }
private void cmbJgbm_SelectedValueChanged(object sender, EventArgs e) { if (cmbJgbm.SelectedValue != null && Convert.ToInt32(cmbJgbm.SelectedValue) != -1) { dataBase = WorkStaticFun.GetJgbmDb(Convert.ToInt32(cmbJgbm.SelectedValue)); LoadMessageTitle(); } }
private void btnGetsql_Click(object sender, EventArgs e) { string tablename = ""; TrasenFrame.Forms.DlgInputBox dlg = new TrasenFrame.Forms.DlgInputBox("", "请输入表名,确定后生成的脚本将存放在粘贴板中,请在粘贴出来使用!", "表名"); dlg.ShowDialog(); tablename = TrasenFrame.Forms.DlgInputBox.DlgValue; Cursor = TrasenClasses.GeneralClasses.PubStaticFun.WaitCursor(); Clipboard.SetDataObject(WorkStaticFun.GetInsertDataSql(tablename)); Cursor = Cursors.Default; }
private void btOK_Click(object sender, System.EventArgs e) { string keyCode = txtRegisterCode.Text.Trim(); try { TrasenRegister.Licence.Exists(keyCode, WorkStaticFun.GetConfigValueByCode(0002, TrasenFrame.Forms.FrmMdiMain.Database)); TrasenRegister.Licence.UpdateRegCode(TrasenFrame.Forms.FrmMdiMain.Database, keyCode); MessageBox.Show("注册成功,请重新启动程序"); } catch (Exception err) { MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void textBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { try { TextBox tb = (TextBox)sender; bool respondKey = true; DataRow dr = WorkStaticFun.GetCardData(tb, e.KeyValue, 1, this.dataGrid1, 0, ds, "seltb", FilterType.智能, SearchType.前导相似, ref respondKey, "", ""); if (dr != null && respondKey) { tb.Text = dr["NAME"].ToString().Trim(); tb.Tag = dr["D_CODE"]; } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace.ToString()); } }
static void Main() { string serverName = TrasenClasses.GeneralClasses.ApiFunction.GetIniString("SERVER_NAME", "NAME", Constant.ApplicationDirectory + "\\ClientConfig.ini"); if (serverName == "") { System.Windows.Forms.MessageBox.Show("ClientConfig.ini中[SERVER_NAME]的NAME未设置,请启动配置程序并设置当前服务器", "错误"); return; } //string filename = Constant.ApplicationDirectory + " \\" + string.Format("{0:yyyyMMdd}", DateTime.Now) + ".txt"; RelationalDatabase database = null; database = new MsSqlServer(); string connectionString = WorkStaticFun.GetConnnectionString(ConnectionType.SQLSERVER, serverName); database.Initialize(connectionString); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FrmServer(database)); }
private void GetForm(string dllName, string functionName, string chineseName, long userID, long deptID, object[] communicateValue, bool showType) { // long menuId=WorkStaticFun.GetMenuId(dllName,functionName,FrmMdiMain.Database); User _userid = new User(userID, FrmMdiMain.Database); Department _deptid = new Department(deptID, FrmMdiMain.Database); //获得DLL中窗体 Form _dllform = (Form)WorkStaticFun.InstanceForm(dllName, functionName, chineseName, _userid, _deptid, null, FrmMdiMain.Database, ref communicateValue); _dllform.StartPosition = FormStartPosition.CenterScreen; if (showType) { _dllform.ShowDialog(); } else { _dllform.Show(); } }
/// <summary> /// 输入用户名类 /// </summary> /// <param name="employeeId"></param> public FrmAddUser(int employeeId) { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // //Modify By Tany 2010-01-27 使用本窗体自己的数据连接 //如果设置了中心机构编码并且中心机构编码不等于当前连接的机构编码,则重新实例化本地连接为中心数据库连接 if (FrmMdiMain.ZxJgbm != -1 && FrmMdiMain.ZxJgbm != FrmMdiMain.Jgbm) { db = WorkStaticFun.GetJgbmDb(FrmMdiMain.ZxJgbm); jgbm = FrmMdiMain.ZxJgbm; } else { db = FrmMdiMain.Database; jgbm = FrmMdiMain.Jgbm; } this.Text += "【" + jgbm + "】"; employee = new TrasenFrame.Classes.Employee(employeeId, db); this.btnChangeCode.Visible = false; this.txtName.Text = employee.Name; this.txtName.Tag = employee; this.DialogResult = DialogResult.Cancel; LoadAllGroup(); if (UserExists()) { ShowUserInfo(); this.btnChangeCode.Visible = true; } else { cmbCode.DropDownStyle = ComboBoxStyle.Simple; cmbCode.Text = GetDefaultCode(); } }
static void Main() { /* * 参数说明: * caption :主窗体标题 * connectionType : 数据库连接类型 * connectionString 连接字符串 * mainProgramname:主程序名 * checkRegister :是否检查注册信息 * */ string serverName = "mydb_svr"; serverName = TrasenClasses.GeneralClasses.ApiFunction.GetIniString("SERVER_NAME", "NAME", Constant.ApplicationDirectory + "\\ClientConfig.ini"); if (serverName == "") { System.Windows.Forms.MessageBox.Show("ClientConfig.ini中[SERVER_NAME]的NAME未设置,请启动配置程序并设置当前服务器", "错误"); return; } string connectionString = WorkStaticFun.GetConnnectionString(ConnectionType.SQLSERVER, serverName); TrasenMainWindow.FrmMdiMainWindow.StartupMain("创星科技信息系统", ConnectionType.SQLSERVER, connectionString, "Trasen", true); }
private void Import() { try { pb1.Minimum = 0; pb1.Value = 0; pb1.Maximum = 30; string connectionString_ly = WorkStaticFun.GetConnnectionString(ConnectionType.SQLSERVER, "来源"); string connectionString_mb = WorkStaticFun.GetConnnectionString(ConnectionType.SQLSERVER, "目标"); SqlConnection db_ly = new SqlConnection(connectionString_ly); db_ly.Open(); SqlCommand cmd = new SqlCommand("select * from zy_fee_speci where year(charge_date)=2012", db_ly); cmd.CommandTimeout = 1200; SqlDataReader sdr = cmd.ExecuteReader(); SqlBulkCopy bulkCopy = new SqlBulkCopy(connectionString_mb); //设置目标表名称 bulkCopy.DestinationTableName = "zy_fee_speci_2012"; bulkCopy.BulkCopyTimeout = 1200; //每导入1条数据就执行一次SqlRowsCopied方法 bulkCopy.NotifyAfter = 227327; bulkCopy.BatchSize = 227327; bulkCopy.SqlRowsCopied += new SqlRowsCopiedEventHandler(bulkCopy_SqlRowsCopied); bulkCopy.WriteToServer(sdr); } catch (System.Exception err) { MessageBox.Show(err.Message); } }
private void btOk_Click(object sender, System.EventArgs e) { try { if (CurrentUser != null) { if (chkVeriftyCA.Checked) { if (!CurrentUser.CheckPassword(txtPasswd.TextPass.Trim(), true)) { MessageBox.Show("PIN码不正确!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtPasswd.Text = ""; txtPasswd.Focus(); return; } } else { if (!CurrentUser.CheckPassword(txtPasswd.TextPass.Trim())) { MessageBox.Show("密码不正确!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtPasswd.Text = ""; txtPasswd.Focus(); return; } } } else { MessageBox.Show("用户名不存在!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtName.Focus(); txtName.SelectAll(); return; } if (CurrentSystem == 0) //用户直接点击确定按钮 { if (!CheckUserDeptAndRight(chkVeriftyCA.Checked)) { return; } } //2013-1-15 增加 使用公共的过程验证 空密码与密码长度 bool passwordlength = DlgPasswd.CheckPasswordLength(txtPasswd.TextPass.Trim()); if (passwordlength == false) { FrmMdiMain.CurrentUser = CurrentUser; TrasenFrame.Forms.FrmMdiMain.CurrentDept = new Department(); Button btnOk_Login = new Button(); DlgPasswd dlgPasswd = new DlgPasswd(CurrentUser.UserID, btnOk_Login); dlgPasswd.AllowCancel = true; dlgPasswd.ShowDialog(); //修改了 密码 就重新 取用户信息,方便登陆 if (btnOk_Login.Tag != null && btnOk_Login.Tag.ToString() == "ok") { CurrentUser = new User(CurrentUser.UserID, FrmMdiMain.Database); } return; } LoginSuccess = true; //Modify By Tany 2009-12-02 增加登陆状态的记录 //FrmMdiMain.Database.DoCommand("update pub_user set login_bit=1,login_time=getdate(),login_ip='" + Dns.GetHostByName(Dns.GetHostName()).AddressList[0].ToString() // + "',login_mac='" + PubStaticFun.GetMacAddress() + "',login_pcname='" + System.Environment.MachineName + "' where id=" + CurrentUser.UserID); string computerName = System.Environment.MachineName; string ip = Dns.GetHostByName(Dns.GetHostName()).AddressList[0].ToString(); string mac = PubStaticFun.GetMacAddress(); CurrentUser.Login(computerName, ip, mac, TrasenFrame.Forms.FrmMdiMain.PortNum); WorkStaticFun.ClearTempDir();//2013-1-18 增加 删除垃圾 --2013-7-3 jianqg 移到登录按钮,并且改为不等待 this.Close(); } catch (System.Exception err) { MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
static void Main(string[] args) { /* * 参数说明: * caption :主窗体标题 * connectionType : 数据库连接类型 * connectionString 连接字符串 * mainProgramname:主程序名 * * */ Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); TrasenMainWindow.FrmMdiMainWindow.WriteFrameLocalLog(new string[] { string.Format("********************************************** Local Time : {0} **********************************************", DateTime.Now.ToString()) }, false); string clientConfigFile = Constant.ApplicationDirectory + "\\ClientConfig.ini"; string[] ss = System.Windows.Forms.Application.ExecutablePath.Split("\\".ToCharArray()); TrasenClasses.GeneralClasses.ApiFunction.WriteIniString("HIS_StARTUP_EXE", "NAME", ss[ss.Length - 1], clientConfigFile); string serverName = ""; serverName = TrasenClasses.GeneralClasses.ApiFunction.GetIniString("SERVER_NAME", "NAME", clientConfigFile); if (serverName == "") { System.Windows.Forms.MessageBox.Show("ClientConfig.ini中[SERVER_NAME]的NAME未设置,请启动配置程序并设置当前服务器", "错误"); return; } string connectionString = WorkStaticFun.GetConnnectionString_Default(ConnectionType.SQLSERVER);//.GetConnnectionString(ConnectionType.SQLSERVER, serverName); //TrasenFrame.Forms.FrmMdiMain.WriteFrameLocalLog(new string[] { string.Format("args:{0},{1}", args.Length, args[0]) }, true); if (args != null && args.Length > 0 && args[0] == "IsFormUpdate") { TrasenMainWindow.FrmMdiMainWindow.StartupMain("创星科技信息系统", ConnectionType.SQLSERVER, connectionString, "Trasen", true, true); return; } //单点登录 #region 单点登录处理 try { if (args.Length > 0) { //trasen.exe 8|635;portalsid=xxxxxx const string name = "portalsid"; string[] array = args[0].Split(";".ToCharArray()); //Modify By Tany 2014-12-10 原来写的是长度=2,但是门户可能会增加参数,所以改写成>= if (array.Length >= 2 && (array[1].Length > name.Length && array[1].Substring(0, name.Length).ToLower() == name.ToLower())) { string system_menu_id = array[0]; //得到系统及菜单的ID xx|xxx格式 string portalsid = array[1]; //得到portalsid 部分 portalsid=xxxx格式 string[] temp = portalsid.Split("=".ToCharArray()); if (temp.Length == 2) { portalsid = temp[1].Trim(); } else { portalsid = ""; //得到真正的portalsid } //Add By Tany 2014-10-30 记录门户的ID TrasenFrame.Forms.FrmMdiMain.PortalsId = portalsid; TrasenFrame.Forms.FrmMdiMain.WriteFrameLocalLog(new string[] { string.Format("获取到参数{0},{1}", system_menu_id, portalsid) }, true); string dll = AppDomain.CurrentDomain.BaseDirectory + "ts.WHZXYY.Portal.dll"; System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFile(dll); object obj = assembly.CreateInstance("ts.WHZXYY.Portal.Client"); if (obj == null) { throw new Exception("创建ts.WHZXYY.Portal.Client对象失败"); } System.Reflection.MethodInfo mi = obj.GetType().GetMethod("GetRequestString"); object objRet = mi.Invoke(obj, new object[] { portalsid }); string ret = objRet != null?objRet.ToString() : ""; if (!string.IsNullOrEmpty(ret)) { System.Xml.XmlDocument document = new System.Xml.XmlDocument(); document.LoadXml(ret); System.Xml.XmlNode nameNode = document.SelectSingleNode("//loginUserInfo/userAccount"); if (nameNode != null) { string loginCode = nameNode.InnerText; if (!string.IsNullOrEmpty(system_menu_id)) { TrasenMainWindow.FrmMdiMainWindow.StartupMain("创星科技信息系统", ConnectionType.SQLSERVER, connectionString, "Trasen", true, false, loginCode, system_menu_id); } else { TrasenMainWindow.FrmMdiMainWindow.StartupMain("创星科技信息系统", ConnectionType.SQLSERVER, connectionString, "Trasen", true, false, loginCode); } return; } else { throw new Exception(document.InnerText); } } } } } catch (Exception error) { MessageBox.Show("单点登录失败!原因:" + error.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); TrasenFrame.Forms.FrmMdiMain.WriteFrameLocalLog(new string[] { error.Message, error.StackTrace }, true); } #endregion TrasenMainWindow.FrmMdiMainWindow.StartupMain("创星科技信息系统", ConnectionType.SQLSERVER, connectionString, "Trasen", true); }
private void 医嘱查询ToolStripMenuItem_Click(object sender, EventArgs e) { try { //comment by wangzhi 2010-11-16 //DataTable tb = (DataTable)dgvyjsq.DataSource; //if ( dataGridView1.CurrentCell == null ) // return; //if ( tb.Rows.Count <= 0 ) // return; //int nrow = dgvyjsq.CurrentCell.RowIndex; //Guid yzid = new Guid( tb.Rows[nrow]["yzid"].ToString() ); //end comment // add by wangzhi 2010-11-16 if (dgvyjsq.DataSource == null) { return; } if (dgvyjsq.Rows.Count == 0) { return; } DataView dv = (DataView)dgvyjsq.DataSource; int nrow = dgvyjsq.CurrentCell.RowIndex; Guid yzid = new Guid(dv[nrow]["yzid"].ToString()); //end add string ssql = " select a.inpatient_id,a.baby_id,a.ward_id,a.dept_br,0 dept_ly,flag, " + " CAST(A.INPATIENT_ID AS CHAR(40)) + CAST(A.BABY_id AS CHAR(10)) + CAST(0 AS CHAR(10)) + CAST(A.dept_br AS CHAR(10)) + CAST(A.WARD_ID AS CHAR(10)) AS STAG " + "from zy_orderrecord a inner join VI_ZY_VINPATIENT b " + " on a.inpatient_id=b.inpatient_id " + " where order_id='" + yzid + "' "; DataTable tbmx = InstanceForm.BDatabase.GetDataTable(ssql); if (tbmx.Rows.Count == 0) { return; } int _flag = Convert.ToInt32(tbmx.Rows[0]["flag"]); if (_flag == 2 || _flag == 4 || _flag == 5 || _flag == 6) { MessageBox.Show("该病人已经出院!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } object[] communicateValue = new object[3]; //这个是废参数,无所谓 communicateValue[0] = ""; communicateValue[1] = 0; //病人ID communicateValue[2] = tbmx.Rows[0]["inpatient_id"].ToString(); WorkStaticFun.InstanceFormEx("ts_zyhs_yzgl", "Fun_ts_zyhs_yzgl_inpatient", "医嘱查询", InstanceForm.BCurrentUser, InstanceForm.BCurrentDept, new MenuTag(), -1, this.MdiParent, InstanceForm.BDatabase, ref communicateValue); } catch (System.Exception err) { MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// 医嘱查询_麻醉,信息查询 /// </summary> /// <param name="userid">开嘱医生userId</param> /// <param name="deptid">开嘱医生的科室ID</param> /// <param name="dept_br">病人所在科室ID</param> private void ShowFrmYZCX_MZ(long userid, long deptid, string ssNo) { if (this.txtPatID.Text == "") { MessageBox.Show("请输入住院号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } object[] communicateValue = new object[3]; User _userid = new User(userid, FrmMdiMain.Database); Department _deptid = new Department(deptid, FrmMdiMain.Database); //add by zouchihua 2012-5-24 医生工作站 手术麻醉进入是否对婴儿记账 0=否,1=是 SystemCfg cfg6034 = new SystemCfg(6034); string ssql = ""; if (cfg6034.Config.Trim() == "0") { ssql = "select INPATIENT_NO AS 住院号,NAME AS 姓名,INPATIENT_ID,0 as Baby_ID,DEPT_ID,0 as isMY " + "from vi_zy_vinpatient " + "where inpatient_no='" + ssNo + "' and flag<>10"; } else { ssql = "select INPATIENT_NO AS 住院号,NAME AS 姓名,INPATIENT_ID,Baby_ID,DEPT_ID,0 as isMY " + "from VI_ZY_VINPATIENT_BED " + "where inpatient_no='" + ssNo + "' and flag<>10"; } if (type == 0) { //Modify By Tany 2011-03-03 //9003是否允许对未开手术申请的病人录入医嘱 0=是 1=不是 if (new SystemCfg(9003).Config == "1") { ssql += " and inpatient_id in (select inpatient_id from ss_apprecord where (jzss=1 or shbj=1) and bdelete=0)"; } } else//特殊治疗 { ssql = "select INPATIENT_NO AS 住院号,NAME AS 姓名,INPATIENT_ID,0 as Baby_ID,DEPT_ID,0 as isMY " + "from vi_zy_vinpatient_bed " + "where inpatient_no='" + ssNo + "' and flag<>10"; } DataTable tb = FrmMdiMain.Database.GetDataTable(ssql); if (tb.Rows.Count == 0) { MessageBox.Show("不能查询该住院号的病人,请重新输入住院号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } ClassStatic.Current_BinID = new Guid(tb.Rows[0]["INPATIENT_ID"].ToString()); ClassStatic.Current_DeptID = Convert.ToInt64(tb.Rows[0]["DEPT_ID"]); ClassStatic.Current_BabyID = 0; communicateValue[0] = ssql; communicateValue[1] = 1; //Modify by zouchihua 2012-3-19 if (type == 0) { //Modify By Tany 2015-05-11 手术和麻醉要根据科室来 DataTable ssmzTb = FrmMdiMain.Database.GetDataTable("select * from ss_dept where deptid=" + FrmMdiMain.CurrentDept.DeptId); if (ssmzTb != null && ssmzTb.Rows.Count > 0) { int ssmzType = Convert.ToInt32(ssmzTb.Rows[0]["type"]); communicateValue[1] = ssmzType; //0=手术 1=麻醉 } WorkStaticFun.InstanceFormEx("ts_zyhs_yzgl", "Fun_ts_zyhs_yzgl_ssmz", "医嘱管理", _userid, _deptid, InstanceForm._functions, InstanceForm._menuId, this.MdiParent, FrmMdiMain.Database, ref communicateValue); } if (type == 1) { communicateValue[2] = tb.Rows[0]["INPATIENT_ID"].ToString(); WorkStaticFun.InstanceFormEx("ts_zyhs_yzgl", "Fun_ts_zyhs_yzgl_inpatient", "医嘱管理", _userid, _deptid, InstanceForm._functions, InstanceForm._menuId, this.MdiParent, FrmMdiMain.Database, ref communicateValue); } }
private void txtJbmc_KeyUp(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Escape) { return; } bool respondKey = false; _curCtrl = (TextBox)sender; string tableName = ""; string otherFilter = ""; string sort = ""; switch (_curCtrl.Name) { case "txtJbmc": switch (Constant.CustomFilterType) { case FilterType.智能: sort = "PY_CODE,WB_CODE,D_CODE"; break; case FilterType.拼音: sort = "PY_CODE"; break; case FilterType.五笔: sort = "WB_CODE"; break; case FilterType.数字: sort = "D_CODE"; break; default: break; } sort = "py_len,wb_len," + sort;//Modify By tany 2012-03-16 根据拼音五笔的长度来排序 tableName = "DiseaseDiction"; //if ((((DischargeMode)Convert.ToInt32(cmbJSFS.SelectedValue)) == DischargeMode.Insure_DischargeMode)) //{ //otherFilter = "ybjklx=" + Convertor.IsNull(this.label13.Text.ToString(), "0"); //otherFilter = "0"; //} break; default: break; } DataRow dr = WorkStaticFun.GetCardData(_curCtrl, e.KeyValue, -1, cardGrid, 0, Dictionnary, tableName, Constant.CustomFilterType, Constant.CustomSearchType, ref respondKey, otherFilter, sort); if ((e.KeyValue == 13 || (e.KeyValue >= 48 && e.KeyValue <= 57) || (e.KeyValue >= 96 && e.KeyValue <= 105)) && dr != null) { _curCtrl.Tag = Convert.ToString(dr["ITEMCODE"]); _curCtrl.Text = Convert.ToString(dr["ITEMNAME"]); switch (_curCtrl.Name) { case "txtJbmc": buttj.Focus(); // buttj.SelectAll(); break; default: break; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private bool dtgrdBed_myKeyDown(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) { DataRow dr = null; bool respondKey = true; DataGridCell grdCell = dtgrdBed.CurrentCell; int currRow = grdCell.RowNumber; int currCol = grdCell.ColumnNumber; DataGridTextBoxColumn dgtCol = (DataGridTextBoxColumn)dtgrdBed.TableStyles[0].GridColumnStyles[currCol]; int keyInt = (int)keyData; if (currRow == ((DataTable)dtgrdBed.DataSource).Rows.Count) { return(true); } if (currCol == COL_ZZ_DOC_NAME || currCol == COL_ZY_DOC_NAME) { dr = WorkStaticFun.GetCardData(dtgrdBed, (int)keyData, currCol, showCard, 0, _dataSet, "DIC_DOCTOR", FilterType.拼音, SearchType.前导相似, ref respondKey, "", ""); } if (currCol == COL_NURSE_NAME) { dr = WorkStaticFun.GetCardData(dtgrdBed, (int)keyData, currCol, showCard, 0, _dataSet, "DIC_NURSE", FilterType.拼音, SearchType.前导相似, ref respondKey, "", ""); } if (currCol == COL_HOITEM_NAME) { dr = WorkStaticFun.GetCardData(dtgrdBed, (int)keyData, currCol, showCard, 0, _dataSet, "DIC_BED_ORDER", FilterType.拼音, SearchType.前导相似, ref respondKey, "", ""); } //BackSpace,Delete必须响应 //if(keyInt==8 || keyInt==46) return false; if (keyData == Keys.Up || keyData == Keys.Down || keyData == Keys.Left || keyData == Keys.Right) { return(true); } if (keyData == Keys.Enter) { #region Enter if (dr != null) { long _itemId = Convert.ToInt64(dr["itemcode"]); string _itemName = dr["itemname"].ToString().Trim(); dgtCol.TextBox.Text = _itemName; switch (currCol) { case COL_ZZ_DOC_NAME: ((DataTable)dtgrdBed.DataSource).Rows[currRow]["zz_doc"] = _itemId; ((DataTable)dtgrdBed.DataSource).Rows[currRow]["zz_doc_name"] = _itemName; break; case COL_ZY_DOC_NAME: ((DataTable)dtgrdBed.DataSource).Rows[currRow]["zy_doc"] = _itemId; ((DataTable)dtgrdBed.DataSource).Rows[currRow]["zy_doc_name"] = _itemName; break; case COL_NURSE_NAME: ((DataTable)dtgrdBed.DataSource).Rows[currRow]["charge_nurse"] = _itemId; ((DataTable)dtgrdBed.DataSource).Rows[currRow]["nurse_name"] = _itemName; break; case COL_HOITEM_NAME: ((DataTable)dtgrdBed.DataSource).Rows[currRow]["hoitem_id"] = _itemId; ((DataTable)dtgrdBed.DataSource).Rows[currRow]["hoitem_name"] = _itemName; if (currRow == ((DataTable)dtgrdBed.DataSource).Rows.Count) { ((DataTable)dtgrdBed.DataSource).Rows.Add(((DataTable)dtgrdBed.DataSource).NewRow()); } dtgrdBed.CurrentCell = new DataGridCell(currRow + 1, COL_BED_NO); break; } if (currCol == COL_BED_NO) { dtgrdBed.CurrentCell = new DataGridCell(currRow, COL_ZZ_DOC_NAME); } if (currCol == COL_ZZ_DOC_NAME) { dtgrdBed.CurrentCell = new DataGridCell(currRow, COL_ZY_DOC_NAME); } if (currCol == COL_ZY_DOC_NAME) { dtgrdBed.CurrentCell = new DataGridCell(currRow, COL_NURSE_NAME); } if (currCol == COL_NURSE_NAME) { dtgrdBed.CurrentCell = new DataGridCell(currRow, COL_HOITEM_NAME); } if (currCol == COL_HOITEM_NAME) { if (currRow == ((DataTable)dtgrdBed.DataSource).Rows.Count) { return(true); } else { dtgrdBed.CurrentCell = new DataGridCell(currRow + 1, COL_BED_NO); } } return(true); } else { if (currCol == COL_BED_NO) { dtgrdBed.CurrentCell = new DataGridCell(currRow, COL_ZZ_DOC_NAME); } return(true); } #endregion } if (keyData == Keys.Delete || keyData == Keys.Back) { #region Delete if (currCol == COL_BED_NO) { ((DataTable)dtgrdBed.DataSource).Rows[currRow]["bed_no"] = ""; } if (currCol == COL_ZZ_DOC_NAME) { ((DataTable)dtgrdBed.DataSource).Rows[currRow]["zz_doc"] = ""; ((DataTable)dtgrdBed.DataSource).Rows[currRow]["zz_doc_name"] = ""; } if (currCol == COL_ZY_DOC_NAME) { ((DataTable)dtgrdBed.DataSource).Rows[currRow]["zy_doc"] = ""; ((DataTable)dtgrdBed.DataSource).Rows[currRow]["zy_doc_name"] = ""; } if (currCol == COL_NURSE_NAME) { ((DataTable)dtgrdBed.DataSource).Rows[currRow]["charge_nurse"] = ""; ((DataTable)dtgrdBed.DataSource).Rows[currRow]["nurse_name"] = ""; } if (currCol == COL_HOITEM_NAME) { ((DataTable)dtgrdBed.DataSource).Rows[currRow]["hoitem_id"] = ""; ((DataTable)dtgrdBed.DataSource).Rows[currRow]["hoitem_name"] = ""; } #endregion } return(false); }