Example #1
0
        public ActionResult Create(Slide slide, string tempstatus)
        {
            if (ModelState.IsValid)
            {
                if (tempstatus == "Kích Hoạt")
                {
                    slide.Status = true;
                }
                else
                {
                    slide.Status = false;
                }

                SlideDAO slideDAO = new SlideDAO();
                var      check    = slideDAO.Create(slide);
                if (check > 0)
                {
                    TempData["msg"] = MessageBox.Show("Create successfully");
                    return(RedirectToAction("Create", "Slide"));
                }
                else
                {
                    ModelState.AddModelError("", "Create fail");
                }
            }
            return(View());
        }