agrgar producto en interfaz

This commit is contained in:
carlos
2023-12-23 00:56:14 -06:00
parent 73b64b70a8
commit 565ef45950
16 changed files with 142 additions and 85 deletions
+21 -1
View File
@@ -1,4 +1,5 @@
using compabetov2.database;
using compabetov2.database.modelos;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -29,10 +30,29 @@ namespace compabetov2
private void button6_Click(object sender, EventArgs e)
{
if (service.insertarProducto(new database.modelos.Producto(0,txtnombreproducto.Text, txtdescripcionproducto.Text, decimal.Parse(txtprecioproducto.Text),txtstockproducto.Text))) {
Categoria categoria = new Categoria(comboBox1.SelectedIndex + 1);
Producto producto = new Producto(
0,
txtnombreproducto.Text,
txtdescripcionproducto.Text,
decimal.Parse(txtprecioproducto.Text),
"",
int.Parse(txtstockproducto.Text),
categoria);
if (service.insertarProducto(producto)) {
}
}
private void inventario_Load(object sender, EventArgs e)
{
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}