public ActionResult SettingDetails(SettingBasicPostViewModel model) { var repo = new Repository<UserModel>(DbCollection.User); var user = GetOwnerUser(); user.Personal = true; user.AdditionalInfo = model.User.AdditionalInfo; user.Modified = DateTime.Now.ToString(); repo.Update(user); // Update ShareSetting var repoShare = new Repository<ShareSettingModel>(DbCollection.ShareSetting); var share = repoShare.Gets().First(m => m.UserId.Equals(User.Identity.GetUserId())); share.Detail = model.ShareSetting.Detail; repoShare.Update(share); return Json(new { result = true, model }); }
public ActionResult SettingBasicInfo(SettingBasicPostViewModel model) { var repo = new Repository<UserModel>(DbCollection.User); var user = GetOwnerUser(); user.Personal = true; user.Birthday = model.User.Birthday; user.Gender = model.User.Gender; user.NewGender = user.Gender == "Custom" ? model.User.NewGender : string.Empty; user.CountryId = model.User.CountryId; user.Country = model.User.Country; user.CityId = model.User.CityId; user.City = model.User.City; user.Modified = DateTime.Now.ToString(); repo.Update(user); // Update ShareSetting var repoShare = new Repository<ShareSettingModel>(DbCollection.ShareSetting); var share = repoShare.Gets().First(m => m.UserId.Equals(User.Identity.GetUserId())); share.Birthday = model.ShareSetting.Birthday; share.Gender = model.ShareSetting.Gender; share.Country = model.ShareSetting.Country; share.City = model.ShareSetting.City; repoShare.Update(share); return Json(new { result = true, model }); }