public ActionResult DeleteConfirmed(int id) { SubCategoriaGS subCategoriaGS = db.SubCategoriaGS.Find(id); db.SubCategoriaGS.Remove(subCategoriaGS); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id_SubCategoria,NombreSubcategoria,IdCategoria")] SubCategoriaGS subCategoriaGS) { if (ModelState.IsValid) { db.Entry(subCategoriaGS).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdCategoria = new SelectList(db.CategoriaGS, "Id_Categoria", "Nombre", subCategoriaGS.IdCategoria); return(View(subCategoriaGS)); }
// GET: SubCategoriaGS/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SubCategoriaGS subCategoriaGS = db.SubCategoriaGS.Find(id); if (subCategoriaGS == null) { return(HttpNotFound()); } return(View(subCategoriaGS)); }
// GET: SubCategoriaGS/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SubCategoriaGS subCategoriaGS = db.SubCategoriaGS.Find(id); if (subCategoriaGS == null) { return(HttpNotFound()); } ViewBag.IdCategoria = new SelectList(db.CategoriaGS, "Id_Categoria", "Nombre", subCategoriaGS.IdCategoria); return(View(subCategoriaGS)); }