public ActionResult Recalculate(CalculationsViewModel1.FirstCalculation calcultionInputs) { calcultionInputs.AddressCountry = GetSelectListItems(GetAllAddressCountries()); calcultionInputs.WorkCountry = GetSelectListItems(GetAllWorkCountries()); calcultionInputs.PerTime = GetSelectListItems(GetAllPerTime()); calcultionInputs.Currency = GetSelectListItems(GetAllCurrencies()); var client = new NodeCommunication(); calcultionInputs.CalculationResult = client.SendSecondCalculation(calcultionInputs); return(this.Json(new { success = true, result = calcultionInputs.CalculationResult })); }
public ActionResult Index(CalculationsViewModel1.FirstCalculation calcultionInputs) { calcultionInputs.AddressCountry = GetSelectListItems(GetAllAddressCountries()); calcultionInputs.WorkCountry = GetSelectListItems(GetAllWorkCountries()); calcultionInputs.PerTime = GetSelectListItems(GetAllPerTime()); calcultionInputs.Currency = GetSelectListItems(GetAllCurrencies()); if (!ModelState.IsValid) { return(View("Index", calcultionInputs)); } var client = new NodeCommunication(); calcultionInputs.CalculationResult = client.SendFirstCalculation(calcultionInputs); return(this.Json(new { success = true, result = calcultionInputs.CalculationResult })); }