public async Task <IActionResult> Edit(int id, [Bind("Id,Peso,Trigo,Embalagem,Caixa,Folha,Vitamina,Lecitina,Fita,Bandeja,Energia,Lenha,Manutenção,PorcentagemVendedor,PorcentagemLucro,CustoFixo")] PrecoCusto precoCusto) { if (id != precoCusto.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(precoCusto); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrecoCustoExists(precoCusto.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(precoCusto)); }
public async Task <IActionResult> Create([Bind("Id,Peso,Trigo,Embalagem,Caixa,Folha,Vitamina,Lecitina,Fita,Bandeja,Energia,Lenha,Manutenção,PorcentagemVendedor,PorcentagemLucro,CustoFixo")] PrecoCusto precoCusto) { if (ModelState.IsValid) { _context.Add(precoCusto); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(precoCusto)); }