Пример #1
0
 public ActionResult AtualizarStatus(int?id)
 {
     if (id == null)
     {
         return(NotFound());
     }
     ViewBag.Status         = StatusVenda.GetStatusVenda();
     ViewBag.FormaPagamento = FormaPagamento.GetFormaPagamento();
     return(View(Mapper.Map <Venda, VendaViewModel>(_vendaService.GetById((int)id))));
 }
Пример #2
0
        public ActionResult Pedidos()
        {
            var userId = new Guid(User.FindFirstValue(ClaimTypes.NameIdentifier));
            var vendas = _vendaService.GetByCustomer(userId);

            if (vendas == null)
            {
                return(NotFound());
            }
            ViewBag.Status         = StatusVenda.GetStatusVenda();
            ViewBag.FormaPagamento = FormaPagamento.GetFormaPagamento();
            return(View(Mapper.Map <IEnumerable <Venda>, IEnumerable <VendaViewModel> >(vendas)));
        }
Пример #3
0
        public ActionResult Vendas()
        {
            var userId = new Guid(User.FindFirstValue(ClaimTypes.NameIdentifier));
            var vendas = _vendaService.GetBySeller(userId);

            if (vendas == null)
            {
                return(NotFound());
            }
            ViewBag.Avaliacao      = _vendaService.RateById(userId).ToString().Replace(',', '.');
            ViewBag.Status         = StatusVenda.GetStatusVenda();
            ViewBag.FormaPagamento = FormaPagamento.GetFormaPagamento();
            return(View(Mapper.Map <IEnumerable <Venda>, IEnumerable <VendaViewModel> >(vendas)));
        }
Пример #4
0
        public ActionResult AvaliarVendedor(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var vendas = _vendaService.GetById((int)id);

            if (vendas == null)
            {
                return(NotFound());
            }
            ViewBag.Status         = StatusVenda.GetStatusVenda();
            ViewBag.FormaPagamento = FormaPagamento.GetFormaPagamento();
            return(View(Mapper.Map <Venda, VendaViewModel>(vendas)));
        }
Пример #5
0
        public ActionResult Comprar(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var anuncio = _anuncioService.GetById((int)id);

            if (anuncio == null)
            {
                return(NotFound());
            }
            ViewBag.FormaPagamento = FormaPagamento.GetFormaPagamento();
            var cliente = _usuarioService.GetById(new Guid(User.FindFirstValue(ClaimTypes.NameIdentifier)));
            var venda   = new Venda {
                VendedorId = anuncio.UsuarioId, ClienteId = cliente.Id, Cliente = cliente,
                Anuncio    = anuncio, AnuncioId = anuncio.Id, Vendedor = anuncio.Usuario
            };

            return(View(Mapper.Map <Venda, VendaViewModel>(venda)));
        }