public void CreateUserLog() { Assert.AreEqual(0, _logContext.LogList.Count); User user = new Volunteer(14, "Wesley", "Martens", "Drenthelaan 1", "Drenthe", "2101SZ", "*****@*****.**", DateTime.Now, User.Gender.Man, true, User.AccountType.Professional, "1111"); _logLogic.CreateUserLog(user.UserId, user); Assert.AreEqual(14, _logContext.LogList[0].UserId); User user2 = new Volunteer(15, "Boaz", "Martens", "Drenthelaan 1", "Drenthe", "2101SZ", "*****@*****.**", DateTime.Now, User.Gender.Man, false, User.AccountType.Professional, "1111"); _logLogic.CreateUserLog(user2.UserId, user2); Assert.AreEqual(15, _logContext.LogList[1].UserId); }
public ActionResult BlockUser(int id) { User updatedUser = _userLogic.GetUserById(id); updatedUser.Status = !updatedUser.Status; _userLogic.EditUser(updatedUser, ""); _logLogic.CreateUserLog(Convert.ToInt32(Request.Cookies["id"]), updatedUser); return(RedirectToAction("UserOverview")); }
public ActionResult BlockUser(int userId) { User updatedUser = _userLogic.GetUserById(userId); updatedUser.Status = !updatedUser.Status; _userLogic.EditUser(updatedUser, ""); _logLogic.CreateUserLog(userId, updatedUser); return(RedirectToAction("Logout")); }
public ActionResult BlockUser(int id) { int userId = int.Parse(User.Claims.FirstOrDefault(c => c.Type == System.Security.Claims.ClaimTypes.Sid).Value); User updatedUser = _userLogic.GetUserById(id); updatedUser.Status = !updatedUser.Status; _userLogic.EditUser(updatedUser, ""); _logLogic.CreateUserLog(userId, updatedUser); return(RedirectToAction("UserOverview")); }