Exemple #1
0
        public void DeleteUserGroup()
        {
            try
            {
                CreateUserGroup();
            }
            catch (Exception) { }
            _dao.Delete(userGroupData);
            var userGroup = _dao.Read(userGroupData.IdUser, userGroupData.IdGroup);

            Assert.IsNull(userGroup);
        }
        public ActionResult Delete(int id, FormCollection collection)
        {
            var result = _userGrDao.Delete(id);

            if (result)
            {
                SetAlert("Xóa thành công", "success");
                return(RedirectToAction("Index", "UserGroup"));
            }
            else
            {
                ViewData["Error"] = "Xóa thất bại!";
                var model = _userGrDao.ViewDetail(id);
                return(View(model));
            }
        }