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

            switch (_functionName)
            {
            case "Fun_Ts_yj_qf":
                FrmYJQF = new FrmYJQF();
                if (_mdiParent != null)
                {
                    FrmYJQF.MdiParent = _mdiParent;
                }
                frm = FrmYJQF;
                break;

            case "Fun_Ts_yj_qf_CJ":
                FrmYJQF_CJ = new FrmYJQF_CJ();
                if (_mdiParent != null)
                {
                    FrmYJQF_CJ.MdiParent = _mdiParent;
                }
                frm = FrmYJQF_CJ;
                break;
            }
            return(frm);
        }
示例#2
0
        /// <summary>
        /// 根据函数名称实例化窗体
        /// </summary>
        public void InstanceWorkForm()
        {
            if (_functionName == "")
            {
                throw new Exception("引出函数名不能为空!");
            }
            FrmYJQF    FrmYJQF    = null;
            FrmYJQF_CJ FrmYJQF_CJ = null;

            switch (_functionName)
            {
            case "Fun_Ts_yj_qf":
                FrmYJQF = new FrmYJQF();
                if (_mdiParent != null)
                {
                    FrmYJQF.MdiParent = _mdiParent;
                }
                string[] deptarr = cfg29375.Config.Split(',');
                foreach (string i in deptarr)
                {
                    if (_currentDept.DeptId.ToString() == i.ToString())
                    {
                        FrmYJQF.BringToFront();
                        FrmYJQF.Show();
                        FrmYJQF.WindowState = FormWindowState.Maximized;
                    }
                }

                break;

            case "Fun_Ts_yj_qf_CJ":
                FrmYJQF_CJ = new FrmYJQF_CJ();
                if (_mdiParent != null)
                {
                    FrmYJQF_CJ.MdiParent = _mdiParent;
                }
                string[] deptarr_cz = cfg29375.Config.Split(',');
                foreach (string i in deptarr_cz)
                {
                    if (_currentDept.DeptId.ToString() == i.ToString())
                    {
                        FrmYJQF_CJ.BringToFront();
                        FrmYJQF_CJ.Show();
                        FrmYJQF_CJ.WindowState = FormWindowState.Maximized;
                    }
                }

                break;

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