public bool SaveMyProfileAddress(MyProfileAddressViewModel model) { bool result = false; try { var user = _userRepo.Get(model.UserId); if (user != null) {/* * user.Adress1 = model.Adress1; * user.Adress2 = model.Adress2; * user.CountryId = model.CountryId; * user.CountryId = model.CountryId; * user.ProvinceId = model.ProvinceId; */ _userRepo.Edit(user); result = _userRepo.Save(); } } catch (Exception e) { result = false; Commons.Logger.GenerateError(e, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "model.UserId = " + model.UserId); } return(result); }
public MyProfileAddressViewModel GetMyProfileAddressViewModel(int UserId) { MyProfileAddressViewModel model = new MyProfileAddressViewModel(); try { var user = _userRepo.Get(UserId); if (user != null) { model.UserId = user.Id; /* * model.CountryId = user.CountryId; * model.ProvinceId = user.ProvinceId; * model.Adress1 = user.Adress1; * model.Adress2 = user.Adress2; * model.Adress3 = user.Adress3; */ } model.ProvinceList = _provinceService.GetProvinceList(model.CountryId); model.CountryList = _countryService.GetCountryList(); } catch (Exception e) { Commons.Logger.GenerateError(e, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "UserId = " + UserId); } return(model); }