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()); }
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())); }
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)); }
public ActionResult <IEnumerable <Album> > GetAlbuns() { return(Ok(JsonConvert.SerializeObject(_albumService.BuscarTodos()))); }