private void OnClick(object sender, RoutedEventArgs e) { if (BrandComboBox.SelectedItem != null) { if (ModelComboBox.SelectedItem != null) { ModelDetails = new ModelDetails() { Brand = BrandComboBox.SelectedItem.ToString(), Model = ModelComboBox.SelectedItem.ToString(), BrandId = brands[BrandComboBox.SelectedItem.ToString()], ModelId = models[ModelComboBox.SelectedItem.ToString()], }; ModelDetails.Count = carsApi.CountPages(ModelDetails.BrandId, ModelDetails.ModelId); DialogResult = true; return; } } DialogResult = false; }
public JsonResult CountPages(int brandId, int countId) { return(Json(carsApi.CountPages(brandId, countId), JsonRequestBehavior.AllowGet)); }