Beispiel #1
0
        public ActionResult Index()
        {
            Home home = new Home();

            try
            {
                if (User.Identity.IsAuthenticated)
                {
                    // Carrega o cardápio

                    LancheService lancheService = new LancheService();
                    home.Lanches = lancheService.List();

                    OpcionalService opcionalService = new OpcionalService();
                    home.Opcionais = opcionalService.List();

                    BebidaService bebidaService = new BebidaService();
                    home.Bebidas = bebidaService.List();
                }
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
            }

            return View(home);
        }
        //
        // GET: /Lanche/
        public ViewResult Index()
        {
            IList<Lanche> lanches = null;

            try
            {
                LancheService lancheService = new LancheService();
                lanches = lancheService.List();
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
            }

            return View(lanches);
        }
 public IList<Lanche> Get()
 {
     LancheService lancheService = new LancheService();
     return lancheService.List();
 }