campos de precio de comrpa y venta agregados a las ventas

This commit is contained in:
carlos
2024-06-18 17:13:46 -06:00
parent 8ebdbf4f74
commit e489535f2f
11 changed files with 22 additions and 12 deletions
+14 -9
View File
@@ -45,10 +45,7 @@ namespace compabetov2.database
while (reader.Read())
{
Categoria categoria = new Categoria(
int.Parse(reader["idcategoria"].ToString()),
reader["nombre"].ToString(),
reader["descripcion"].ToString());
Categoria categoria = new Categoria();
Producto producto = new Producto(
int.Parse(reader["idproducto"].ToString()),
@@ -263,8 +260,9 @@ namespace compabetov2.database
while (reader.Read())
{
int idVariaante = (int)reader.GetInt64(0);
decimal precioCompra = reader.GetOrdinal("precioCompra");
DetalleCuentaModel detalleCuenta = new DetalleCuentaModel(
new Variante(idVariaante, reader["nombre"].ToString(),0,(int)reader.GetInt64(2),"",(int)reader.GetInt64(3)),
new Variante(idVariaante, reader["nombre"].ToString(),0,(int)reader.GetInt64(2),"",(int)reader.GetInt64(3), precioCompra),
(int)reader.GetInt64(4)
);
detallesCuentas.Add(detalleCuenta);
@@ -391,9 +389,10 @@ namespace compabetov2.database
while (reader.Read())
{
int idVariante = (int)reader.GetInt64(0);
decimal precioCompra = reader.GetOrdinal("precioCompra");
DetalleEnvioModel detalleEnvio = new DetalleEnvioModel(
idEnvio,
new Variante(idVariante, reader["nombre"].ToString(),0,(int)reader.GetInt64(2),"", (int)reader.GetInt64(3)),//fkproducto
new Variante(idVariante, reader["nombre"].ToString(),0,(int)reader.GetInt64(2),"", (int)reader.GetInt64(3), precioCompra),//fkproducto
(int)reader.GetInt64(4)//cantidad
);
detallesEnvio.Add(detalleEnvio);
@@ -441,6 +440,7 @@ namespace compabetov2.database
SQLiteDataReader readerDetalleVenta = DAO.conseguirDetalleVenta(venta);
while (readerDetalleVenta.Read())
{
decimal precioCompra = readerDetalleVenta.GetOrdinal("precioCompra");
DetalleVentaModel detalleVenta = new DetalleVentaModel(
(int)readerDetalleVenta.GetInt64(2),
new Variante((int)readerDetalleVenta.GetInt64(3),
@@ -448,7 +448,8 @@ namespace compabetov2.database
readerDetalleVenta.GetDecimal(5),
(int)readerDetalleVenta.GetInt64(6),
"",
(int)readerDetalleVenta.GetInt64(8))
(int)readerDetalleVenta.GetInt64(8),
precioCompra)
);
detallesVenta.Add( detalleVenta );
}
@@ -487,6 +488,7 @@ namespace compabetov2.database
int cantidadIndex = reader.GetOrdinal("cantidad");
int imgIndex = reader.GetOrdinal("img");
int fkProductoIndex = reader.GetOrdinal("fk_producto");
decimal precioCompra = reader.GetOrdinal("precioCompra");
while (reader.Read())
{
@@ -497,7 +499,8 @@ namespace compabetov2.database
reader.GetDecimal(precioIndex),
reader.GetInt32(cantidadIndex),
reader.GetString(imgIndex),
reader.GetInt32(fkProductoIndex)
reader.GetInt32(fkProductoIndex),
precioCompra
);
productos.Add(producto);
@@ -543,6 +546,7 @@ namespace compabetov2.database
while (reader.Read())
{
decimal precio = reader.GetDecimal(2);
decimal precioCompra = reader.GetDecimal(6);
int cantidad = (int)reader.GetInt64(3);
int fkProducto = (int)reader.GetInt64(5);
Variante vaiante = new Variante(
@@ -551,7 +555,8 @@ namespace compabetov2.database
precio,
cantidad,
reader["img"].ToString(),
fkProducto
fkProducto,
precioCompra
);
variantes.Add(vaiante);
}