예제 #1
0
        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;   //将已经打开的医嘱管理窗体进行初始化,如果没有这句话,在关闭医嘱窗体后再打开则会提示该医嘱窗体已经打开
            }
        }
예제 #2
0
 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);
     }
 }
예제 #3
0
        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
            {
            }
        }
예제 #4
0
        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();
            }
        }