public ActionResult CreateCarrinho(Modelo.Carrinho.Carrinho carrinho, FormCollection collection)
        {
            carrinho.ClienteId = Convert.ToInt32(collection.Get("idcliente"));
            carrinho.Cliente   = clienteServico.ObterClientePorId((long)carrinho.ClienteId);
            carrinhoServico.CreateCarrinho(carrinho);
            HttpContext.Session["carrinho"] = carrinho;
            return(View("CarrinhoAddProdutos", carrinho));
//            return Content("Ok");
//            return PartialView("_CreateCarrinho", carrinho);
        }
 public Modelo.Carrinho.Carrinho CreateCarrinho(Modelo.Carrinho.Carrinho carrinho)
 {
     return(carrinhoDAL.CreateCarrinho(carrinho));
 }
示例#3
0
 public Modelo.Carrinho.Carrinho CreateCarrinho(Modelo.Carrinho.Carrinho carrinho)
 {
     context.Carrinhos.Add(carrinho);
     context.SaveChanges();
     return(carrinho);
 }