public IActionResult Create()
        {
            try
            {
                if (!_session.Get <Cliente>("cliente").Login.Administrador)
                {
                    return(RedirectToAction("VoltarAoSite"));
                }
            }
            catch
            {
                return(RedirectToAction("VoltarAoSite"));
            }
            var albuns = _albumService.BuscarTodos();

            ViewBag.Albuns = albuns;

            return(View());
        }
Esempio n. 2
0
 public IActionResult Index()
 {
     if (_session.GetString("Alertas") != null)
     {
         ViewBag.Alerta = _session.GetString("Alertas");
         _session.Remove("Alertas");
     }
     try
     {
         if (!_session.Get <Cliente>("cliente").Login.Administrador)
         {
             return(RedirectToAction("VoltarAoSite"));
         }
     }
     catch
     {
         return(RedirectToAction("VoltarAoSite"));
     }
     return(View(_albumService.BuscarTodos()));
 }
Esempio n. 3
0
        public IActionResult Create()
        {
            try
            {
                if (_session.Get <Cliente>("cliente").Email != "*****@*****.**")
                {
                    return(RedirectToAction("VoltarAoSite"));
                }
            }
            catch
            {
                return(RedirectToAction("VoltarAoSite"));
            }

            var albuns = _albumService.BuscarTodos();

            ViewBag.Albuns = albuns;

            return(View());
        }
        public IActionResult Index()
        {
            if (_session.GetString("Alertas") != null)
            {
                ViewBag.Alerta = _session.GetString("Alertas");
                _session.Remove("Alertas");
            }
            try
            {
                if (_session.Get <Cliente>("cliente").Email != "*****@*****.**")
                {
                    return(RedirectToAction("VoltarAoSite"));
                }
            }
            catch
            {
                return(RedirectToAction("VoltarAoSite"));
            }

            var model = _albumService.BuscarTodos();

            return(View(model));
        }
Esempio n. 5
0
 public ActionResult <IEnumerable <Album> > GetAlbuns()
 {
     return(Ok(JsonConvert.SerializeObject(_albumService.BuscarTodos())));
 }