public ActionResult InvestimentosComprados() { ClienteOpcao cop = new ClienteOpcao(); cop.cops = db.Investimentos(); return(View(cop)); }
public void InsertClienteOpcao(OpcoesInvestimento oi, Cliente c) { ClienteOpcao cop = new ClienteOpcao(); cop.ClienteId = c.Id; cop.OpcoesInvestimentoId = oi.Id; _context.cop.Add(cop); _context.SaveChanges(); }
public ActionResult Search([Bind(Include = "Nome")] string nome) { ClienteOpcao cop = new ClienteOpcao(); cop.cops = db.Search(nome); float valorTotal = 0; if (cop != null) { foreach (var item in cop.cops) { valorTotal += item.OpcoesInvestimento.valor; } ViewBag.ValorTotal = valorTotal; return(View("SearchResult", cop)); } return(View()); }