Ejemplo n.º 1
0
        public ActionResult Index()
        {
            AccessTokenService service = new AccessTokenService();
            service.UpdateToken();

            return View();
        }
Ejemplo 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);
        }