public JsonResult DeleteUser(int id) { _userRepository.Delete(id); return(Json(new { valid = true, Message = "User was deleted Succesfully", redirect = "/User/AdminIndex" })); }
public bool Delete(USERP uSERP) { var userps = _userProductRepository.FindByUsertId(uSERP.Id); if (userps.Any()) { foreach (var userp in userps) { var _use = new UserProduct { Id = userp.Id }; _userProductRepository.Delete(_use); } } return(_uSERRepository.Delete(uSERP) > 0); }