public ActionResult DeleteConfirmed(int id) { tb_proveedores tb_proveedores = db.tb_proveedores.Find(id); db.tb_proveedores.Remove(tb_proveedores); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id_proveedor,nombre_proveedor")] tb_proveedores tb_proveedores) { if (ModelState.IsValid) { db.Entry(tb_proveedores).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tb_proveedores)); }
public ActionResult Create([Bind(Include = "id_proveedor,nombre_proveedor")] tb_proveedores tb_proveedores) { if (ModelState.IsValid) { db.tb_proveedores.Add(tb_proveedores); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tb_proveedores)); }
// GET: proveedores/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tb_proveedores tb_proveedores = db.tb_proveedores.Find(id); if (tb_proveedores == null) { return(HttpNotFound()); } return(View(tb_proveedores)); }