Ejemplo n.º 1
0
 public ActionResult DeleteFAQ(int id = 0)
 {
     var FAQToDelete = new ModelContext().FAQSet.Where(p => p.Id == id).Single();
     context.FAQSet.Remove(FAQToDelete);
     context.SaveChanges();
     return RedirectToActionPermanent("FAQ", "Admin");
 }
Ejemplo n.º 2
0
        public ActionResult FAQ()
        {
            ViewBag.Message = "Frequently Asked Questions";
            ViewBag.Title = "FAQ";

            var questions = new ModelContext().FAQSet.ToList();

            return View(questions);
        }
Ejemplo n.º 3
0
 public ActionResult DetailsCategory(int id)
 {
     var categoryToView = new ModelContext().Categories.Include(p => p.Children).Where(p => p.Id == id).Single();
     context.Entry(categoryToView).State=EntityState.Modified;
     return View(categoryToView);
 }