public JsonResult GetAvailableStates(GetAvailableStatesInputModel model) { try { Assert.ArgumentNotNull(model, "model"); var validationResult = new BaseJsonResult(); this.ValidateModel(validationResult); if (validationResult.HasErrors) { return(Json(validationResult, JsonRequestBehavior.AllowGet)); } var response = this.OrderManager.GetAvailableRegions(CurrentStorefront, CurrentVisitorContext, model.CountryCode); var result = new AvailableStatesBaseJsonResult(response.ServiceProviderResult); if (response.ServiceProviderResult.Success && response.Result != null) { result.Initialize(response.Result); } return(Json(result, JsonRequestBehavior.AllowGet)); } catch (Exception e) { CommerceLog.Current.Error("GetAvailableStates", this, e); return(Json(new BaseJsonResult("GetAvailableStates", e), JsonRequestBehavior.AllowGet)); } }
public AvailableStatesBaseJsonResult GetAvailableStates(GetAvailableStatesInputModel model) { var response = this._orderManager.GetAvailableRegions(CurrentStorefront, CurrentVisitorContext, model.CountryCode); var result = new AvailableStatesBaseJsonResult(response.ServiceProviderResult); if (response.ServiceProviderResult.Success && response.Result != null) { result.Initialize(response.Result); } return(result); }