예제 #1
0
        /// <summary>
        /// 返回一个FORM对象
        /// </summary>
        /// <returns></returns>
        public object GetObject()
        {
            if (_functionName == "")
            {
                throw new Exception("引出函数名不能为空!");
            }
            FrmZLSQ frmzlsq = null;

            switch (_functionName)
            {
            case "Fun_Ts_zyys_zlsq":
                if (_communicateValue != null)
                {
                    frmzlsq = new FrmZLSQ(_currentUser.UserID, _currentDept.DeptId, _chineseName, _communicateValue);
                }
                else
                {
                    frmzlsq = new FrmZLSQ(_currentUser.UserID, _currentDept.DeptId, _chineseName);
                }

                if (_mdiParent != null)
                {
                    frmzlsq.MdiParent = _mdiParent;
                }

                break;

            default:
                throw new Exception("引出函数名称错误!");
            }
            return(frmzlsq);
        }
예제 #2
0
        /// <summary>
        /// 根据函数名称实例化窗体
        /// </summary>
        public void InstanceWorkForm()
        {
            if (_functionName == "")
            {
                throw new Exception("引出函数名不能为空!");
            }
            FrmZLSQ frmzlsq = null;

            switch (_functionName)
            {
            case "Fun_Ts_zyys_zlsq":
                frmzlsq = new FrmZLSQ(_currentUser.UserID, _currentDept.DeptId, _chineseName);
                if (_mdiParent != null)
                {
                    frmzlsq.MdiParent = _mdiParent;
                }
                frmzlsq.BringToFront();
                frmzlsq.ShowDialog();
                break;

            default:
                throw new Exception("引出函数名错误!");
            }
        }