/// <summary> /// Llena el combox currency /// </summary> /// <history> /// [emoguel] created 22/04/2016 /// [erosado] 19/05/2016 Modified. Se agregó asincronía /// </history> private async void LoadCurrency() { try { List <Currency> lstCurrency = await BRCurrencies.GetCurrencies(); if (enumMode == EnumMode.Search && lstCurrency.Count > 0) { lstCurrency.Insert(0, new Currency { cuID = "", cuN = "ALL" }); } cmbsrcu.ItemsSource = lstCurrency; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Llena el grid de currencies aplicando los filtros que se tengan /// </summary> /// <history> /// [Emoguel] created 08/03/2016 /// [erosado] 19/05/2016 Modified. Se agregó asincronía /// </history> protected async void LoadCurrencies(Currency currency = null) { try { status.Visibility = Visibility.Visible; int nIndex = 0; List <Currency> lstCurrencies = await BRCurrencies.GetCurrencies(_currencyFilter, _nStatus); dgrCurrencies.ItemsSource = lstCurrencies; if (currency != null && lstCurrencies.Count > 0) { currency = lstCurrencies.Where(cu => cu.cuID == currency.cuID).FirstOrDefault(); nIndex = lstCurrencies.IndexOf(currency); } GridHelper.SelectRow(dgrCurrencies, nIndex); StatusBarReg.Content = lstCurrencies.Count + " Currencies."; status.Visibility = Visibility.Collapsed; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
private async Task LoadCurrencies() { var result = await BRCurrencies.GetCurrencies(nStatus : 1); Currencies = result; }