Esempio n. 1
0
        public ActionResult Index2(string id = "")
        {
            if (!Context.Routes.Any(x => x.Shortcut == id))
            {
                var data     = new IndexViewData();
                var mainwall = _wallService.GetMainWall();
                data.MainWall = mainwall.ToList();

                return(View(data));
            }

            var elem = Context.Routes.Single(x => x.Shortcut == id);

            elem.AddView();
            Context.SaveChanges();
            return(View(elem));
        }
Esempio n. 2
0
        public ActionResult Index(string id = "")
        {
            if (!Context.Routes.Any(x => x.Shortcut == id && x.Active))
            {
                var data     = new IndexViewData();
                var mainwall = _wallService.GetMainWall();
                data.MainWall      = mainwall.ToList();
                data.Masterclasses = _masterclassService.GetNearestMasterclasses();

                return(View(data));
            }

            var elem = Context.Routes
                       .Include(x => x.Raiting)
                       .Single(x => x.Shortcut == id && x.Active);

            this.SetRoute(elem);

            elem.AddView();
            Context.SaveChanges();

            return(View(elem));
        }