boton vender de la venta venta listo
This commit is contained in:
Binary file not shown.
File diff suppressed because one or more lines are too long
+6
-6
@@ -152,7 +152,7 @@ namespace compabetov2
|
||||
decimal totalVendidoMes = 0;
|
||||
foreach (DetalleVentaModel producto in detallesMes)
|
||||
{
|
||||
totalVendidoMes += producto.cantidad * producto.producto.precion;
|
||||
totalVendidoMes += producto.cantidad * producto.producto.precio;
|
||||
// Crear una nueva fila
|
||||
DataGridViewRow nuevaFila = new DataGridViewRow();
|
||||
|
||||
@@ -164,9 +164,9 @@ namespace compabetov2
|
||||
|
||||
// Establecer los valores de las celdas (puedes ajustar según tu necesidad)
|
||||
productoN.Value = $"{producto.producto.nombre}";
|
||||
precio.Value = $"{producto.producto.precion}";
|
||||
precio.Value = $"{producto.producto.precio}";
|
||||
cantidad.Value = $"{producto.cantidad}";
|
||||
total.Value = $"{producto.cantidad * producto.producto.precion}";
|
||||
total.Value = $"{producto.cantidad * producto.producto.precio}";
|
||||
|
||||
// Agregar las celdas a la fila
|
||||
nuevaFila.Cells.Add(productoN);
|
||||
@@ -188,7 +188,7 @@ namespace compabetov2
|
||||
decimal totalVendidoDia = 0;
|
||||
foreach (DetalleVentaModel producto in detallesDia)
|
||||
{
|
||||
totalVendidoDia += producto.cantidad * producto.producto.precion;
|
||||
totalVendidoDia += producto.cantidad * producto.producto.precio;
|
||||
// Crear una nueva fila
|
||||
DataGridViewRow nuevaFila = new DataGridViewRow();
|
||||
|
||||
@@ -200,9 +200,9 @@ namespace compabetov2
|
||||
|
||||
// Establecer los valores de las celdas (puedes ajustar según tu necesidad)
|
||||
productoN.Value = $"{producto.producto.nombre}";
|
||||
precio.Value = $"{producto.producto.precion}";
|
||||
precio.Value = $"{producto.producto.precio}";
|
||||
cantidad.Value = $"{producto.cantidad}";
|
||||
total.Value = $"{producto.cantidad * producto.producto.precion}";
|
||||
total.Value = $"{producto.cantidad * producto.producto.precio}";
|
||||
|
||||
// Agregar las celdas a la fila
|
||||
nuevaFila.Cells.Add(productoN);
|
||||
|
||||
+62
-42
@@ -25,10 +25,11 @@ namespace compabetov2
|
||||
{
|
||||
private int numeroPagina = 1; // Variable para rastrear el número de página actual
|
||||
private Point lastPoint;
|
||||
private List<Producto> productos;
|
||||
private List<Variante> productos;
|
||||
public decimal total = 0;
|
||||
private LoginModel loginPrincipal;
|
||||
private Dictionary<string, Image> imagenes = new Dictionary<string, Image>();
|
||||
private List<DetalleVentaModel> carrito = new List<DetalleVentaModel>();
|
||||
|
||||
|
||||
public vender(LoginModel loginPrincipal)
|
||||
@@ -90,7 +91,7 @@ namespace compabetov2
|
||||
public void llenarLayout()
|
||||
{
|
||||
flowLayoutPanel3.Controls.Clear();
|
||||
foreach (Producto producto in productos)
|
||||
foreach (Variante producto in productos)
|
||||
{
|
||||
|
||||
TableLayoutPanel carta = new TableLayoutPanel();
|
||||
@@ -106,7 +107,8 @@ namespace compabetov2
|
||||
PictureBox pic = new PictureBox();
|
||||
pic.Dock = DockStyle.Fill;
|
||||
pic.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
if (imagenes.ContainsKey(producto.img)) {
|
||||
if (imagenes.ContainsKey(producto.img))
|
||||
{
|
||||
pic.Image = imagenes[producto.img];
|
||||
}
|
||||
else
|
||||
@@ -118,9 +120,9 @@ namespace compabetov2
|
||||
}
|
||||
//hay error aquí
|
||||
pic.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
pic.Tag = producto.idProducto;
|
||||
pic.Tag = producto.idVariante;
|
||||
Label id = new Label();
|
||||
id.Text = producto.idProducto.ToString();
|
||||
id.Text = producto.idVariante.ToString();
|
||||
id.BackColor = Color.FromArgb(82, 82, 82);
|
||||
id.ForeColor = Color.White;
|
||||
id.Width = 20;
|
||||
@@ -129,7 +131,7 @@ namespace compabetov2
|
||||
pic.Controls.Add(id);
|
||||
|
||||
Label precio = new Label();
|
||||
precio.Text = "$" + producto.precion.ToString() + " - " + producto.nombre;
|
||||
precio.Text = "$" + producto.precio.ToString() + " - " + producto.nombre;
|
||||
precio.BackColor = Color.FromArgb(82, 82, 82);
|
||||
precio.ForeColor = Color.White;
|
||||
precio.Width = 40;
|
||||
@@ -166,19 +168,23 @@ namespace compabetov2
|
||||
int numeroContador = int.Parse(contador.Text.ToString());
|
||||
|
||||
// Validar que el contador no sea 0 antes de restar
|
||||
|
||||
if (existeTocket(producto.nombre))
|
||||
int indexCarrito = estaEnCarrito(producto.nombre);
|
||||
if (indexCarrito != -1)
|
||||
{
|
||||
contador.Text = (numeroContador - 1).ToString();
|
||||
total -= producto.precion;
|
||||
total -= producto.precio;
|
||||
label1.Text = $"Total: ${total}";
|
||||
|
||||
// Obtener información del Label id y precio
|
||||
int idProducto = int.Parse(id.Text);
|
||||
decimal precioProducto = producto.precion;
|
||||
decimal precioProducto = producto.precio;
|
||||
|
||||
// Restar al ticket existente si ya se agregó
|
||||
RestarDelTicket(idProducto, producto.nombre, precioProducto, 1);
|
||||
carrito[indexCarrito].cantidad = int.Parse(contador.Text);
|
||||
if (carrito[indexCarrito].cantidad == 0)
|
||||
{
|
||||
carrito.RemoveAt(indexCarrito);
|
||||
}
|
||||
RestarDelTicket(producto.idVariante, producto.nombre, precioProducto, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -201,19 +207,29 @@ namespace compabetov2
|
||||
btnMas.FlatAppearance.BorderSize = 0;
|
||||
btnMas.Click += new EventHandler(delegate (object sender, EventArgs e)
|
||||
{
|
||||
if(int.Parse(contador.Text.ToString()) < 0 && !existeTocket(producto.nombre)) {
|
||||
if (int.Parse(contador.Text.ToString()) < 0 && !existeTocket(producto.nombre))
|
||||
{
|
||||
contador.Text = "0";
|
||||
}
|
||||
int numeroContador = int.Parse(contador.Text.ToString());
|
||||
contador.Text = (numeroContador + 1).ToString();
|
||||
total += producto.precion;
|
||||
total += producto.precio;
|
||||
label1.Text = $"Total: ${total}";
|
||||
|
||||
// Obtener información del Label id y precio
|
||||
int idProducto = int.Parse(id.Text);
|
||||
decimal precioProducto = producto.precion;
|
||||
decimal precioProducto = producto.precio;
|
||||
// Generar ticket y agregarlo al flowLayoutPanel2
|
||||
GenerarTicket(idProducto, producto.nombre, producto.precion, int.Parse(contador.Text), total,
|
||||
int indexCarrito = estaEnCarrito(producto.nombre);
|
||||
if (indexCarrito != -1)
|
||||
{
|
||||
carrito[indexCarrito].cantidad = int.Parse(contador.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
carrito.Add(new DetalleVentaModel(int.Parse(contador.Text), producto));
|
||||
}
|
||||
GenerarTicket(idProducto, producto.nombre, producto.precio, int.Parse(contador.Text), total,
|
||||
Path.Combine(Application.StartupPath, "Resources", producto.img));
|
||||
});
|
||||
|
||||
@@ -228,6 +244,18 @@ namespace compabetov2
|
||||
|
||||
}
|
||||
|
||||
private int estaEnCarrito(string nombre)
|
||||
{
|
||||
for (int i = 0; i < carrito.Count; i++)
|
||||
{
|
||||
if (carrito[i].producto.nombre.Equals(nombre))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
private void RestarDelTicket(int idProducto, string nombreProducto, decimal precio, int cantidad)
|
||||
{
|
||||
foreach (var item in flowLayoutPanel2.Controls)
|
||||
@@ -409,16 +437,9 @@ namespace compabetov2
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void getData()
|
||||
{
|
||||
this.productos = service.conseguirProductos();
|
||||
this.productos = service.conseguirVariantes();
|
||||
}
|
||||
|
||||
private void vender_Load(object sender, EventArgs e)
|
||||
@@ -496,34 +517,25 @@ namespace compabetov2
|
||||
|
||||
|
||||
private void bntImprimir_Click(object sender, EventArgs e)
|
||||
{
|
||||
//List<DetalleVentaModel> detalleVentas = listaProductosVenta();
|
||||
if (carrito.Count > 0)
|
||||
{
|
||||
DialogResult resultado = MessageBox.Show("¿Quieres hacer esa venta?", "Confirmación de Venta", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
|
||||
if (resultado == DialogResult.Yes)
|
||||
{
|
||||
// Si la opción es "SI", imprimir el ticket
|
||||
ImprimirTicket();
|
||||
|
||||
List<DetalleVentaModel> detalleVentas = listaProductosVenta();
|
||||
if (detalleVentas.Count > 0)
|
||||
{
|
||||
VentaModel ventaModel = new VentaModel(total, -1, "",
|
||||
responsablecb.Text.Equals("") ? loginPrincipal.usuario : responsablecb.Text
|
||||
);
|
||||
|
||||
if (service.crearVentaDAO(ventaModel, detalleVentas))
|
||||
if (service.crearVentaDAO(ventaModel, carrito))
|
||||
{
|
||||
MessageBox.Show("Venta hecha");
|
||||
eliminarProductosTocket();
|
||||
llenarLayout();
|
||||
total = 0;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("No hay ningun producto agregado");
|
||||
ImprimirTicket();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -532,6 +544,12 @@ namespace compabetov2
|
||||
MessageBox.Show("Venta cancelada", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("No hay ningun producto agregado");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void ImprimirTicket()
|
||||
@@ -699,7 +717,7 @@ namespace compabetov2
|
||||
}
|
||||
}
|
||||
int idProducto = int.Parse(idLabel.Text);
|
||||
Producto producto = new Producto(idProducto);
|
||||
Variante producto = new Variante(idProducto, "", 0, 0, "", 0);
|
||||
|
||||
Label Lbcantidad = panelInfo.Controls[2] as Label;
|
||||
string textcantidad = Lbcantidad.Text;
|
||||
@@ -790,7 +808,8 @@ namespace compabetov2
|
||||
btnFiar.Enabled = true;
|
||||
btnEnviar.Enabled = true;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
|
||||
bntImprimir.Enabled = false;
|
||||
btnFiar.Enabled = false;
|
||||
@@ -807,7 +826,7 @@ namespace compabetov2
|
||||
{
|
||||
if (!txtbusqueda.Text.Equals(""))
|
||||
{
|
||||
productos = service.conseguirProductosFiltrados(txtbusqueda.Text);
|
||||
//productos = service.conseguirProductosFiltrados(txtbusqueda.Text);
|
||||
llenarLayout();
|
||||
}
|
||||
else
|
||||
@@ -862,7 +881,8 @@ namespace compabetov2
|
||||
List<DetalleEnvioModel> detallesEnvio = listaProductosEnvio();
|
||||
string responsable = responsablecb.Text.Equals("") ? loginPrincipal.usuario : responsablecb.Text;
|
||||
Envio envio = new Envio(-1, DateTime.Now.ToString(), "", "", responsable, "", "", total);
|
||||
if(detallesEnvio.Count > 0){
|
||||
if (detallesEnvio.Count > 0)
|
||||
{
|
||||
datosEnvio datosEnvio = new datosEnvio(envio, detallesEnvio, this);
|
||||
datosEnvio.Show();
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -108,6 +108,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="database\modelos\DetalleEnvioModel.cs" />
|
||||
<Compile Include="database\modelos\Envio.cs" />
|
||||
<Compile Include="database\modelos\Variante.cs" />
|
||||
<Compile Include="Empleados\AgregarEmpleado1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
||||
+36
-9
@@ -778,7 +778,7 @@ namespace compabetov2.database
|
||||
try
|
||||
{
|
||||
string sqlVenta = "INSERT INTO venta (fecha, total,responzable) VALUES(@fecha, @total,@responzable);";
|
||||
string sqlDetalle = "INSERT INTO detalle_venta (fk_venta, fk_producto, cantidad) VALUES(@idVenta, @idProducto, @cantidada);";
|
||||
string sqlDetalle = "INSERT INTO detalle_venta (fk_venta, fk_variante, cantidad) VALUES(@idVenta, @fk_variante, @cantidada);";
|
||||
string sqlIdVenta = "SELECT idVenta FROM venta ORDER BY idVenta DESC LIMIT 1";
|
||||
string sqlProductoStock = "SELECT stock FROM Producto WHERE idproducto = @idproducto";
|
||||
string sqlProductoUpdate = "UPDATE Producto SET stock = @stock WHERE idproducto = @idproducto";
|
||||
@@ -803,12 +803,13 @@ namespace compabetov2.database
|
||||
{
|
||||
SQLiteCommand commandEmpleado = new SQLiteCommand(sqlDetalle, conexion);
|
||||
commandEmpleado.Parameters.AddWithValue("@idVenta", idVenta);
|
||||
commandEmpleado.Parameters.AddWithValue("@idProducto", detalleVenta.producto.idProducto);
|
||||
commandEmpleado.Parameters.AddWithValue("@fk_variante", detalleVenta.producto.idVariante);
|
||||
commandEmpleado.Parameters.AddWithValue("@cantidada", detalleVenta.cantidad);
|
||||
commandEmpleado.ExecuteNonQuery();
|
||||
|
||||
SQLiteCommand commandProdcutoStock = new SQLiteCommand(sqlProductoStock, conexion);
|
||||
commandProdcutoStock.Parameters.AddWithValue("@idproducto", detalleVenta.producto.idProducto);
|
||||
MessageBox.Show(detalleVenta.producto.fkProducto.ToString());
|
||||
commandProdcutoStock.Parameters.AddWithValue("@idproducto", detalleVenta.producto.fkProducto);
|
||||
SQLiteDataReader stockReader = commandProdcutoStock.ExecuteReader();
|
||||
|
||||
int stockActual = -1;
|
||||
@@ -820,10 +821,8 @@ namespace compabetov2.database
|
||||
|
||||
SQLiteCommand commandProdcutoUpdate = new SQLiteCommand(sqlProductoUpdate, conexion);
|
||||
commandProdcutoUpdate.Parameters.AddWithValue("@stock", stockActual - detalleVenta.cantidad);
|
||||
commandProdcutoUpdate.Parameters.AddWithValue("@idproducto", detalleVenta.producto.idProducto);
|
||||
commandProdcutoUpdate.Parameters.AddWithValue("@idproducto", detalleVenta.producto.fkProducto);
|
||||
commandProdcutoUpdate.ExecuteNonQuery();
|
||||
|
||||
|
||||
}
|
||||
|
||||
transaccion.Commit();
|
||||
@@ -1198,7 +1197,7 @@ namespace compabetov2.database
|
||||
|
||||
conexion.Open();
|
||||
|
||||
string sql = "select * from detalle_venta dv, Producto p WHERE dv.fk_producto = p.idproducto and dv.fk_venta = @idVenta";
|
||||
string sql = "select * from detalle_venta dv, variantes v WHERE dv.fk_variante = v.idVariante and dv.fk_venta = @idVenta";
|
||||
SQLiteCommand command = new SQLiteCommand(sql, conexion);
|
||||
command.Parameters.AddWithValue("@idVenta", venta.id);
|
||||
reader = command.ExecuteReader();
|
||||
@@ -1534,6 +1533,30 @@ namespace compabetov2.database
|
||||
}
|
||||
}
|
||||
|
||||
public static SQLiteDataReader conseguirVariantesDAO()
|
||||
{
|
||||
SQLiteDataReader reader = null;
|
||||
var db_conexion = new Conexion();
|
||||
try
|
||||
{
|
||||
SQLiteConnection conexion = db_conexion.get_connection();
|
||||
|
||||
conexion.Open();
|
||||
|
||||
string sql = "SELECT * FROM variantes";
|
||||
SQLiteCommand command = new SQLiteCommand(sql, conexion);
|
||||
reader = command.ExecuteReader();
|
||||
|
||||
return reader;
|
||||
|
||||
}
|
||||
catch (SQLiteException ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
return reader;
|
||||
}
|
||||
}
|
||||
|
||||
private static void crearDB()
|
||||
{
|
||||
var db_conexion = new Conexion();
|
||||
@@ -1555,6 +1578,7 @@ namespace compabetov2.database
|
||||
"DROP TABLE IF EXISTS cuenta",
|
||||
"DROP TABLE IF EXISTS detalle_envios",
|
||||
"DROP TABLE IF EXISTS envios",
|
||||
"DROP TABLE IF EXISTS variantes",
|
||||
|
||||
"CREATE TABLE Login (idlogin INTEGER PRIMARY KEY AUTOINCREMENT, tipo TEXT NOT NULL, usuario TEXT NOT NULL, "+
|
||||
"contra TEXT NOT NULL)",
|
||||
@@ -1570,6 +1594,9 @@ namespace compabetov2.database
|
||||
"precio DECIMAL(10, 2) NOT NULL, img TEXT NOT NULL, stock INTEGER NOT NULL, " +
|
||||
"fk_idcategoria INTEGER NOT NULL, FOREIGN KEY (fk_idcategoria) REFERENCES Categoria (idcategoria))",
|
||||
|
||||
"CREATE TABLE variantes (idVariante INTEGER PRIMARY KEY AUTOINCREMENT, nombre TEXT, precio DECIMAL(10,2), cantidad INTEGER DEFAULT 1, " +
|
||||
"img TEXT,fk_producto INTEGER, FOREIGN KEY (fk_producto) REFERENCES Producto(idproducto))",
|
||||
|
||||
"CREATE TABLE Cliente (idcliente INTEGER PRIMARY KEY AUTOINCREMENT, nombres TEXT NOT NULL, apellidos TEXT NOT NULL, " +
|
||||
"calle TEXT NOT NULL, colonia TEXT NOT NULL, cp TEXT NOT NULL, no_ext TEXT NOT NULL, no_int TEXT NOT NULL, referencia TEXT NOT NULL, " +
|
||||
"telefono TEXT NOT NULL, telefono_extra TEXT NOT NULL)",
|
||||
@@ -1578,8 +1605,8 @@ namespace compabetov2.database
|
||||
|
||||
"CREATE TABLE venta (idVenta INTEGER PRIMARY KEY AUTOINCREMENT,fecha TEXT, total DECIMAL(10, 2),responzable TEXT DEFAULT '');",
|
||||
|
||||
"CREATE TABLE detalle_venta (fk_venta INTEGER, fk_producto INTEGER,cantidad INTEGER DEFAULT 0, PRIMARY KEY (fk_venta, fk_producto), " +
|
||||
"FOREIGN KEY (fk_venta) REFERENCES venta(idVenta),FOREIGN KEY (fk_producto) REFERENCES producto(idproducto));",
|
||||
"CREATE TABLE detalle_venta (fk_venta INTEGER, fk_variante INTEGER,cantidad INTEGER, PRIMARY KEY (fk_venta, fk_variante)," +
|
||||
"FOREIGN KEY (fk_venta) REFERENCES venta(idVenta),FOREIGN KEY (fk_variante) REFERENCES variantes(idVariante))",
|
||||
|
||||
"CREATE TABLE cuenta (idCuenta INTEGER PRIMARY KEY AUTOINCREMENT, total DECIMAL(10,2), fecha TEXT, estado TEXT DEFAULT 'ACTIVO', descripcion TEXT, cliente TEXT DEFAULT '')",
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ namespace compabetov2.database.modelos
|
||||
{
|
||||
public int idVenta;
|
||||
public int cantidad;
|
||||
public Producto producto;
|
||||
public Variante producto;
|
||||
public decimal total;
|
||||
|
||||
public DetalleVentaModel(int cantidad, Producto producto, int id = -1, decimal total = 0)
|
||||
public DetalleVentaModel(int cantidad, Variante producto, int id = -1, decimal total = 0)
|
||||
{
|
||||
this.cantidad = cantidad;
|
||||
this.producto = producto;
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace compabetov2.database.modelos
|
||||
{
|
||||
public class Variante
|
||||
{
|
||||
public int idVariante;
|
||||
public string nombre;
|
||||
public decimal precio;
|
||||
public int cantidad;
|
||||
public string img;
|
||||
public int fkProducto;
|
||||
|
||||
public Variante(int idVariante, string nombre, decimal precio, int cantidad, string img, int fkProducto)
|
||||
{
|
||||
this.idVariante = idVariante;
|
||||
this.nombre = nombre;
|
||||
this.precio = precio;
|
||||
this.cantidad = cantidad;
|
||||
this.img = img;
|
||||
this.fkProducto = fkProducto;
|
||||
}
|
||||
}
|
||||
}
|
||||
+27
-9
@@ -405,15 +405,8 @@ namespace compabetov2.database
|
||||
{
|
||||
DetalleVentaModel detalleVenta = new DetalleVentaModel(
|
||||
(int)readerDetalleVenta.GetInt64(2),
|
||||
new Producto(
|
||||
(int)readerDetalleVenta.GetInt64(1),
|
||||
readerDetalleVenta["nombre"].ToString(),
|
||||
readerDetalleVenta["descripcion"].ToString(),
|
||||
readerDetalleVenta.GetDecimal(6),
|
||||
readerDetalleVenta["img"].ToString(),
|
||||
(int)readerDetalleVenta.GetInt64(8)
|
||||
),
|
||||
(int)readerDetalleVenta.GetInt64(0)
|
||||
new Variante(-1,"",0,0,"",-1)
|
||||
|
||||
) ;
|
||||
detallesVenta.Add( detalleVenta );
|
||||
}
|
||||
@@ -455,6 +448,7 @@ namespace compabetov2.database
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
|
||||
Producto producto = new Producto(
|
||||
reader.GetInt32(idIndex),
|
||||
reader.GetString(nombreIndex),
|
||||
@@ -498,5 +492,29 @@ namespace compabetov2.database
|
||||
|
||||
return dic;
|
||||
}
|
||||
|
||||
public static List<Variante> conseguirVariantes()
|
||||
{
|
||||
List<Variante> variantes = new List<Variante>();
|
||||
SQLiteDataReader reader = DAO.conseguirVariantesDAO();
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
decimal precio = reader.GetDecimal(2);
|
||||
int cantidad = (int)reader.GetInt64(3);
|
||||
int fkProducto = (int)reader.GetInt64(5);
|
||||
Variante vaiante = new Variante(
|
||||
(int)reader.GetInt64(0),
|
||||
reader["nombre"].ToString(),
|
||||
precio,
|
||||
cantidad,
|
||||
reader["img"].ToString(),
|
||||
fkProducto
|
||||
);
|
||||
variantes.Add(vaiante);
|
||||
}
|
||||
|
||||
return variantes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
3f62af869539c2801b7da3577ef2feb00e7c32f1cefc777b57202fa5ad70cc96
|
||||
63a64a54bc73e8651fb89f1a0901353ab83d35804c69edd565e24f2be4325b47
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user