public async Task <ActionResult> EditTimeZone(ProfileEditTimeZoneModel model) { if (!ModelState.IsValid) { if (model.TimeZones == null) { model.TimeZones = GetTimeZones(string.IsNullOrEmpty(model.TimeZoneId)); } return(View(model)); } try { var svcTimeZoneData = new MUser_UpdateTimeZone() { TimeZoneId = model.TimeZoneId }; await UserMicroService.UpdateTimeZoneAsync(GetUserId(), svcTimeZoneData); UserLocale.RemoveFrom(HttpContext); AddFeedbackMessage(Feedback.FeedbackMessageTypes.Informational, "Timezone changed."); return(RedirectToAction("Index")); } catch (ServiceException ex) { AddModelErrors(ex); return(View()); } }
public async Task <ActionResult> EditTimeZone() { var svcProfileDetailData = await UserMicroService.GetUserAsync(GetUserId()); var model = new ProfileEditTimeZoneModel() { TimeZoneId = svcProfileDetailData.TimeZoneId }; model.TimeZones = GetTimeZones(string.IsNullOrEmpty(model.TimeZoneId)); return(View(model)); }