busqueda de productos

This commit is contained in:
carlos
2024-01-31 21:06:44 -06:00
parent 50722c2234
commit b7bfa356a2
7 changed files with 56 additions and 8 deletions
+21
View File
@@ -439,5 +439,26 @@ namespace compabetov2.database
return resumen;
}
public static List<Producto> conseguirProductosFiltrados(string nombreProducto) {
List<Producto> productos = new List<Producto>();
SQLiteDataReader reader = DAO.conseguirProductosFiltradosDAO(nombreProducto);
while (reader.Read())
{
Producto producto = new Producto(
int.Parse(reader["idproducto"].ToString()),
reader["nombre"].ToString(),
reader["descripcion"].ToString(),
decimal.Parse(reader["precio"].ToString()),
reader["img"].ToString(),
int.Parse(reader["stock"].ToString())
);
productos.Add(producto);
}
return productos;
}
}
}