public async Task <ActionResult> DeleteConfirmed(int id) { NumFornecimentosPorEmpresa numFornecimentosPorEmpresa = await db.NumFornecimentosPorEmpresa.FindAsync(id); db.NumFornecimentosPorEmpresa.Remove(numFornecimentosPorEmpresa); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "FornecedorID,RazaoSocial,NumFornecimentos")] NumFornecimentosPorEmpresa numFornecimentosPorEmpresa) { if (ModelState.IsValid) { db.Entry(numFornecimentosPorEmpresa).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(numFornecimentosPorEmpresa)); }
public async Task <ActionResult> Create([Bind(Include = "FornecedorID,RazaoSocial,NumFornecimentos")] NumFornecimentosPorEmpresa numFornecimentosPorEmpresa) { if (ModelState.IsValid) { db.NumFornecimentosPorEmpresa.Add(numFornecimentosPorEmpresa); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(numFornecimentosPorEmpresa)); }
// GET: NumFornecimentosPorEmpresas/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NumFornecimentosPorEmpresa numFornecimentosPorEmpresa = await db.NumFornecimentosPorEmpresa.FindAsync(id); if (numFornecimentosPorEmpresa == null) { return(HttpNotFound()); } return(View(numFornecimentosPorEmpresa)); }
// GET: NumFornecimentosPorEmpresas/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NumFornecimentosPorEmpresa numFornecimentosPorEmpresa = await db.NumFornecimentosPorEmpresa.FindAsync(id); var b = new List <TodosFornecimentos_Result>(); var c = new NumForViewModel(); c.ListaFornecimentos = new List <TodosFornecimentos_Result>(); foreach (var item in db.TodosFornecimentos(numFornecimentosPorEmpresa.FornecedorID)) { c.ListaFornecimentos.Add(item); } if (numFornecimentosPorEmpresa == null) { return(HttpNotFound()); } return(View(c)); }