Ejemplo n.º 1
0
        public static List <Producto> GetProductoListForSearch(string whereSql)
        {
            if (string.IsNullOrEmpty(whereSql))
            {
                whereSql = "1 = 1";
            }

            List <Producto>      theList    = new List <Producto>();
            Producto             theUser    = null;
            ProductoTableAdapter theAdapter = new ProductoTableAdapter();

            try
            {
                ProductoDS.ProductoDataTable table = theAdapter.GetProductoForSearch(whereSql);

                if (table != null && table.Rows.Count > 0)
                {
                    foreach (ProductoDS.ProductoRow row in table.Rows)
                    {
                        theUser = FillProdutowithImagenRecord(row);
                        theList.Add(theUser);
                    }
                }
            }
            catch (Exception q)
            {
                log.Error("el error ocurrio mientras obtenia la lista de los productos de la base de datos", q);
                return(null);
            }
            return(theList);
        }