Esempio n. 1
0
        /// <summary>
        /// 根据函数名称实例化窗体
        /// </summary>
        public void InstanceWorkForm()
        {
            if (_functionName == "")
            {
                throw new Exception("引出函数名不能为空!");
            }
            FrmJYSQ frmjysq = null;

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

            case "Fun_Ts_zyys_jysq_bmwh":
                FrmJyxmBm frmybm = new FrmJyxmBm();    // new FrmJYSQ(_currentUser.UserID, _currentDept.DeptId, _chineseName);
                if (_mdiParent != null)
                {
                    frmybm.MdiParent = _mdiParent;
                }
                frmybm.BringToFront();
                frmybm.WindowState = FormWindowState.Maximized;
                frmybm.Show();
                break;

            default:
                throw new Exception("引出函数名错误!");
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 返回一个FORM对象
        /// </summary>
        /// <returns></returns>
        public object GetObject()
        {
            if (_functionName == "")
            {
                throw new Exception("引出函数名不能为空!");
            }
            FrmJYSQ frmjysq = null;

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

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

                break;

            case "Fun_Ts_zyys_jysq_bmwh":
                FrmJyxmBm frmjysqbm = new FrmJyxmBm();
                if (_mdiParent != null)
                {
                    frmjysqbm.MdiParent = _mdiParent;
                }
                return(frmjysqbm);

                break;

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