/// <summary> /// 返回一个FORM对象 /// </summary> /// <returns></returns> public object GetObject() { if (_functionName == "") { throw new Exception("引出函数名不能为空!"); } FrmCon frmCon = null; FrmHzddy hzddy = null; switch (_functionName) { case "Fun_Ts_zyys_hzgl": if (_communicateValue != null) { frmCon = new FrmCon(_currentUser.UserID, _currentDept.DeptId, _chineseName, _communicateValue); } else { frmCon = new FrmCon(_currentUser.UserID, _currentDept.DeptId, _chineseName); } if (_mdiParent != null) { // frmCon.MdiParent = _mdiParent; frmCon.Show(); } break; case "Fun_Ts_zyys_hzddy": hzddy = new FrmHzddy(); hzddy.MdiParent = _mdiParent; hzddy.Show(); break; default: throw new Exception("引出函数名称错误!"); } return(frmCon); }
/// <summary> /// 根据函数名称实例化窗体 /// </summary> public void InstanceWorkForm() { if (_functionName == "") { throw new Exception("引出函数名不能为空!"); } FrmCon frmCon = null; FrmHzddy hzddy = null; switch (_functionName) { case "Fun_Ts_zyys_hzgl": frmCon = new FrmCon(_currentUser.UserID, _currentDept.DeptId, _chineseName); if (_mdiParent != null) { frmCon.MdiParent = _mdiParent; } frmCon.BringToFront(); frmCon.ShowDialog(); break; case "Fun_Ts_zyys_hzddy": hzddy = new FrmHzddy(); if (_mdiParent != null) { hzddy.MdiParent = _mdiParent; } hzddy.WindowState = FormWindowState.Maximized; hzddy.BringToFront(); hzddy.Show(); break; default: throw new Exception("引出函数名错误!"); } }