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
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+5 -10
View File
@@ -107,14 +107,10 @@ namespace compabetov2.database
{ {
conexion.Open(); conexion.Open();
string sql = "INSERT INTO Producto (nombre, descripcion, precio, img, stock, idcategoria) "+ string sql = "INSERT INTO Producto (nombre, descripcion, precio, stock, fk_idcategoria) "+
"VALUES (@nombre, @descripcion, @precio, @stock, @img, @idcategoria)"; "VALUES (@nombre, @descripcion, @precio,@stock, @idcategoria)";
if (!producto.img.Equals(""))
{
string rutaDestino = guardarImg(producto.img);
producto.img = rutaDestino;
}
using (SQLiteCommand command = new SQLiteCommand(sql, conexion)) using (SQLiteCommand command = new SQLiteCommand(sql, conexion))
@@ -123,7 +119,6 @@ namespace compabetov2.database
command.Parameters.AddWithValue("@descripcion", producto.descripcion); command.Parameters.AddWithValue("@descripcion", producto.descripcion);
command.Parameters.AddWithValue("@precio", producto.precion); command.Parameters.AddWithValue("@precio", producto.precion);
command.Parameters.AddWithValue("@stock", producto.stock); command.Parameters.AddWithValue("@stock", producto.stock);
command.Parameters.AddWithValue("@img", producto.img);
command.Parameters.AddWithValue("@idcategoria", producto.categoria.idCategoria); command.Parameters.AddWithValue("@idcategoria", producto.categoria.idCategoria);
int filasAfectadas = command.ExecuteNonQuery(); int filasAfectadas = command.ExecuteNonQuery();
@@ -172,7 +167,7 @@ namespace compabetov2.database
private static string guardarImg(String rutaImagen) private static string guardarImg(String rutaImagen)
{ {
//consigue la carpeta del proyectro //consigue la carpeta del proyectro
string carpetaImagenes = Path.Combine(Aplication.StartupPath, "produtos_img"); string carpetaImagenes = Path.Combine(Application.StartupPath, "produtos_img");
//crear el directorio sino existe //crear el directorio sino existe
if (!Directory.Exists(carpetaImagenes)) if (!Directory.Exists(carpetaImagenes))
@@ -211,7 +206,7 @@ namespace compabetov2.database
"CREATE TABLE Categoria (idcategoria INTEGER PRIMARY KEY AUTOINCREMENT, nombre TEXT NOT NULL, descripcion TEXT NOT NULL)", "CREATE TABLE Categoria (idcategoria INTEGER PRIMARY KEY AUTOINCREMENT, nombre TEXT NOT NULL, descripcion TEXT NOT NULL)",
"CREATE TABLE Producto (idproducto INTEGER PRIMARY KEY AUTOINCREMENT, nombre TEXT NOT NULL, descripcion TEXT NOT NULL, "+ "CREATE TABLE Producto (idproducto INTEGER PRIMARY KEY AUTOINCREMENT, nombre TEXT NOT NULL, descripcion TEXT NOT NULL, "+
"precio DECIMAL(10, 2) NOT NULL, stock INTEGER NOT NULL, img TEXT NOT NULL, " + "precio DECIMAL(10, 2) NOT NULL, stock INTEGER NOT NULL, " +
"fk_idcategoria INTEGER NOT NULL, FOREIGN KEY (fk_idcategoria) REFERENCES Categoria (idcategoria))", "fk_idcategoria INTEGER NOT NULL, FOREIGN KEY (fk_idcategoria) REFERENCES Categoria (idcategoria))",
"INSERT INTO Empleado ( nombre, apellido, calle, fecha_contratacion, colonia, cp, no_ext,no_int, referencia, fecha_nac, telefono, activo) VALUES('jefe', '', '', '', '', '', '', '', '', '', '', 0);", "INSERT INTO Empleado ( nombre, apellido, calle, fecha_contratacion, colonia, cp, no_ext,no_int, referencia, fecha_nac, telefono, activo) VALUES('jefe', '', '', '', '', '', '', '', '', '', '', 0);",
+1 -1
View File
@@ -12,7 +12,7 @@ namespace compabetov2.database.modelos
public string nombre; public string nombre;
public string descripcion; public string descripcion;
public Categoria(int idCategoria, string nombre = "", string descripcion = "") public Categoria(int idCategoria = 0, string nombre = "", string descripcion = "")
{ {
this.idCategoria = idCategoria; this.idCategoria = idCategoria;
this.nombre = nombre; this.nombre = nombre;
+109 -68
View File
@@ -50,6 +50,7 @@
this.button7 = new System.Windows.Forms.Button(); this.button7 = new System.Windows.Forms.Button();
this.button8 = new System.Windows.Forms.Button(); this.button8 = new System.Windows.Forms.Button();
this.button9 = new System.Windows.Forms.Button(); this.button9 = new System.Windows.Forms.Button();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.flowLayoutPanel1.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit();
@@ -58,11 +59,12 @@
// lblfecha // lblfecha
// //
this.lblfecha.AutoSize = true; this.lblfecha.AutoSize = true;
this.lblfecha.Font = new System.Drawing.Font("Poppins SemiBold", 30F); this.lblfecha.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.lblfecha.ForeColor = System.Drawing.Color.Navy; this.lblfecha.ForeColor = System.Drawing.Color.Navy;
this.lblfecha.Location = new System.Drawing.Point(747, 127); this.lblfecha.Location = new System.Drawing.Point(560, 103);
this.lblfecha.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblfecha.Name = "lblfecha"; this.lblfecha.Name = "lblfecha";
this.lblfecha.Size = new System.Drawing.Size(193, 88); this.lblfecha.Size = new System.Drawing.Size(126, 46);
this.lblfecha.TabIndex = 11; this.lblfecha.TabIndex = 11;
this.lblfecha.Text = "label2"; this.lblfecha.Text = "label2";
this.lblfecha.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.lblfecha.TextAlign = System.Drawing.ContentAlignment.TopCenter;
@@ -70,20 +72,22 @@
// lblhora // lblhora
// //
this.lblhora.AutoSize = true; this.lblhora.AutoSize = true;
this.lblhora.Font = new System.Drawing.Font("Poppins SemiBold", 60F); this.lblhora.Font = new System.Drawing.Font("Microsoft Sans Serif", 60F);
this.lblhora.ForeColor = System.Drawing.Color.MediumBlue; this.lblhora.ForeColor = System.Drawing.Color.MediumBlue;
this.lblhora.Location = new System.Drawing.Point(934, 9); this.lblhora.Location = new System.Drawing.Point(700, 7);
this.lblhora.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblhora.Name = "lblhora"; this.lblhora.Name = "lblhora";
this.lblhora.Size = new System.Drawing.Size(365, 177); this.lblhora.Size = new System.Drawing.Size(249, 91);
this.lblhora.TabIndex = 10; this.lblhora.TabIndex = 10;
this.lblhora.Text = "label1"; this.lblhora.Text = "label1";
// //
// txtnombreproducto // txtnombreproducto
// //
this.txtnombreproducto.Font = new System.Drawing.Font("Poppins", 25F); this.txtnombreproducto.Font = new System.Drawing.Font("Microsoft Sans Serif", 25F);
this.txtnombreproducto.Location = new System.Drawing.Point(497, 350); this.txtnombreproducto.Location = new System.Drawing.Point(373, 284);
this.txtnombreproducto.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtnombreproducto.Name = "txtnombreproducto"; this.txtnombreproducto.Name = "txtnombreproducto";
this.txtnombreproducto.Size = new System.Drawing.Size(480, 70); this.txtnombreproducto.Size = new System.Drawing.Size(361, 45);
this.txtnombreproducto.TabIndex = 12; this.txtnombreproducto.TabIndex = 12;
// //
// flowLayoutPanel1 // flowLayoutPanel1
@@ -96,23 +100,26 @@
this.flowLayoutPanel1.Controls.Add(this.button4); this.flowLayoutPanel1.Controls.Add(this.button4);
this.flowLayoutPanel1.Controls.Add(this.button5); this.flowLayoutPanel1.Controls.Add(this.button5);
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(324, 1061); this.flowLayoutPanel1.Size = new System.Drawing.Size(243, 862);
this.flowLayoutPanel1.TabIndex = 8; this.flowLayoutPanel1.TabIndex = 8;
// //
// panel2 // panel2
// //
this.panel2.BackColor = System.Drawing.Color.Transparent; this.panel2.BackColor = System.Drawing.Color.Transparent;
this.panel2.Controls.Add(this.pictureBox7); this.panel2.Controls.Add(this.pictureBox7);
this.panel2.Location = new System.Drawing.Point(3, 3); this.panel2.Location = new System.Drawing.Point(2, 2);
this.panel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(312, 263); this.panel2.Size = new System.Drawing.Size(234, 214);
this.panel2.TabIndex = 8; this.panel2.TabIndex = 8;
// //
// pictureBox7 // pictureBox7
// //
this.pictureBox7.Image = global::compabetov2.Properties.Resources.HomeroMenu; this.pictureBox7.Image = global::compabetov2.Properties.Resources.HomeroMenu;
this.pictureBox7.Location = new System.Drawing.Point(64, 35); this.pictureBox7.Location = new System.Drawing.Point(48, 28);
this.pictureBox7.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pictureBox7.Name = "pictureBox7"; this.pictureBox7.Name = "pictureBox7";
this.pictureBox7.Size = new System.Drawing.Size(190, 197); this.pictureBox7.Size = new System.Drawing.Size(190, 197);
this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
@@ -124,14 +131,15 @@
this.button1.BackColor = System.Drawing.Color.Transparent; this.button1.BackColor = System.Drawing.Color.Transparent;
this.button1.FlatAppearance.BorderSize = 0; this.button1.FlatAppearance.BorderSize = 0;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("Poppins SemiBold", 15F); this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.button1.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.button1.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.button1.Image = global::compabetov2.Properties.Resources.Menui1; this.button1.Image = global::compabetov2.Properties.Resources.Menui1;
this.button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button1.Location = new System.Drawing.Point(3, 272); this.button1.Location = new System.Drawing.Point(2, 220);
this.button1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Padding = new System.Windows.Forms.Padding(50, 0, 0, 0); this.button1.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button1.Size = new System.Drawing.Size(312, 115); this.button1.Size = new System.Drawing.Size(234, 93);
this.button1.TabIndex = 8; this.button1.TabIndex = 8;
this.button1.Text = "Menú"; this.button1.Text = "Menú";
this.button1.UseVisualStyleBackColor = false; this.button1.UseVisualStyleBackColor = false;
@@ -142,14 +150,15 @@
this.button2.BackColor = System.Drawing.Color.Transparent; this.button2.BackColor = System.Drawing.Color.Transparent;
this.button2.FlatAppearance.BorderSize = 0; this.button2.FlatAppearance.BorderSize = 0;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.Font = new System.Drawing.Font("Poppins SemiBold", 15F); this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.button2.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.button2.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.button2.Image = global::compabetov2.Properties.Resources.estadisticasi; this.button2.Image = global::compabetov2.Properties.Resources.estadisticasi;
this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button2.Location = new System.Drawing.Point(3, 393); this.button2.Location = new System.Drawing.Point(2, 317);
this.button2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.button2.Name = "button2"; this.button2.Name = "button2";
this.button2.Padding = new System.Windows.Forms.Padding(50, 0, 0, 0); this.button2.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button2.Size = new System.Drawing.Size(312, 115); this.button2.Size = new System.Drawing.Size(234, 93);
this.button2.TabIndex = 9; this.button2.TabIndex = 9;
this.button2.Text = "Estadisticas"; this.button2.Text = "Estadisticas";
this.button2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.button2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
@@ -160,14 +169,15 @@
this.button3.BackColor = System.Drawing.Color.Transparent; this.button3.BackColor = System.Drawing.Color.Transparent;
this.button3.FlatAppearance.BorderSize = 0; this.button3.FlatAppearance.BorderSize = 0;
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button3.Font = new System.Drawing.Font("Poppins SemiBold", 15F); this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.button3.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.button3.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.button3.Image = global::compabetov2.Properties.Resources.productoi; this.button3.Image = global::compabetov2.Properties.Resources.productoi;
this.button3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button3.Location = new System.Drawing.Point(3, 514); this.button3.Location = new System.Drawing.Point(2, 414);
this.button3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.button3.Name = "button3"; this.button3.Name = "button3";
this.button3.Padding = new System.Windows.Forms.Padding(50, 0, 0, 0); this.button3.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button3.Size = new System.Drawing.Size(312, 115); this.button3.Size = new System.Drawing.Size(234, 93);
this.button3.TabIndex = 10; this.button3.TabIndex = 10;
this.button3.Text = "Productos"; this.button3.Text = "Productos";
this.button3.UseVisualStyleBackColor = false; this.button3.UseVisualStyleBackColor = false;
@@ -177,14 +187,15 @@
this.button4.BackColor = System.Drawing.Color.Transparent; this.button4.BackColor = System.Drawing.Color.Transparent;
this.button4.FlatAppearance.BorderSize = 0; this.button4.FlatAppearance.BorderSize = 0;
this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button4.Font = new System.Drawing.Font("Poppins SemiBold", 15F); this.button4.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.button4.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.button4.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.button4.Image = global::compabetov2.Properties.Resources.reportesi; this.button4.Image = global::compabetov2.Properties.Resources.reportesi;
this.button4.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button4.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button4.Location = new System.Drawing.Point(3, 635); this.button4.Location = new System.Drawing.Point(2, 511);
this.button4.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.button4.Name = "button4"; this.button4.Name = "button4";
this.button4.Padding = new System.Windows.Forms.Padding(50, 0, 0, 0); this.button4.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button4.Size = new System.Drawing.Size(312, 115); this.button4.Size = new System.Drawing.Size(234, 93);
this.button4.TabIndex = 11; this.button4.TabIndex = 11;
this.button4.Text = "Reportes"; this.button4.Text = "Reportes";
this.button4.UseVisualStyleBackColor = false; this.button4.UseVisualStyleBackColor = false;
@@ -194,51 +205,56 @@
this.button5.BackColor = System.Drawing.Color.Transparent; this.button5.BackColor = System.Drawing.Color.Transparent;
this.button5.FlatAppearance.BorderSize = 0; this.button5.FlatAppearance.BorderSize = 0;
this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button5.Font = new System.Drawing.Font("Poppins SemiBold", 15F); this.button5.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.button5.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.button5.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.button5.Image = global::compabetov2.Properties.Resources.sesionc; this.button5.Image = global::compabetov2.Properties.Resources.sesionc;
this.button5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button5.Location = new System.Drawing.Point(3, 756); this.button5.Location = new System.Drawing.Point(2, 608);
this.button5.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.button5.Name = "button5"; this.button5.Name = "button5";
this.button5.Padding = new System.Windows.Forms.Padding(50, 0, 0, 0); this.button5.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button5.Size = new System.Drawing.Size(312, 115); this.button5.Size = new System.Drawing.Size(234, 93);
this.button5.TabIndex = 12; this.button5.TabIndex = 12;
this.button5.Text = "Salir"; this.button5.Text = "Salir";
this.button5.UseVisualStyleBackColor = false; this.button5.UseVisualStyleBackColor = false;
// //
// txtprecioproducto // txtprecioproducto
// //
this.txtprecioproducto.Font = new System.Drawing.Font("Poppins", 25F); this.txtprecioproducto.Font = new System.Drawing.Font("Microsoft Sans Serif", 25F);
this.txtprecioproducto.Location = new System.Drawing.Point(1031, 350); this.txtprecioproducto.Location = new System.Drawing.Point(773, 284);
this.txtprecioproducto.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtprecioproducto.Name = "txtprecioproducto"; this.txtprecioproducto.Name = "txtprecioproducto";
this.txtprecioproducto.Size = new System.Drawing.Size(171, 70); this.txtprecioproducto.Size = new System.Drawing.Size(129, 45);
this.txtprecioproducto.TabIndex = 13; this.txtprecioproducto.TabIndex = 13;
// //
// txtstockproducto // txtstockproducto
// //
this.txtstockproducto.Font = new System.Drawing.Font("Poppins", 25F); this.txtstockproducto.Font = new System.Drawing.Font("Microsoft Sans Serif", 25F);
this.txtstockproducto.Location = new System.Drawing.Point(1239, 350); this.txtstockproducto.Location = new System.Drawing.Point(929, 284);
this.txtstockproducto.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtstockproducto.Name = "txtstockproducto"; this.txtstockproducto.Name = "txtstockproducto";
this.txtstockproducto.Size = new System.Drawing.Size(171, 70); this.txtstockproducto.Size = new System.Drawing.Size(129, 45);
this.txtstockproducto.TabIndex = 14; this.txtstockproducto.TabIndex = 14;
// //
// txtdescripcionproducto // txtdescripcionproducto
// //
this.txtdescripcionproducto.Font = new System.Drawing.Font("Poppins", 25F); this.txtdescripcionproducto.Font = new System.Drawing.Font("Microsoft Sans Serif", 25F);
this.txtdescripcionproducto.Location = new System.Drawing.Point(497, 502); this.txtdescripcionproducto.Location = new System.Drawing.Point(373, 408);
this.txtdescripcionproducto.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtdescripcionproducto.Multiline = true; this.txtdescripcionproducto.Multiline = true;
this.txtdescripcionproducto.Name = "txtdescripcionproducto"; this.txtdescripcionproducto.Name = "txtdescripcionproducto";
this.txtdescripcionproducto.Size = new System.Drawing.Size(705, 443); this.txtdescripcionproducto.Size = new System.Drawing.Size(530, 361);
this.txtdescripcionproducto.TabIndex = 15; this.txtdescripcionproducto.TabIndex = 15;
// //
// label1 // label1
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Poppins SemiBold", 20F); this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F);
this.label1.ForeColor = System.Drawing.Color.Navy; this.label1.ForeColor = System.Drawing.Color.Navy;
this.label1.Location = new System.Drawing.Point(497, 287); this.label1.Location = new System.Drawing.Point(373, 233);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(394, 60); this.label1.Size = new System.Drawing.Size(266, 31);
this.label1.TabIndex = 16; this.label1.TabIndex = 16;
this.label1.Text = "Nombre del producto"; this.label1.Text = "Nombre del producto";
this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
@@ -246,11 +262,12 @@
// label2 // label2
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Poppins SemiBold", 20F); this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F);
this.label2.ForeColor = System.Drawing.Color.Navy; this.label2.ForeColor = System.Drawing.Color.Navy;
this.label2.Location = new System.Drawing.Point(1021, 272); this.label2.Location = new System.Drawing.Point(766, 221);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(132, 60); this.label2.Size = new System.Drawing.Size(91, 31);
this.label2.TabIndex = 17; this.label2.TabIndex = 17;
this.label2.Text = "Precio"; this.label2.Text = "Precio";
this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
@@ -258,11 +275,12 @@
// label3 // label3
// //
this.label3.AutoSize = true; this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Poppins SemiBold", 20F); this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F);
this.label3.ForeColor = System.Drawing.Color.Navy; this.label3.ForeColor = System.Drawing.Color.Navy;
this.label3.Location = new System.Drawing.Point(1229, 272); this.label3.Location = new System.Drawing.Point(922, 221);
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(121, 60); this.label3.Size = new System.Drawing.Size(83, 31);
this.label3.TabIndex = 18; this.label3.TabIndex = 18;
this.label3.Text = "Stock"; this.label3.Text = "Stock";
this.label3.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.label3.TextAlign = System.Drawing.ContentAlignment.TopCenter;
@@ -270,21 +288,23 @@
// label4 // label4
// //
this.label4.AutoSize = true; this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Poppins SemiBold", 20F); this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F);
this.label4.ForeColor = System.Drawing.Color.Navy; this.label4.ForeColor = System.Drawing.Color.Navy;
this.label4.Location = new System.Drawing.Point(497, 439); this.label4.Location = new System.Drawing.Point(373, 357);
this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label4.Name = "label4"; this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(456, 60); this.label4.Size = new System.Drawing.Size(313, 31);
this.label4.TabIndex = 19; this.label4.TabIndex = 19;
this.label4.Text = "Descripción del producto"; this.label4.Text = "Descripción del producto";
this.label4.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.label4.TextAlign = System.Drawing.ContentAlignment.TopCenter;
// //
// button6 // button6
// //
this.button6.Font = new System.Drawing.Font("Poppins SemiBold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button6.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button6.Location = new System.Drawing.Point(1239, 502); this.button6.Location = new System.Drawing.Point(929, 408);
this.button6.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.button6.Name = "button6"; this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(171, 70); this.button6.Size = new System.Drawing.Size(128, 57);
this.button6.TabIndex = 20; this.button6.TabIndex = 20;
this.button6.Text = "Agregar"; this.button6.Text = "Agregar";
this.button6.UseVisualStyleBackColor = true; this.button6.UseVisualStyleBackColor = true;
@@ -292,39 +312,57 @@
// //
// button7 // button7
// //
this.button7.Font = new System.Drawing.Font("Poppins SemiBold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button7.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button7.Location = new System.Drawing.Point(1239, 622); this.button7.Location = new System.Drawing.Point(929, 505);
this.button7.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.button7.Name = "button7"; this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(171, 70); this.button7.Size = new System.Drawing.Size(128, 57);
this.button7.TabIndex = 21; this.button7.TabIndex = 21;
this.button7.Text = "Buscar"; this.button7.Text = "Buscar";
this.button7.UseVisualStyleBackColor = true; this.button7.UseVisualStyleBackColor = true;
// //
// button8 // button8
// //
this.button8.Font = new System.Drawing.Font("Poppins SemiBold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button8.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button8.Location = new System.Drawing.Point(1239, 756); this.button8.Location = new System.Drawing.Point(929, 614);
this.button8.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.button8.Name = "button8"; this.button8.Name = "button8";
this.button8.Size = new System.Drawing.Size(171, 70); this.button8.Size = new System.Drawing.Size(128, 57);
this.button8.TabIndex = 22; this.button8.TabIndex = 22;
this.button8.Text = "Editar"; this.button8.Text = "Editar";
this.button8.UseVisualStyleBackColor = true; this.button8.UseVisualStyleBackColor = true;
// //
// button9 // button9
// //
this.button9.Font = new System.Drawing.Font("Poppins SemiBold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button9.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button9.Location = new System.Drawing.Point(1239, 875); this.button9.Location = new System.Drawing.Point(929, 711);
this.button9.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.button9.Name = "button9"; this.button9.Name = "button9";
this.button9.Size = new System.Drawing.Size(171, 70); this.button9.Size = new System.Drawing.Size(128, 57);
this.button9.TabIndex = 23; this.button9.TabIndex = 23;
this.button9.Text = "Eliminar"; this.button9.Text = "Eliminar";
this.button9.UseVisualStyleBackColor = true; this.button9.UseVisualStyleBackColor = true;
// //
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Items.AddRange(new object[] {
"cerveza",
"cigarros",
"sabritas",
"aguas"});
this.comboBox1.Location = new System.Drawing.Point(865, 161);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(121, 21);
this.comboBox1.TabIndex = 24;
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
//
// inventario // inventario
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1924, 1055); this.ClientSize = new System.Drawing.Size(1169, 609);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.button9); this.Controls.Add(this.button9);
this.Controls.Add(this.button8); this.Controls.Add(this.button8);
this.Controls.Add(this.button7); this.Controls.Add(this.button7);
@@ -340,9 +378,11 @@
this.Controls.Add(this.lblfecha); this.Controls.Add(this.lblfecha);
this.Controls.Add(this.lblhora); this.Controls.Add(this.lblhora);
this.Controls.Add(this.flowLayoutPanel1); this.Controls.Add(this.flowLayoutPanel1);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Name = "inventario"; this.Name = "inventario";
this.Text = "inventario"; this.Text = "inventario";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.inventario_Load);
this.flowLayoutPanel1.ResumeLayout(false); this.flowLayoutPanel1.ResumeLayout(false);
this.panel2.ResumeLayout(false); this.panel2.ResumeLayout(false);
this.panel2.PerformLayout(); this.panel2.PerformLayout();
@@ -376,5 +416,6 @@
private System.Windows.Forms.Button button7; private System.Windows.Forms.Button button7;
private System.Windows.Forms.Button button8; private System.Windows.Forms.Button button8;
private System.Windows.Forms.Button button9; private System.Windows.Forms.Button button9;
private System.Windows.Forms.ComboBox comboBox1;
} }
} }
+21 -1
View File
@@ -1,4 +1,5 @@
using compabetov2.database; using compabetov2.database;
using compabetov2.database.modelos;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
@@ -29,10 +30,29 @@ namespace compabetov2
private void button6_Click(object sender, EventArgs e) 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)
{
}
} }
} }
Binary file not shown.
Binary file not shown.
@@ -1,5 +1 @@
<<<<<<< HEAD 27e294817a0bec5f75cbc3af7fd0a10fac43022232f7b6272aae9c64a32c97fa
5f84ca15ab0cf8658a0603f2d37cc1ef407c340f
=======
04ff0eea2625c5f041dc8598762cddc9006f263e8231100b6f207f00fb8b7971
>>>>>>> cf456518544ecfa44f10e88e75e2bc14d31d6702
@@ -43,3 +43,8 @@ C:\Users\Googl\Documents\compabetov2\obj\Debug\compabetov2.cuentas.resources
C:\Users\Googl\Documents\compabetov2\obj\Debug\compabetov2.mermas.resources C:\Users\Googl\Documents\compabetov2\obj\Debug\compabetov2.mermas.resources
C:\Users\Googl\Documents\compabetov2\obj\Debug\compabetov2.personal.resources C:\Users\Googl\Documents\compabetov2\obj\Debug\compabetov2.personal.resources
C:\Users\Googl\Documents\compabetov2\obj\Debug\compabetov2.vender.resources C:\Users\Googl\Documents\compabetov2\obj\Debug\compabetov2.vender.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.cuentas.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.inventario.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.mermas.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.personal.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.vender.resources
Binary file not shown.
Binary file not shown.
Binary file not shown.