/// <summary> /// Obtiene el catalogo de countries /// </summary> /// <history> /// [erosado] 20/04/2016 Created /// [erosado] 19/05/2016 Modified. Se agregó asincronía /// </history> public async void DoGetCountries() { try { List <CountryShort> data = await BRCountries.GetCountries(1); if (data.Count > 0) { data.Insert(0, new CountryShort { coN = "ANY ONE", coID = "ANY ONE" }); cbxCountry.ItemsSource = data; cbxCountry.SelectedIndex = 0; } else { cbxCountry.Text = "No data found - Press Ctrl+F5 to load Data"; } StaEnd(); } catch (Exception ex) { StaEnd(); UIHelper.ShowMessage(ex); } }
/// <summary> /// /// </summary> /// <history> /// [erosado] 19/05/2016 Modified. Se agregó asincronía /// </history> protected async void LoadCountries() { try { List <CountryShort> lstCountries = await BRCountries.GetCountries(1); cmbagco.ItemsSource = lstCountries; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Llena el combobox y el grid de countries /// </summary> /// <history> /// [emoguel] created 06/06/2016 /// </history> private async void LoadCountries() { try { List <Country> lstAllCountries = await BRCountries.GetCountries(null); cmbCountries.ItemsSource = lstAllCountries; List <Country> lstCountries = (unavailableMotive.umID > 0)? lstAllCountries.Where(co => co.coum == unavailableMotive.umID).ToList():new List <Country>(); dgrCountries.ItemsSource = lstCountries; _lstOldCountries = lstCountries.ToList(); cmbCountries.Header = "Country (" + lstCountries.Count + ")"; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Obtiene el catalogo de countries /// </summary> /// <history> /// [erosado] 08/Mar/2016 Created /// </history> public async void DoGetCountries() { try { List <CountryShort> data = await BRCountries.GetCountries(1); if (data.Any()) { lsbxCountries.ItemsSource = data; chbxCountries.IsChecked = true; } StaEnd(); } catch (Exception ex) { StaEnd(); UIHelper.ShowMessage(ex); } }
/// <summary> /// Llena el grid de countries /// </summary> /// <history> /// [Emoguel] created 14/03/2016 /// </history> private async void loadCountries(Country country = null) { try { status.Visibility = Visibility.Visible; int nIndex = 0; List <Country> lstCountries = await BRCountries.GetCountries(_countryFilter, _nStatus); dgrCountries.ItemsSource = lstCountries; if (country != null && lstCountries.Count > 0) { country = lstCountries.Where(cu => cu.coID == country.coID).FirstOrDefault(); nIndex = lstCountries.IndexOf(country); } GridHelper.SelectRow(dgrCountries, nIndex); StatusBarReg.Content = lstCountries.Count + " Countries."; status.Visibility = Visibility.Collapsed; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
private async Task LoadCountries() { var result = await BRCountries.GetCountries(1); Countries = result; }