protected void Application_Start() { AppServiceFactory.RegisterServices(); AppServiceFactory.RegisterServicesFromAssembly(Chloe.Application.CurrentAssembly.Value); AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); }
protected void Application_Start() { //throw new BigBigException("由于您未给博主点赞,博主伤心的向您抛了个大大的异常"); AppServiceFactory.RegisterServices(); AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); }
protected void Application_Start() { throw new BigBigException("由于您未给博主点赞,博主伤心的向您抛了个大大的异常"); AppServiceFactory.RegisterServices(); AppServiceFactory.RegisterServicesFromAssembly(Chloe.Application.CurrentAssembly.Value); AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); MainWindow window = new MainWindow(); window.Closing += new System.ComponentModel.CancelEventHandler(window_Closing); AppServiceFactory serviceFactory = new AppServiceFactory(); _MainVM = new MainVM(serviceFactory); window.DataContext = _MainVM; window.Show(); }
protected void Application_Start() { System.Timers.Timer myTimer = new System.Timers.Timer(10000); myTimer.Elapsed += new System.Timers.ElapsedEventHandler(TimeExecuteTask); myTimer.Interval = 10000; myTimer.Enabled = true; AppServiceFactory.RegisterServices(); AppServiceFactory.RegisterServicesFromAssembly(Chloe.Application.CurrentAssembly.Value); AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); }
public override void OnActionExecuting(ActionExecutingContext context) { WebController defaultController = (WebController)context.Controller; if (defaultController.UserInfoSession == null) { return; } AppServiceFactory appServiceFactory = new AppServiceFactory(context.HttpContext.RequestServices); var permissionService = appServiceFactory.CreateService <IPermissionService>(); var claims = permissionService.GetUnionPermission(defaultController.UserInfoSession); //页面无权限过滤 var url = $"/{context.RouteData.Values["Controller"].ToString()}/{context.RouteData.Values["Action"].ToString()}"; var flag = claims.Where(x => x.Url != null).Where(x => x.Url.ToUpper() == url.ToUpper()).Count() > 0; if (!flag) { SesJsonResult jsonResult = new SesJsonResult(JsonResultStatus.Unauthorized, "无权限"); context.Result = new ContentResult() { Content = JsonConvert.SerializeObject(jsonResult) }; return; } //按钮权限控制 var btnPermission = permissionService.GetUnionBtnPermission(defaultController.UserInfoSession, url); Dictionary <string, string> btnPermissionDic = new Dictionary <string, string>(); var style = "display:none;"; foreach (var item in BtnPermission.AllBtnPms.Split(',')) { if (!btnPermission.Contains(item)) { btnPermissionDic.Add(item, style); } else { btnPermissionDic.Add(item, string.Empty); } } defaultController.ViewBag.BtnPermissionDic = btnPermissionDic; base.OnActionExecuting(context); }
public BlogController() { this.postAppService = AppServiceFactory.GetPostAppService(); this.commentAppService = AppServiceFactory.GetCommentAppService(); }
public AutenticationController() { this.autenticationAppService = AppServiceFactory.GetAutenticationAppService(); }
public FindService() { _serviceFactoryServer = AppServiceFactory.GetInstance(); }
public CommentController() { this.commentAppService = AppServiceFactory.GetCommentAppService(); }
public PostController() { this.postAppService = AppServiceFactory.GetPostAppService(); }