Exemplo n.º 1
0
        protected void Application_Start()
        {
            AppServiceFactory.RegisterServices();
            AppServiceFactory.RegisterServicesFromAssembly(Chloe.Application.CurrentAssembly.Value);

            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
Exemplo n.º 2
0
        protected void Application_Start()
        {
            //throw new BigBigException("由于您未给博主点赞,博主伤心的向您抛了个大大的异常");

            AppServiceFactory.RegisterServices();

            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
Exemplo n.º 3
0
        protected void Application_Start()
        {
            throw new BigBigException("由于您未给博主点赞,博主伤心的向您抛了个大大的异常");

            AppServiceFactory.RegisterServices();
            AppServiceFactory.RegisterServicesFromAssembly(Chloe.Application.CurrentAssembly.Value);

            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
 public BlogController()
 {
     this.postAppService    = AppServiceFactory.GetPostAppService();
     this.commentAppService = AppServiceFactory.GetCommentAppService();
 }
Exemplo n.º 8
0
 public AutenticationController()
 {
     this.autenticationAppService = AppServiceFactory.GetAutenticationAppService();
 }
Exemplo n.º 9
0
 public FindService()
 {
     _serviceFactoryServer = AppServiceFactory.GetInstance();
 }
Exemplo n.º 10
0
 public CommentController()
 {
     this.commentAppService = AppServiceFactory.GetCommentAppService();
 }
Exemplo n.º 11
0
 public PostController()
 {
     this.postAppService = AppServiceFactory.GetPostAppService();
 }