public List <CurrencyUnit> GetCurrencyUnitsByCurrency(string language, string currencyID) { List <CurrencyUnit> theList = new List <CurrencyUnit>(); CurrencyUnit theData = null; try { CurrencyDS.CurrencyUnitsForCurrencyDataTable theTable = theAdapter.GetCurrencyUnitByCurrency(language, currencyID); if (theTable != null && theTable.Rows.Count > 0) { foreach (CurrencyDS.CurrencyUnitsForCurrencyRow theRow in theTable.Rows) { theData = FillRecord(theRow); theList.Add(theData); } } } catch (Exception exc) { log.Error("Ocurrió un error al obtener la lista de CurrencyUnits de la Base de Datos", exc); throw exc; } return(theList); }
public void CreateCurrencyUnits() { List <CurrencyUnits> cu = new List <CurrencyUnits>(); CurrencyDSTableAdapters.CurrencyUnitsForCurrencyTableAdapter ta = new CurrencyDSTableAdapters.CurrencyUnitsForCurrencyTableAdapter(); CurrencyDS.CurrencyUnitsForCurrencyDataTable table = ta.GetCurrencyUnitsForCurrencies("EN"); foreach (CurrencyDS.CurrencyUnitsForCurrencyRow row in table) { cu.Add(new CurrencyUnits(row.currencyID, row.currencyUnitID)); } currencies = cu.ToArray(); }
public CurrencyUnit GetCurrencyUnitsById(string language, string currencyId, string currencyUnitId) { CurrencyUnit theData = null; try { CurrencyDS.CurrencyUnitsForCurrencyDataTable theTable = theAdapter.GetCurrencyUnitByID(language, currencyId, currencyUnitId); if (theTable != null && theTable.Rows.Count > 0) { theData = FillRecord(theTable[0]); } } catch (Exception exc) { log.Error("Ocurrió un error al obtener un CurrencyUnit de la Base de Datos", exc); throw exc; } return(theData); }