public ActionResult <Cliente> GetCliente(Guid id) { var cliente = _clienteService.Buscar(id); if (cliente == null) { return(NotFound()); } return(cliente); }
public IActionResult Editar(Guid id) { try { if (!_session.Get <Cliente>("cliente").Login.Administrador) { return(RedirectToAction("VoltarAoSite")); } } catch { return(RedirectToAction("VoltarAoSite")); } return(View(_clienteService.Buscar(id))); }
// GET: Cliente/Details/5 public ActionResult Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } try { Cliente cliente = service.Buscar(id); ClienteViewModel clienteVM = Mapper.Map <Cliente, ClienteViewModel>(cliente); return(View(clienteVM)); } catch (BusinessException) { return(HttpNotFound()); } }
public IActionResult Editar(Guid id) { try { if (_session.Get <Cliente>("cliente").Email != "*****@*****.**") { return(RedirectToAction("VoltarAoSite")); } } catch { return(RedirectToAction("VoltarAoSite")); } var cliente = _clienteService.Buscar(id); return(View(cliente)); }
public ActionResult <IEnumerable <Album> > GetAlbumClient(Guid id) { var cliente = _clienteService.Buscar(id); if (cliente == null) { return(NotFound()); } return(Ok(JsonConvert.SerializeObject(_albumService.BuscarTodosDoCliente(cliente)))); }
public IQueryable <Cliente> Buscar(Expression <Func <Cliente, bool> > predicado) { return(_clienteService.Buscar(predicado)); }