コード例 #1
0
 public ActionResult ProfileResidence(ProfileResidenceViewModel model)
 {
     var user = UserManager.FindByIdAsync(User.Identity.GetUserId());
     user.Result.CountryId = model.CountryId;
     user.Result.Country = model.Country;
     user.Result.StateCity = model.StateCity;
     var result = UserManager.UpdateAsync(user.Result);
     return Json(new { result = true, model });
 }
コード例 #2
0
 public ActionResult ProfileResidence()
 {
     var login = UserManager.FindByIdAsync(User.Identity.GetUserId());
     var repo = new Repository<CountryModel>("Country");
     var countries = repo.Gets().OrderBy(i => i.Name);
     var model = new ProfileResidenceViewModel
     {
         Country = login.Result.FirstName,
         CountryId = login.Result.CountryId,
         StateCity = login.Result.StateCity,
         CountryList = new SelectList(countries, "Id", "Name")
     };
     return PartialView("_ProfileResidencePartial", model);
 }