59 lines
1.4 KiB
C#
59 lines
1.4 KiB
C#
using compabetov2.database;
|
|
using compabetov2.database.modelos;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace compabetov2
|
|
{
|
|
public partial class inventario : Form
|
|
{
|
|
public inventario()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
MenuPrincipal menuPrincipal = new MenuPrincipal();
|
|
menuPrincipal.Show();
|
|
|
|
this.Dispose();
|
|
|
|
}
|
|
|
|
private void button6_Click(object sender, EventArgs e)
|
|
{
|
|
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)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|