public static List <Almacen> GetListaAlmacen() { List <Almacen> theList = new List <Almacen>(); Almacen theData = null; try { AlmacenDSTableAdapters.AlmacenTableAdapter localAdapter = new AlmacenDSTableAdapters.AlmacenTableAdapter(); AlmacenDS.AlmacenDataTable table = localAdapter.GetListaAlmacen(); if (table != null && table.Rows.Count > 0) { foreach (var row in table) { theData = FillReccord(row); theList.Add(theData); } } } catch (Exception q) { throw new ArgumentException(q.Message, q); } return(theList); }
public static Almacen GetAlmacenById(int AlmacenId) { Almacen theData = null; try { AlmacenDSTableAdapters.AlmacenTableAdapter localAdapter = new AlmacenDSTableAdapters.AlmacenTableAdapter(); AlmacenDS.AlmacenDataTable table = localAdapter.GetAlmacenById(AlmacenId); if (table != null && table.Rows.Count > 0) { AlmacenDS.AlmacenRow row = table[0]; theData = FillReccord(row); } } catch (Exception q) { throw new ArgumentException(q.Message, q); } return(theData); }