Esempio n. 1
0
        void IActionFilter.OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (Brands == null)
            {
                BrandService service = new BrandService();
                Brands = service.GetListBrand();
            }
            filterContext.Controller.ViewBag.Brands = Brands;
            filterContext.Controller.ViewBag.LinkService = LinkService;

            this.OnActionExecuting(filterContext);
        }
Esempio n. 2
0
        void IActionFilter.OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (Brands == null)
            {
                try
                {
                    BrandService service = new BrandService();
                    Brands = service.GetListBrand();
                }
                catch (Exception)
                {
                    AccessTokenService tkService = new AccessTokenService();
                    tkService.UpdateToken();

                    BrandService service = new BrandService();
                    Brands = service.GetListBrand();
                }
            }
            filterContext.Controller.ViewBag.Brands = Brands;
            filterContext.Controller.ViewBag.LinkService = LinkService;

            this.OnActionExecuting(filterContext);
        }