public ActionResult DisLiked(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DanceFormsDetail danceForm = _danceFormsDatabase.DanceFormsDetails.Find(id); if (danceForm == null) { return(HttpNotFound()); } if (danceForm.DisLikesNo == null) { danceForm.DisLikesNo = 0; } danceForm.DisLikesNo = danceForm.DisLikesNo + 1; if (ModelState.IsValid) { _danceFormsDatabase.Entry(danceForm).State = EntityState.Modified; _danceFormsDatabase.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Exclude = "Id")] DanceFormsDetail danceForm) { if (ModelState.IsValid) { _danceFormsDatabase.DanceFormsDetails.Add(danceForm); _danceFormsDatabase.SaveChanges(); return(RedirectToAction("Index")); } return(View()); }
public ActionResult Delete(DanceFormsDetail danceForm) { if (ModelState.IsValid) { _danceFormsDatabase.Entry(danceForm).State = EntityState.Modified; _danceFormsDatabase.DanceFormsDetails.Remove(danceForm); _danceFormsDatabase.SaveChanges(); return(RedirectToAction("Index")); } return(View()); }
public ActionResult Edit(DanceFormsDetail danceForm) { if (ModelState.IsValid) { _danceFormsDatabase.Entry(danceForm).State = EntityState.Modified; _danceFormsDatabase.SaveChanges(); return(RedirectToAction("Details/" + danceForm.Id)); } return(View()); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DanceFormsDetail danceForm = _danceFormsDatabase.DanceFormsDetails.Find(id); if (danceForm == null) { return(HttpNotFound()); } return(View(danceForm)); }