// GET: Cliente/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Cliente cliente = _Repository.Selecionar(id); if (cliente == null) { return(HttpNotFound()); } return(View(cliente)); }
// GET: Venda/Edit/5 public ActionResult Edit(int id) { Venda v = _RepositoryVenda.Selecionar(id); List <VendaProduto> oListVendaProduto = _RepositoryVendaProduto.SelecionarIdVenda(id); decimal valorTotal = 0; foreach (var i in oListVendaProduto) { valorTotal += i.VeP_PrecoVenda; } VendaView vw = new VendaView(); Cliente c = new Cliente(); c = _RepositoryCliente.Selecionar(v.ID_Cli); vw.Ven_ID = v.Ven_ID; vw.Nome = c.Cli_Nome; vw.ID_Cli = v.ID_Cli; //vw.ValorTotal = valorTotal; ViewBag.ValorTotal = valorTotal; ListaProdutos(v.Ven_ID); ViewBag.VendaCriada = v.Ven_ID; return(View(vw)); }
public CadastroCliente Selecionar(string Codigo) { return(_Repository.Selecionar(Codigo)); }