carta para productos
This commit is contained in:
+2
-3
@@ -147,8 +147,8 @@ namespace compabetov2.database
|
||||
var db_conexion = new Conexion();
|
||||
try
|
||||
{
|
||||
using (SQLiteConnection conexion = db_conexion.get_connection())
|
||||
{
|
||||
SQLiteConnection conexion = db_conexion.get_connection();
|
||||
|
||||
conexion.Open();
|
||||
|
||||
string sql = "SELECT * FROM Producto INNER JOIN Categoria ON Producto.fk_idcategoria = Categoria.idcategoria";
|
||||
@@ -156,7 +156,6 @@ namespace compabetov2.database
|
||||
reader = command.ExecuteReader();
|
||||
|
||||
return reader;
|
||||
}
|
||||
}
|
||||
catch (SQLiteException ex) {
|
||||
MessageBox.Show(ex.Message);
|
||||
|
||||
+4
-4
@@ -26,17 +26,17 @@ namespace compabetov2.database
|
||||
while (reader.Read())
|
||||
{
|
||||
Categoria categoria = new Categoria(
|
||||
(int)reader["idcategoria"],
|
||||
int.Parse(reader["idcategoria"].ToString()),
|
||||
reader["nombre"].ToString(),
|
||||
reader["descripcion"].ToString());
|
||||
|
||||
Producto producto = new Producto(
|
||||
(int)reader["idproducto"],
|
||||
int.Parse(reader["idproducto"].ToString()),
|
||||
reader["nombre"].ToString(),
|
||||
reader["descripcion"].ToString(),
|
||||
(decimal)reader["precio"],
|
||||
decimal.Parse(reader["precio"].ToString()),
|
||||
reader["img"].ToString(),
|
||||
(int)reader["stock"],
|
||||
int.Parse(reader["stock"].ToString()),
|
||||
categoria);
|
||||
|
||||
productos.Add(producto);
|
||||
|
||||
Reference in New Issue
Block a user