Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PeopleCategory peopleCategory = db.PeopleCategories.Find(id);

            db.PeopleCategories.Remove(peopleCategory);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 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));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "PeopleCategoryId,Value")] PeopleCategory peopleCategory)
        {
            if (ModelState.IsValid)
            {
                db.PeopleCategories.Add(peopleCategory);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(peopleCategory));
        }
Exemple #4
0
        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();
        }
Exemple #5
0
        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();
        }
Exemple #6
0
        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));
        }
Exemple #7
0
        // 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));
        }