agrgar producto en interfaz
This commit is contained in:
+21
-1
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user