private void searchLookUpCard_EditValueChanged(object sender, EventArgs e) { if (searchLookUpCard.EditValue == null || Convert.ToInt32(searchLookUpCard.EditValue) == 0) { return; } grpLines.Enabled = true; int cardId = Convert.ToInt32(searchLookUpCard.EditValue); itemPrices = OperationHandler.GetItemPricesByCard(cardId).Value; CardView card = dataHolder.Cards.Where(x => x.Id == Convert.ToInt32(searchLookUpCard.EditValue)).First(); Currency currency = dataHolder.Currencies.Where(x => x.Id == card.CurrencyId).First(); lblCurrencyName.Text = currency.CurrencyName; Operation <CurrencyByDate> currencyByDateOperation = OperationHandler.GetCurrencyLastValue(currency.Id); if (currencyByDateOperation.Successful) { spCurrencyRate.Value = currencyByDateOperation.Value.Rate; } Fiche.CurrencyId = currency.Id; }