public ActionResult DeleteConfirmed(int id) { PeopleCategory peopleCategory = db.PeopleCategories.Find(id); db.PeopleCategories.Remove(peopleCategory); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PeopleCategoryId,Value")] PeopleCategory peopleCategory) { if (ModelState.IsValid) { db.Entry(peopleCategory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(peopleCategory)); }
public ActionResult Create([Bind(Include = "PeopleCategoryId,Value")] PeopleCategory peopleCategory) { if (ModelState.IsValid) { db.PeopleCategories.Add(peopleCategory); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(peopleCategory)); }
public Episode() { News = new ContentCategory(); Tools = new ContentCategory(); Novices = new ContentCategory(); Videos = new ContentCategory(); Blogs = new ContentCategory(); Events = new ContentCategory(); People = new PeopleCategory(); Humor = new ContentCategory(); }
public Episode() { News = new ContentCategory(); Tools = new ContentCategory(); Novices = new ContentCategory(); Videos = new ContentCategory(); Blogs = new ContentCategory(); Events = new ContentCategory(); People = new PeopleCategory(); Humor = new ContentCategory(); }
public void DeletePeopleCategory() { PeopleCategory toDelete = repo.GetUniq(p => p.Label == "Adultes"); Assert.IsNotNull(repo.GetUniq(p => p.Label == "Adultes")); repo.Delete(toDelete); repo.Save(); Assert.IsNull(repo.GetUniq(p => p.Label == "Adultes")); Assert.IsNull(ctx.MealPriceSet.FirstOrDefault(p => p.PriceHT == 15M)); Assert.IsNull(ctx.PeopleBookingSet.FirstOrDefault(p => p.NumberOfPeople == 2)); Assert.IsNull(ctx.PricePerPersonSet.FirstOrDefault(p => p.PriceHT == 80M)); }
// GET: Admin/PeopleCategories/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PeopleCategory peopleCategory = db.PeopleCategories.Find(id); if (peopleCategory == null) { return(HttpNotFound()); } return(View(peopleCategory)); }