Exemplo n.º 1
0
        // GET: Admin/Faq
        public ActionResult ListFaq()
        {
            FaqModel _faqModel = new FaqModel();
            _faqModel.FaqList = _faqService.GetAll().ToList();

            return View(_faqModel);
        }
Exemplo n.º 2
0
        public ActionResult FaqEdit(FaqModel model)
        {
            int id = int.Parse(Request.Form["hfId"]);
            Faq faq = _faqService.Find(id);

            faq.Active = model.Active;
            faq.Content = model.Content;
            faq.Order = model.Order;
            faq.Title = model.Title;

            _faqService.Update(faq);
            _uow.SaveChanges();

            return RedirectToAction("ListFaq");
        }
Exemplo n.º 3
0
        public ActionResult Edit(int id)
        {
            Faq faq = _faqService.Find(id);

            FaqModel _faqModel = new FaqModel
            {
                Id = faq.Id,
                Active = faq.Active,
                Content = faq.Content,
                Order = faq.Order,
                Title = faq.Title
            };

            return View(_faqModel);
        }
Exemplo n.º 4
0
        public ActionResult FaqAdd(FaqModel model)
        {
            Faq faq = new Faq
            {
                Id = model.Id,
                Active = model.Active,
                Content = model.Content,
                Order = model.Order,
                Title = model.Title
            };

            _faqService.Insert(faq);
            _uow.SaveChanges();

            return RedirectToAction("ListFaq");
        }