Example #1
0
        public ActionResult <Cliente> GetCliente(Guid id)
        {
            var cliente = _clienteService.Buscar(id);

            if (cliente == null)
            {
                return(NotFound());
            }

            return(cliente);
        }
Example #2
0
 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)));
 }
Example #3
0
 // 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());
     }
 }
Example #4
0
        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));
        }
Example #5
0
        public ActionResult <IEnumerable <Album> > GetAlbumClient(Guid id)
        {
            var cliente = _clienteService.Buscar(id);

            if (cliente == null)
            {
                return(NotFound());
            }

            return(Ok(JsonConvert.SerializeObject(_albumService.BuscarTodosDoCliente(cliente))));
        }
Example #6
0
 public IQueryable <Cliente> Buscar(Expression <Func <Cliente, bool> > predicado)
 {
     return(_clienteService.Buscar(predicado));
 }