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