示例#1
0
        public ActionResult Create(Slide slide)
        {
            //SetViewBag();
            if (ModelState.IsValid)
            {
                var dao         = new SlideDAO();
                var UserSession = (UserSession)Session[CommondConstant.USER_SESSION];
                slide.CreatedBy = UserSession.Username;

                if (dao.InsertSlide(slide))
                {
                    SetAlert("Add the new slide sucessfully!", "success");
                    return(RedirectToAction("Index", "Slide"));
                }
                else
                {
                    ModelState.AddModelError("", "An error when add the Slide!");
                }
            }

            return(View());
        }