private void SaveData() { IModuleService service = ServiceContainer.GetService <IModuleService>(); int[] selections = this.Grid2.SelectedRowIndexArray; try { foreach (int rowIndex in selections) { var vType = System.Type.GetType(string.Format("{0},{1}", this.Grid2.DataKeys[rowIndex][0].ToString(), this.Grid2.DataKeys[rowIndex][1].ToString())); var vMethod = vType.GetMethod(this.Grid2.DataKeys[rowIndex][2].ToString()); var vM = Attribute.GetCustomAttribute(vMethod, typeof(ServiceMethodAttribute)) as ServiceMethodAttribute; var vModule = new EAS.Explorer.Entities.Module { Guid = vM.Guid.ToUpper(), Name = vM.Name, Description = vM.Description, Type = MetaHelper.GetTypeString(vType), Assembly = MetaHelper.GetAssemblyString(vType), Method = vMethod.Name, Developer = MetaHelper.GetDeveloperString(vType), Version = MetaHelper.GetVersionString(vType), SortCode = 0, Attributes = (int)EAS.Explorer.GoComType.Business, LMTime = DateTime.Now }; service.InstallModule(vModule); } } catch (System.Exception exc) { Alert.Show(exc.Message, MessageBoxIcon.Error); } }
internal static object LoadModule(System.Guid Guid, ISession session) { EAS.Explorer.Entities.Module mv = new EAS.Explorer.Entities.Module(); mv.Guid = Guid.ToString(); //mv.Refresh(); if (!mv.Exists) { return(null); } object module = ClassProvider.GetObjectInstance(mv.Assembly, mv.Type); if (module == null) { throw new System.Exception("无法加载模块“" + mv.Name + "”,请通知您的系统管理人员。"); } return(module); }
protected void Page_Load(object sender, EventArgs e) { this.param = base.Request.Params["login"].ToString(); string[] sv = this.param.Split(new char[] { ',' }); this.guid = sv[0]; this.name = sv[1]; this.module = sv[4]; if (this.name.Trim().Length == 0) { EAS.Explorer.Entities.Module doModule = new EAS.Explorer.Entities.Module(); doModule.Guid = this.guid; doModule.Refresh(); this.name = doModule.Name; this.module = doModule.Assembly + "|" + doModule.Type; } if (sv.Length == 7) { this.tag = sv[6]; } }