示例#1
0
        public ActionResult ThemMoi(UserGroup entity)
        {
            if (ModelState.IsValid)
            {
                var dao = new UserGroupDAO();

                var id = dao.Insert(entity);
                if (id == true)
                {
                    SetAlert("Thêm mới thành công", "success");
                    return(RedirectToAction("Index", "LoaiThanhVien"));
                }
                else
                {
                    SetAlert("Thêm mới không thành công", "error");
                    return(RedirectToAction("ThemMoi", "LoaiThanhVien"));
                }
            }
            return(View("Index"));
        }