public async Task EditPersonInfoAsync(ClaimsPrincipal user, PersonInfoBindingModel model) { var dbUser = await this.userManager.GetUserAsync(user); this.mapper.Map(model, dbUser); await this.DbContext.SaveChangesAsync(); }
public async Task <IActionResult> Edit(PersonInfoBindingModel model) { if (ModelState.IsValid == false) { this.AddStatusMessage(ModelState); return(this.View()); } await this.userProfileService.EditPersonInfoAsync(this.User, model); this.AddStatusMessage("Succesfully Edited", ControllerConstats.MessageTypeSuccess); return(this.RedirectToAction("Index")); }
public async Task <IActionResult> Edit(PersonInfoBindingModel input) { if (!ModelState.IsValid) { return(this.NotFound()); } var newDate = DateTime.Parse(input.QuarantineEndDate); await peopleService.EditAsync(input.Id, input.Name, input.UCN, input.City, newDate); return(this.Ok()); }