diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index 23762ee..dc00168 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -2,8 +2,7 @@ "ExpandedNodes": [ "", "\\database", - "\\database\\modelos", - "\\Resources" + "\\database\\modelos" ], "SelectedNode": "\\.sln", "PreviewInSolutionExplorer": false diff --git a/.vs/compabetoOG/v17/.wsuo b/.vs/compabetoOG/v17/.wsuo index 4a738b9..9c83720 100644 Binary files a/.vs/compabetoOG/v17/.wsuo and b/.vs/compabetoOG/v17/.wsuo differ diff --git a/MenuPrincipal.Designer.cs b/MenuPrincipal.Designer.cs index d460054..2c4675f 100644 --- a/MenuPrincipal.Designer.cs +++ b/MenuPrincipal.Designer.cs @@ -30,9 +30,8 @@ { this.components = new System.ComponentModel.Container(); this.panel1 = new System.Windows.Forms.Panel(); - this.lblhora = new System.Windows.Forms.Label(); this.lblfecha = new System.Windows.Forms.Label(); - this.horafecha = new System.Windows.Forms.Timer(this.components); + this.lblhora = new System.Windows.Forms.Label(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.panel2 = new System.Windows.Forms.Panel(); this.pictureBox7 = new System.Windows.Forms.PictureBox(); @@ -47,6 +46,7 @@ this.pictureBox3 = new System.Windows.Forms.PictureBox(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.horafecha = new System.Windows.Forms.Timer(this.components); this.panel1.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout(); this.panel2.SuspendLayout(); @@ -77,17 +77,6 @@ this.panel1.Size = new System.Drawing.Size(1924, 1055); this.panel1.TabIndex = 4; // - // lblhora - // - this.lblhora.AutoSize = true; - this.lblhora.Font = new System.Drawing.Font("Poppins SemiBold", 60F); - this.lblhora.ForeColor = System.Drawing.Color.MediumBlue; - this.lblhora.Location = new System.Drawing.Point(963, -6); - this.lblhora.Name = "lblhora"; - this.lblhora.Size = new System.Drawing.Size(365, 177); - this.lblhora.TabIndex = 8; - this.lblhora.Text = "label1"; - // // lblfecha // this.lblfecha.AutoSize = true; @@ -99,11 +88,18 @@ this.lblfecha.TabIndex = 9; this.lblfecha.Text = "label2"; this.lblfecha.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.lblfecha.Click += new System.EventHandler(this.lblfecha_Click); // - // horafecha + // lblhora // - this.horafecha.Enabled = true; - this.horafecha.Tick += new System.EventHandler(this.horafecha_Tick); + this.lblhora.AutoSize = true; + this.lblhora.Font = new System.Drawing.Font("Poppins SemiBold", 60F); + this.lblhora.ForeColor = System.Drawing.Color.MediumBlue; + this.lblhora.Location = new System.Drawing.Point(963, -6); + this.lblhora.Name = "lblhora"; + this.lblhora.Size = new System.Drawing.Size(365, 177); + this.lblhora.TabIndex = 8; + this.lblhora.Text = "label1"; // // flowLayoutPanel1 // @@ -286,6 +282,11 @@ this.pictureBox1.TabIndex = 1; this.pictureBox1.TabStop = false; // + // horafecha + // + this.horafecha.Enabled = true; + this.horafecha.Tick += new System.EventHandler(this.horafecha_Tick); + // // MenuPrincipal // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); diff --git a/MenuPrincipal.cs b/MenuPrincipal.cs index 2b216b8..1d5375a 100644 --- a/MenuPrincipal.cs +++ b/MenuPrincipal.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Data; +using System.Data.SQLite; using System.Drawing; using System.Linq; using System.Text; @@ -39,6 +40,10 @@ namespace compabetov2 { + + + + @@ -67,5 +72,10 @@ namespace compabetov2 this.Dispose(true); } + + private void lblfecha_Click(object sender, EventArgs e) + { + + } } } diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe index d539037..7fd317f 100644 Binary files a/bin/Debug/compabetov2.exe and b/bin/Debug/compabetov2.exe differ diff --git a/bin/Debug/compabetov2.pdb b/bin/Debug/compabetov2.pdb index c19e04b..826ca1d 100644 Binary files a/bin/Debug/compabetov2.pdb and b/bin/Debug/compabetov2.pdb differ diff --git a/bin/Debug/data.db b/bin/Debug/data.db index 84b5e0b..7748c26 100644 Binary files a/bin/Debug/data.db and b/bin/Debug/data.db differ diff --git a/compabetov2.csproj b/compabetov2.csproj index 5df4992..feae6df 100644 --- a/compabetov2.csproj +++ b/compabetov2.csproj @@ -26,7 +26,7 @@ false false true - 0 + 2 1.0.0.%2a false true @@ -52,7 +52,8 @@ 4 - icono.ico + + true @@ -66,6 +67,11 @@ true + + + + C:\Users\Googl\Desktop\CompaBeto\icono.ico + packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll diff --git a/database/DAO.cs b/database/DAO.cs index 2759ea4..b810b91 100644 --- a/database/DAO.cs +++ b/database/DAO.cs @@ -107,14 +107,10 @@ namespace compabetov2.database { conexion.Open(); - string sql = "INSERT INTO Producto (nombre, descripcion, precio, img, stock, idcategoria) "+ - "VALUES (@nombre, @descripcion, @precio, @stock, @img, @idcategoria)"; + string sql = "INSERT INTO Producto (nombre, descripcion, precio, stock, fk_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)) @@ -123,7 +119,6 @@ namespace compabetov2.database command.Parameters.AddWithValue("@descripcion", producto.descripcion); command.Parameters.AddWithValue("@precio", producto.precion); command.Parameters.AddWithValue("@stock", producto.stock); - command.Parameters.AddWithValue("@img", producto.img); command.Parameters.AddWithValue("@idcategoria", producto.categoria.idCategoria); int filasAfectadas = command.ExecuteNonQuery(); @@ -172,7 +167,7 @@ namespace compabetov2.database private static string guardarImg(String rutaImagen) { //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 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 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))", "INSERT INTO Empleado ( nombre, apellido, calle, fecha_contratacion, colonia, cp, no_ext,no_int, referencia, fecha_nac, telefono, activo) VALUES('jefe', '', '', '', '', '', '', '', '', '', '', 0);", diff --git a/database/modelos/Categoria.cs b/database/modelos/Categoria.cs index 3ce619a..0e17572 100644 --- a/database/modelos/Categoria.cs +++ b/database/modelos/Categoria.cs @@ -12,7 +12,7 @@ namespace compabetov2.database.modelos public string nombre; public string descripcion; - public Categoria(int idCategoria, string nombre = "", string descripcion = "") + public Categoria(int idCategoria = 0, string nombre = "", string descripcion = "") { this.idCategoria = idCategoria; this.nombre = nombre; diff --git a/inventario.Designer.cs b/inventario.Designer.cs index 931040e..d8f3d21 100644 --- a/inventario.Designer.cs +++ b/inventario.Designer.cs @@ -50,6 +50,7 @@ this.button7 = new System.Windows.Forms.Button(); this.button8 = new System.Windows.Forms.Button(); this.button9 = new System.Windows.Forms.Button(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); this.flowLayoutPanel1.SuspendLayout(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit(); @@ -58,11 +59,12 @@ // lblfecha // 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.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.Size = new System.Drawing.Size(193, 88); + this.lblfecha.Size = new System.Drawing.Size(126, 46); this.lblfecha.TabIndex = 11; this.lblfecha.Text = "label2"; this.lblfecha.TextAlign = System.Drawing.ContentAlignment.TopCenter; @@ -70,20 +72,22 @@ // lblhora // 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.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.Size = new System.Drawing.Size(365, 177); + this.lblhora.Size = new System.Drawing.Size(249, 91); this.lblhora.TabIndex = 10; this.lblhora.Text = "label1"; // // txtnombreproducto // - this.txtnombreproducto.Font = new System.Drawing.Font("Poppins", 25F); - this.txtnombreproducto.Location = new System.Drawing.Point(497, 350); + this.txtnombreproducto.Font = new System.Drawing.Font("Microsoft Sans Serif", 25F); + 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.Size = new System.Drawing.Size(480, 70); + this.txtnombreproducto.Size = new System.Drawing.Size(361, 45); this.txtnombreproducto.TabIndex = 12; // // flowLayoutPanel1 @@ -96,23 +100,26 @@ this.flowLayoutPanel1.Controls.Add(this.button4); this.flowLayoutPanel1.Controls.Add(this.button5); 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.Size = new System.Drawing.Size(324, 1061); + this.flowLayoutPanel1.Size = new System.Drawing.Size(243, 862); this.flowLayoutPanel1.TabIndex = 8; // // panel2 // this.panel2.BackColor = System.Drawing.Color.Transparent; 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.Size = new System.Drawing.Size(312, 263); + this.panel2.Size = new System.Drawing.Size(234, 214); this.panel2.TabIndex = 8; // // pictureBox7 // 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.Size = new System.Drawing.Size(190, 197); this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; @@ -124,14 +131,15 @@ this.button1.BackColor = System.Drawing.Color.Transparent; this.button1.FlatAppearance.BorderSize = 0; 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.Image = global::compabetov2.Properties.Resources.Menui1; 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.Padding = new System.Windows.Forms.Padding(50, 0, 0, 0); - this.button1.Size = new System.Drawing.Size(312, 115); + this.button1.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0); + this.button1.Size = new System.Drawing.Size(234, 93); this.button1.TabIndex = 8; this.button1.Text = "Menú"; this.button1.UseVisualStyleBackColor = false; @@ -142,14 +150,15 @@ this.button2.BackColor = System.Drawing.Color.Transparent; this.button2.FlatAppearance.BorderSize = 0; 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.Image = global::compabetov2.Properties.Resources.estadisticasi; 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.Padding = new System.Windows.Forms.Padding(50, 0, 0, 0); - this.button2.Size = new System.Drawing.Size(312, 115); + this.button2.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0); + this.button2.Size = new System.Drawing.Size(234, 93); this.button2.TabIndex = 9; this.button2.Text = "Estadisticas"; this.button2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; @@ -160,14 +169,15 @@ this.button3.BackColor = System.Drawing.Color.Transparent; this.button3.FlatAppearance.BorderSize = 0; 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.Image = global::compabetov2.Properties.Resources.productoi; 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.Padding = new System.Windows.Forms.Padding(50, 0, 0, 0); - this.button3.Size = new System.Drawing.Size(312, 115); + this.button3.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0); + this.button3.Size = new System.Drawing.Size(234, 93); this.button3.TabIndex = 10; this.button3.Text = "Productos"; this.button3.UseVisualStyleBackColor = false; @@ -177,14 +187,15 @@ this.button4.BackColor = System.Drawing.Color.Transparent; this.button4.FlatAppearance.BorderSize = 0; 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.Image = global::compabetov2.Properties.Resources.reportesi; 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.Padding = new System.Windows.Forms.Padding(50, 0, 0, 0); - this.button4.Size = new System.Drawing.Size(312, 115); + this.button4.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0); + this.button4.Size = new System.Drawing.Size(234, 93); this.button4.TabIndex = 11; this.button4.Text = "Reportes"; this.button4.UseVisualStyleBackColor = false; @@ -194,51 +205,56 @@ this.button5.BackColor = System.Drawing.Color.Transparent; this.button5.FlatAppearance.BorderSize = 0; 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.Image = global::compabetov2.Properties.Resources.sesionc; 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.Padding = new System.Windows.Forms.Padding(50, 0, 0, 0); - this.button5.Size = new System.Drawing.Size(312, 115); + this.button5.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0); + this.button5.Size = new System.Drawing.Size(234, 93); this.button5.TabIndex = 12; this.button5.Text = "Salir"; this.button5.UseVisualStyleBackColor = false; // // txtprecioproducto // - this.txtprecioproducto.Font = new System.Drawing.Font("Poppins", 25F); - this.txtprecioproducto.Location = new System.Drawing.Point(1031, 350); + this.txtprecioproducto.Font = new System.Drawing.Font("Microsoft Sans Serif", 25F); + 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.Size = new System.Drawing.Size(171, 70); + this.txtprecioproducto.Size = new System.Drawing.Size(129, 45); this.txtprecioproducto.TabIndex = 13; // // txtstockproducto // - this.txtstockproducto.Font = new System.Drawing.Font("Poppins", 25F); - this.txtstockproducto.Location = new System.Drawing.Point(1239, 350); + this.txtstockproducto.Font = new System.Drawing.Font("Microsoft Sans Serif", 25F); + 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.Size = new System.Drawing.Size(171, 70); + this.txtstockproducto.Size = new System.Drawing.Size(129, 45); this.txtstockproducto.TabIndex = 14; // // txtdescripcionproducto // - this.txtdescripcionproducto.Font = new System.Drawing.Font("Poppins", 25F); - this.txtdescripcionproducto.Location = new System.Drawing.Point(497, 502); + this.txtdescripcionproducto.Font = new System.Drawing.Font("Microsoft Sans Serif", 25F); + 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.Name = "txtdescripcionproducto"; - this.txtdescripcionproducto.Size = new System.Drawing.Size(705, 443); + this.txtdescripcionproducto.Size = new System.Drawing.Size(530, 361); this.txtdescripcionproducto.TabIndex = 15; // // label1 // 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.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.Size = new System.Drawing.Size(394, 60); + this.label1.Size = new System.Drawing.Size(266, 31); this.label1.TabIndex = 16; this.label1.Text = "Nombre del producto"; this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter; @@ -246,11 +262,12 @@ // label2 // 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.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.Size = new System.Drawing.Size(132, 60); + this.label2.Size = new System.Drawing.Size(91, 31); this.label2.TabIndex = 17; this.label2.Text = "Precio"; this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter; @@ -258,11 +275,12 @@ // label3 // 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.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.Size = new System.Drawing.Size(121, 60); + this.label3.Size = new System.Drawing.Size(83, 31); this.label3.TabIndex = 18; this.label3.Text = "Stock"; this.label3.TextAlign = System.Drawing.ContentAlignment.TopCenter; @@ -270,21 +288,23 @@ // label4 // 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.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.Size = new System.Drawing.Size(456, 60); + this.label4.Size = new System.Drawing.Size(313, 31); this.label4.TabIndex = 19; this.label4.Text = "Descripción del producto"; this.label4.TextAlign = System.Drawing.ContentAlignment.TopCenter; // // button6 // - this.button6.Font = new System.Drawing.Font("Poppins SemiBold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button6.Location = new System.Drawing.Point(1239, 502); + 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(929, 408); + this.button6.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 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.Text = "Agregar"; this.button6.UseVisualStyleBackColor = true; @@ -292,39 +312,57 @@ // // button7 // - this.button7.Font = new System.Drawing.Font("Poppins SemiBold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button7.Location = new System.Drawing.Point(1239, 622); + 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(929, 505); + this.button7.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 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.Text = "Buscar"; this.button7.UseVisualStyleBackColor = true; // // button8 // - this.button8.Font = new System.Drawing.Font("Poppins SemiBold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button8.Location = new System.Drawing.Point(1239, 756); + 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(929, 614); + this.button8.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 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.Text = "Editar"; this.button8.UseVisualStyleBackColor = true; // // button9 // - this.button9.Font = new System.Drawing.Font("Poppins SemiBold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button9.Location = new System.Drawing.Point(1239, 875); + 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(929, 711); + this.button9.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 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.Text = "Eliminar"; 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 // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 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.button8); this.Controls.Add(this.button7); @@ -340,9 +378,11 @@ this.Controls.Add(this.lblfecha); this.Controls.Add(this.lblhora); this.Controls.Add(this.flowLayoutPanel1); + this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.Name = "inventario"; this.Text = "inventario"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.Load += new System.EventHandler(this.inventario_Load); this.flowLayoutPanel1.ResumeLayout(false); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); @@ -376,5 +416,6 @@ private System.Windows.Forms.Button button7; private System.Windows.Forms.Button button8; private System.Windows.Forms.Button button9; + private System.Windows.Forms.ComboBox comboBox1; } } \ No newline at end of file diff --git a/inventario.cs b/inventario.cs index 2933d69..860b3bd 100644 --- a/inventario.cs +++ b/inventario.cs @@ -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) + { + + } } } diff --git a/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/obj/Debug/DesignTimeResolveAssemblyReferences.cache index b27a436..10a1a65 100644 Binary files a/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index da7b35a..b16bcfc 100644 Binary files a/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/obj/Debug/compabetov2.csproj.AssemblyReference.cache b/obj/Debug/compabetov2.csproj.AssemblyReference.cache index 1367df0..314837d 100644 Binary files a/obj/Debug/compabetov2.csproj.AssemblyReference.cache and b/obj/Debug/compabetov2.csproj.AssemblyReference.cache differ diff --git a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt index 9c9e734..9340bd0 100644 --- a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt +++ b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt @@ -43,3 +43,12 @@ 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.personal.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 +C:\Users\Googl\Documents\compabetov2\bin\Debug\compabetov2.exe.manifest +C:\Users\Googl\Documents\compabetov2\bin\Debug\compabetov2.application +C:\Users\Googl\Documents\compabetov2\obj\Debug\compabetov2.exe.manifest +C:\Users\Googl\Documents\compabetov2\obj\Debug\compabetov2.application diff --git a/obj/Debug/compabetov2.exe b/obj/Debug/compabetov2.exe index d539037..7fd317f 100644 Binary files a/obj/Debug/compabetov2.exe and b/obj/Debug/compabetov2.exe differ diff --git a/obj/Debug/compabetov2.pdb b/obj/Debug/compabetov2.pdb index c19e04b..826ca1d 100644 Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ