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