public IActionResult Add(UserInformationVm userInformation, string token) { if (userInformation == null) { return(Ok(ResponseManager.GenerateResponse("Błąd: Informacje dla użytkownika są puste", (int)MessageType.Error, null))); } else { _service.AddUserInformation(userInformation); return(Ok(ResponseManager.GenerateResponse(null, (int)MessageType.Ok, null))); } }
public IActionResult Registration(UserInformation userInformation) { bool isUserNameExist = _userInformationService.GetUsertNameExist(userInformation.UserName); if (ModelState.IsValid && !isUserNameExist) { _userInformationService.AddUserInformation(userInformation); TempData["Success"] = "Thank you for your registration. As soon as you will receive a confirmation mail" + "in your email address. If you are unable to find it in your inbox then please check your spam folder."; return(View("Login")); } else if (isUserNameExist) { ViewBag.Error = "This user name already exist."; } else { ViewBag.Error = "something is worng"; } return(View()); }