public ActionResult Create(FormCollection collection)
        {
            // TODO: Add insert logic here
            if (ModelState.IsValid)
            {
                var cp = new FaqQuestion();
                // TODO: Add insert logic here
                cp.Chude = collection["Chude"];
                cp.Diachi = collection["Diachi"];
                cp.Email = collection["Email"];
                cp.Mobile = collection["Mobile"];
                cp.LoiNhan = collection["LoiNhan"];
                cp.TraLoi = collection["TraLoi"];
                cp.NgayTao = DateTime.Now;
                FaqQuestionRes.Add(cp);
                FaqQuestionRes.Save();
                return RedirectToAction("Details", new { id = cp.Question_ID });

            }
            else
            {
                return View();
            }
        }
Example #2
0
 public void Add(FaqQuestion dm)
 {
     /*  var q = (from p in en.CouPon select p).Max();
       dm.ID = q + 1;*/
     en.AddObject("FaqQuestion", dm);
 }
Example #3
0
 public void Delete(FaqQuestion dm)
 {
     en.DeleteObject(dm);
 }
 //
 // GET: /FaqQuestion/Create
 public ActionResult Create()
 {
     var cp = new FaqQuestion();
     return View(cp);
 }
Example #5
0
        public ActionResult faq(FormCollection collection)
        {
            ViewData["main"] = "mainAboutUs";
            ViewData["faq"] = "LineActiveMenu";

            // TODO: Add insert logic here
            if (ModelState.IsValid)
            {
                var cp = new FaqQuestion();
                if (TryUpdateModel(cp))
                {
                    // TODO: Add insert logic here
                    cp.Chude = collection["Chude"];
                    cp.Diachi = collection["Diachi"];
                    cp.Email = collection["Email"];
                    cp.Mobile = collection["Mobile"];
                    cp.LoiNhan = collection["LoiNhan"];
                    cp.TraLoi = collection["TraLoi"];
                    cp.NgayTao = DateTime.Now;
                    FaqQuestionRes.Add(cp);
                    FaqQuestionRes.Save();
                    ViewData["sucessFull"] = "true";
                    return View();
                }
                return View();
                //return RedirectToAction("Details", new { id = cp.Question_ID });

            }
            else
            {
                return View();
            }
        }