public virtual JsonResult Register(User model) { #region Check Email Exist var emailChecker = _userService.CheckEmailExist(model.Email); if (emailChecker.Result) { ModelState.AddModelError(nameof(model.Email), emailChecker.Message); } #endregion if (!ModelState.IsValid) { _actionResult.IsSuccessfull = false; _actionResult.Message = this.GetErrorsModelState(); return Json(_actionResult); } model.UserId = Guid.NewGuid(); var result = _userService.AddUser(model, new Tasks() { Link = Url.Action(MVC.Account.ActionNames.Profile, MVC.Account.Name, new { userId = model.UserId }), ProgressbarType = ProgressbarType.Primary, Progress = 0, Subject = LocalMessage.CompleteProfile, UserId = model.UserId, FinishDateMi = DateTime.Now.AddHours(3) }); if (result.IsSuccessfull) { result.Message = Url.Action(MVC.Dashboard.ActionNames.User, controllerName: MVC.Dashboard.Name); } return Json(result); }
public virtual JsonResult EditBasicInfo(User model) { var result = _userService.EditBasicInfo(model); if (!result.IsSuccessfull) { _actionResult.IsSuccessfull = false; _actionResult.Message = this.GetErrorsModelState(); return Json(_actionResult); } return Json(result); }
public virtual PartialViewResult Search(User model, Guid? classId) { var resultModel = _userService.GetUsers(model, classId).Result; return PartialView(MVC.User.Views.Partial._List, resultModel); }