public ActionResult Erase(int id) { CuboEstoque cuboEstoque = db.CubosEstoque.Find(id); db.CubosEstoque.Remove(cuboEstoque); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Apelido,Descricao,ClasseCusto,Quantidade")] CuboEstoque cuboEstoque) { if (ModelState.IsValid) { db.Entry(cuboEstoque).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cuboEstoque)); }
public ActionResult Create([Bind(Include = "Id,Apelido,Descricao,ClasseCusto,Quantidade")] CuboEstoque cuboEstoque) { if (ModelState.IsValid) { db.CubosEstoque.Add(cuboEstoque); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cuboEstoque)); }
// GET: CuboEstoques/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CuboEstoque cuboEstoque = db.CubosEstoque.Find(id); if (cuboEstoque == null) { return(HttpNotFound()); } return(View(cuboEstoque)); }
public ActionResult DeleteConfirmed(int id) { CuboEstoque cuboEstoque = db.CubosEstoque.Find(id); return(View("Erase", cuboEstoque)); }