コード例 #1
0
 public ActionResult Edit(ProfileUpdateView model)
 {
     if (ModelState.IsValid)
     {
         model = _taService.UpdateProfile(model);
         if (model.Success)
         {
             CurrentTravelerProfileCache = null;
             if (Request.IsAjaxRequest()) return Json(model);
             TempData["NotificationMessage"] = R.String.SuccessMessages.SuccessProfileUpdate;
             return RedirectToAction("Edit");
         }
         else
         {
             ModelState.AddModelError("", model.ResponseMessage);
         }
     }
     //TODO: handle situation when model is not valid and return proper error for ajax calls
     return View(model);
 }
コード例 #2
0
 public ProfileUpdateView UpdateProfile(ProfileUpdateView view)
 {
     UpdateProfileRequest request = (UpdateProfileRequest)GetMappedObject(view, typeof(UpdateProfileRequest));
     return (ProfileUpdateView)GetMappedObject(_travelersAroundService.UpdateProfile(request), typeof(ProfileUpdateView));
 }