/// <summary> /// 门户创建待审批的单据(针对新平台) 2012-8-3 /// </summary> /// <param name="FormID"></param> /// <param name="FormName"></param> public static void CreateFormFromMvcPlat(string StrFormID, string StrFormName, string StrFormType) { FormID = StrFormID; FormName = StrFormName; FormType = StrFormType; //ChecResource(); FormTypes CurrentAction = FormTypes.Audit; if (!string.IsNullOrEmpty(FormType)) { switch (FormType.ToUpper()) { case "AUDIT": CurrentAction = FormTypes.Audit; break; case "ADD": CurrentAction = FormTypes.New; break; case "EDIT": CurrentAction = FormTypes.Edit; break; case "VIEW": CurrentAction = FormTypes.Browse; break; } } Type t = Type.GetType(FormName); // SMT.SaaS.OA.UI.UserControls..BusinessApplicationsForm Object[] parameters = new Object[2]; // 定义构造函数需要的参数 parameters[0] = CurrentAction; parameters[1] = FormID; // "5d572f2d-c0e4-49ca-960e-6bd45bfb97a9"; object form = Activator.CreateInstance(t, parameters); if (form != null) { EntityBrowser entBrowser = new EntityBrowser(form); entBrowser.FormType = CurrentAction; entBrowser.ShowMvcPlat <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); } //CheckPermission(FormName); }
/// <summary> /// 显示审核界面 /// </summary> /// <param name="modelCode"></param> /// <param name="orderID"></param> public static void ShowEditFormForMvcPlat(string orderID, string modelCode, string formType) { try { OrderInitManager om = new OrderInitManager(); om.InitCompleted += (o, e) => { EntityBrowser eb = GetEditPage(modelCode, orderID, formType) as EntityBrowser; eb.EntityScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; FrameworkElement plRoot = CommonFunction.ParentLayoutRoot; eb.MinHeight = 400; eb.ShowMvcPlat <string>(DialogMode.Default, plRoot, "", (result) => { }); }; om.Init(); } catch (Exception ex) { MessageBox.Show(string.Format("Code: {0}, ID: {1} ,Exception :{2} ", modelCode, orderID, ex.ToString())); } }
/// <summary> /// 打开Form表单 /// </summary> private static void ShowForm() { FormTypes CurrentAction = FormTypes.Audit; if (!string.IsNullOrEmpty(FormType)) { switch (FormType.ToUpper()) { case "AUDIT": CurrentAction = FormTypes.Audit; break; case "ADD": CurrentAction = FormTypes.New; break; case "EDIT": CurrentAction = FormTypes.Edit; break; case "VIEW": CurrentAction = FormTypes.Browse; break; } } Type t = Type.GetType(FormName); Object[] parameters = new Object[2]; // 定义构造函数需要的参数 parameters[0] = CurrentAction; parameters[1] = FormID; // "5d572f2d-c0e4-49ca-960e-6bd45bfb97a9"; object form = Activator.CreateInstance(t, parameters); if (form != null) { EntityBrowser entBrowser = new EntityBrowser(form); entBrowser.FormType = CurrentAction; if (EnumPort == PortalType.Silverlight) { entBrowser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }, true, FormID); } else { entBrowser.ShowMvcPlat <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); } if (FormName == "SMT.SaaS.Permission.UI.Views.Travelmanagement.MissionReportsChildWindows") { WindowsManager.MaxWindow(entBrowser.ParentWindow); //entBrowser.ParentWindow.Height = 900; //entBrowser.ParentWindow.Width = 1145; } else if (FormName == "SMT.SaaS.Permission.UI.Views.Travelmanagement.TravelapplicationChildWindows") { WindowsManager.MaxWindow(entBrowser.ParentWindow); //entBrowser.ParentWindow.Height = 900; //entBrowser.ParentWindow.Width = 1060; } else if (FormName == "SMT.SaaS.Permission.UI.UserControls.TravelReimbursementControl") { WindowsManager.MaxWindow(entBrowser.ParentWindow); //entBrowser.ParentWindow.Height = 900; //entBrowser.ParentWindow.Width = 1180; } else { entBrowser.ParentWindow.Height = 900; entBrowser.ParentWindow.Width = 900; } } }