diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index bbe38c7..04825ae 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -2,6 +2,6 @@ "ExpandedNodes": [ "" ], - "SelectedNode": "\\App.config", + "SelectedNode": "\\agregarmermas.cs", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/compabetoOG/v17/.wsuo b/.vs/compabetoOG/v17/.wsuo index 5bcf94c..58438ad 100644 Binary files a/.vs/compabetoOG/v17/.wsuo and b/.vs/compabetoOG/v17/.wsuo differ diff --git a/.vs/compabetov2.csproj.dtbcache.json b/.vs/compabetov2.csproj.dtbcache.json index c3c8256..10c629f 100644 --- a/.vs/compabetov2.csproj.dtbcache.json +++ b/.vs/compabetov2.csproj.dtbcache.json @@ -1 +1 @@ -{"RootPath":"C:\\Users\\carsu\\source\\repos\\compabetoOG","ProjectFileName":"compabetov2.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"AgregarEmpleado.cs"},{"SourceFile":"AgregarEmpleado.Designer.cs"},{"SourceFile":"AgregarLogin.cs"},{"SourceFile":"AgregarLogin.Designer.cs"},{"SourceFile":"cuentas.cs"},{"SourceFile":"cuentas.Designer.cs"},{"SourceFile":"database\\conexion.cs"},{"SourceFile":"database\\DAO.cs"},{"SourceFile":"database\\modelos\\Categoria.cs"},{"SourceFile":"database\\modelos\\Cliente.cs"},{"SourceFile":"database\\modelos\\Empleado.cs"},{"SourceFile":"database\\modelos\\Producto.cs"},{"SourceFile":"database\\modelos\\usuario.cs"},{"SourceFile":"database\\service.cs"},{"SourceFile":"EditarEmpleado.cs"},{"SourceFile":"EditarEmpleado.Designer.cs"},{"SourceFile":"envios.cs"},{"SourceFile":"envios.Designer.cs"},{"SourceFile":"inventario.cs"},{"SourceFile":"inventario.Designer.cs"},{"SourceFile":"login.cs"},{"SourceFile":"login.Designer.cs"},{"SourceFile":"MenuPrincipal.cs"},{"SourceFile":"MenuPrincipal.Designer.cs"},{"SourceFile":"mermas.cs"},{"SourceFile":"mermas.Designer.cs"},{"SourceFile":"personal.cs"},{"SourceFile":"personal.Designer.cs"},{"SourceFile":"preguntaLogin.cs"},{"SourceFile":"preguntaLogin.Designer.cs"},{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"vender.cs"},{"SourceFile":"vender.Designer.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\packages\\EntityFramework.6.4.4\\lib\\net45\\EntityFramework.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\packages\\EntityFramework.6.4.4\\lib\\net45\\EntityFramework.SqlServer.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.ComponentModel.DataAnnotations.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\packages\\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\\lib\\net46\\System.Data.SQLite.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\packages\\System.Data.SQLite.EF6.1.0.118.0\\lib\\net46\\System.Data.SQLite.EF6.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\packages\\System.Data.SQLite.Linq.1.0.118.0\\lib\\net46\\System.Data.SQLite.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Deployment.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\bin\\Debug\\compabetov2.exe","OutputItemRelativePath":"compabetov2.exe"},{"OutputItemFullPath":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\bin\\Debug\\compabetov2.pdb","OutputItemRelativePath":"compabetov2.pdb"}],"CopyToOutputEntries":[]} \ No newline at end of file +{"RootPath":"C:\\Users\\carsu\\Source\\Repos\\compabetoOG","ProjectFileName":"compabetov2.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"AgregarEmpleado.cs"},{"SourceFile":"AgregarEmpleado.Designer.cs"},{"SourceFile":"AgregarLogin.cs"},{"SourceFile":"AgregarLogin.Designer.cs"},{"SourceFile":"cuentas.cs"},{"SourceFile":"cuentas.Designer.cs"},{"SourceFile":"database\\conexion.cs"},{"SourceFile":"database\\DAO.cs"},{"SourceFile":"database\\modelos\\Categoria.cs"},{"SourceFile":"database\\modelos\\Cliente.cs"},{"SourceFile":"database\\modelos\\Empleado.cs"},{"SourceFile":"database\\modelos\\LoginModel.cs"},{"SourceFile":"database\\modelos\\Producto.cs"},{"SourceFile":"database\\modelos\\usuario.cs"},{"SourceFile":"database\\service.cs"},{"SourceFile":"EditarEmpleado.cs"},{"SourceFile":"EditarEmpleado.Designer.cs"},{"SourceFile":"envios.cs"},{"SourceFile":"envios.Designer.cs"},{"SourceFile":"inventario.cs"},{"SourceFile":"inventario.Designer.cs"},{"SourceFile":"login.cs"},{"SourceFile":"login.Designer.cs"},{"SourceFile":"MenuPrincipal.cs"},{"SourceFile":"MenuPrincipal.Designer.cs"},{"SourceFile":"mermas.cs"},{"SourceFile":"mermas.Designer.cs"},{"SourceFile":"ModificarContra.cs"},{"SourceFile":"ModificarContra.Designer.cs"},{"SourceFile":"personal.cs"},{"SourceFile":"personal.Designer.cs"},{"SourceFile":"preguntaLogin.cs"},{"SourceFile":"preguntaLogin.Designer.cs"},{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"vender.cs"},{"SourceFile":"vender.Designer.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Users\\carsu\\Source\\Repos\\compabetoOG\\packages\\EntityFramework.6.4.4\\lib\\net45\\EntityFramework.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Users\\carsu\\Source\\Repos\\compabetoOG\\packages\\EntityFramework.6.4.4\\lib\\net45\\EntityFramework.SqlServer.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.ComponentModel.DataAnnotations.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Users\\carsu\\Source\\Repos\\compabetoOG\\packages\\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\\lib\\net46\\System.Data.SQLite.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Users\\carsu\\Source\\Repos\\compabetoOG\\packages\\System.Data.SQLite.EF6.1.0.118.0\\lib\\net46\\System.Data.SQLite.EF6.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Users\\carsu\\Source\\Repos\\compabetoOG\\packages\\System.Data.SQLite.Linq.1.0.118.0\\lib\\net46\\System.Data.SQLite.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Deployment.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\Users\\carsu\\Source\\Repos\\compabetoOG\\bin\\Debug\\compabetov2.exe","OutputItemRelativePath":"compabetov2.exe"},{"OutputItemFullPath":"C:\\Users\\carsu\\Source\\Repos\\compabetoOG\\bin\\Debug\\compabetov2.pdb","OutputItemRelativePath":"compabetov2.pdb"}],"CopyToOutputEntries":[]} \ No newline at end of file diff --git a/ActualizarMerma.Designer.cs b/ActualizarMerma.Designer.cs new file mode 100644 index 0000000..1970c35 --- /dev/null +++ b/ActualizarMerma.Designer.cs @@ -0,0 +1,153 @@ +namespace compabetov2 +{ + partial class ActualizarMerma + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.btnCancelar = new System.Windows.Forms.Button(); + this.btnAgregar = new System.Windows.Forms.Button(); + this.txtResponsable = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.dtFecha = new System.Windows.Forms.DateTimePicker(); + this.txtDescripcion = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // btnCancelar + // + this.btnCancelar.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnCancelar.Location = new System.Drawing.Point(483, 340); + this.btnCancelar.Name = "btnCancelar"; + this.btnCancelar.Size = new System.Drawing.Size(93, 45); + this.btnCancelar.TabIndex = 15; + this.btnCancelar.Text = "Cancelar"; + this.btnCancelar.UseVisualStyleBackColor = true; + // + // btnAgregar + // + this.btnAgregar.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnAgregar.Location = new System.Drawing.Point(375, 340); + this.btnAgregar.Name = "btnAgregar"; + this.btnAgregar.Size = new System.Drawing.Size(93, 45); + this.btnAgregar.TabIndex = 14; + this.btnAgregar.Text = "Editar"; + this.btnAgregar.UseVisualStyleBackColor = true; + this.btnAgregar.Click += new System.EventHandler(this.btnAgregar_Click); + // + // txtResponsable + // + this.txtResponsable.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtResponsable.Location = new System.Drawing.Point(241, 10); + this.txtResponsable.Name = "txtResponsable"; + this.txtResponsable.Size = new System.Drawing.Size(348, 29); + this.txtResponsable.TabIndex = 13; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.Location = new System.Drawing.Point(110, 10); + this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(126, 24); + this.label3.TabIndex = 12; + this.label3.Text = "Responsable:"; + // + // dtFecha + // + this.dtFecha.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.dtFecha.Location = new System.Drawing.Point(241, 85); + this.dtFecha.Name = "dtFecha"; + this.dtFecha.Size = new System.Drawing.Size(348, 29); + this.dtFecha.TabIndex = 11; + // + // txtDescripcion + // + this.txtDescripcion.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtDescripcion.Location = new System.Drawing.Point(11, 119); + this.txtDescripcion.Margin = new System.Windows.Forms.Padding(2); + this.txtDescripcion.Multiline = true; + this.txtDescripcion.Name = "txtDescripcion"; + this.txtDescripcion.Size = new System.Drawing.Size(578, 195); + this.txtDescripcion.TabIndex = 10; + this.txtDescripcion.TextChanged += new System.EventHandler(this.txtDescripcion_TextChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(11, 85); + this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(115, 24); + this.label2.TabIndex = 9; + this.label2.Text = "Descripcion:"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(167, 89); + this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(69, 24); + this.label1.TabIndex = 8; + this.label1.Text = "Fecha:"; + // + // ActualizarMerma + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(605, 399); + this.Controls.Add(this.btnCancelar); + this.Controls.Add(this.btnAgregar); + this.Controls.Add(this.txtResponsable); + this.Controls.Add(this.label3); + this.Controls.Add(this.dtFecha); + this.Controls.Add(this.txtDescripcion); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Name = "ActualizarMerma"; + this.Text = "Modificar Merma"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnCancelar; + private System.Windows.Forms.Button btnAgregar; + private System.Windows.Forms.TextBox txtResponsable; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.DateTimePicker dtFecha; + private System.Windows.Forms.TextBox txtDescripcion; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + } +} \ No newline at end of file diff --git a/ActualizarMerma.cs b/ActualizarMerma.cs new file mode 100644 index 0000000..5ec100b --- /dev/null +++ b/ActualizarMerma.cs @@ -0,0 +1,51 @@ +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 ActualizarMerma : Form + { + private Merma merma; + private mermas ventanaPadre; + public ActualizarMerma(Merma merma, mermas ventanaPadre) + { + InitializeComponent(); + this.merma = merma; + this.ventanaPadre = ventanaPadre; + llenarCampos(); + } + + private void llenarCampos() + { + txtDescripcion.Text = merma.razon; + txtResponsable.Text = merma.responsable; + dtFecha.Text = merma.fecha; + } + + private void btnAgregar_Click(object sender, EventArgs e) + { + Merma nuevaMerma = new Merma(merma.idMerma,dtFecha.Text,txtResponsable.Text,txtDescripcion.Text); + if (service.actualizarMerma(nuevaMerma)) + { + MessageBox.Show("Merma actualizada"); + ventanaPadre.llenarPanel(); + Close(); + } + + } + + private void txtDescripcion_TextChanged(object sender, EventArgs e) + { + + } + } +} diff --git a/ActualizarMerma.resx b/ActualizarMerma.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ActualizarMerma.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/agregarmermas.Designer.cs b/agregarmermas.Designer.cs index f61054f..8905ea3 100644 --- a/agregarmermas.Designer.cs +++ b/agregarmermas.Designer.cs @@ -30,44 +30,111 @@ { this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); - this.textBox1 = new System.Windows.Forms.TextBox(); + this.txtDescripcion = new System.Windows.Forms.TextBox(); + this.dtFecha = new System.Windows.Forms.DateTimePicker(); + this.label3 = new System.Windows.Forms.Label(); + this.txtResponsable = new System.Windows.Forms.TextBox(); + this.btnAgregar = new System.Windows.Forms.Button(); + this.btnCancelar = new System.Windows.Forms.Button(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(351, 98); + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(167, 96); + this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(44, 16); + this.label1.Size = new System.Drawing.Size(69, 24); this.label1.TabIndex = 0; - this.label1.Text = "label1"; + this.label1.Text = "Fecha:"; // // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(331, 192); + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(11, 92); + this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(44, 16); + this.label2.Size = new System.Drawing.Size(115, 24); this.label2.TabIndex = 1; - this.label2.Text = "label2"; + this.label2.Text = "Descripcion:"; + this.label2.Click += new System.EventHandler(this.label2_Click); // - // textBox1 + // txtDescripcion // - this.textBox1.Location = new System.Drawing.Point(258, 140); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(229, 22); - this.textBox1.TabIndex = 2; + this.txtDescripcion.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtDescripcion.Location = new System.Drawing.Point(11, 126); + this.txtDescripcion.Margin = new System.Windows.Forms.Padding(2); + this.txtDescripcion.Multiline = true; + this.txtDescripcion.Name = "txtDescripcion"; + this.txtDescripcion.Size = new System.Drawing.Size(578, 195); + this.txtDescripcion.TabIndex = 2; + // + // dtFecha + // + this.dtFecha.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.dtFecha.Location = new System.Drawing.Point(241, 92); + this.dtFecha.Name = "dtFecha"; + this.dtFecha.Size = new System.Drawing.Size(348, 29); + this.dtFecha.TabIndex = 3; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.Location = new System.Drawing.Point(110, 17); + this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(126, 24); + this.label3.TabIndex = 4; + this.label3.Text = "Responsable:"; + // + // txtResponsable + // + this.txtResponsable.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtResponsable.Location = new System.Drawing.Point(241, 17); + this.txtResponsable.Name = "txtResponsable"; + this.txtResponsable.Size = new System.Drawing.Size(348, 29); + this.txtResponsable.TabIndex = 5; + // + // btnAgregar + // + this.btnAgregar.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnAgregar.Location = new System.Drawing.Point(375, 347); + this.btnAgregar.Name = "btnAgregar"; + this.btnAgregar.Size = new System.Drawing.Size(93, 45); + this.btnAgregar.TabIndex = 6; + this.btnAgregar.Text = "Agregar"; + this.btnAgregar.UseVisualStyleBackColor = true; + this.btnAgregar.Click += new System.EventHandler(this.btnAgregar_Click); + // + // btnCancelar + // + this.btnCancelar.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnCancelar.Location = new System.Drawing.Point(483, 347); + this.btnCancelar.Name = "btnCancelar"; + this.btnCancelar.Size = new System.Drawing.Size(93, 45); + this.btnCancelar.TabIndex = 7; + this.btnCancelar.Text = "Cancelar"; + this.btnCancelar.UseVisualStyleBackColor = true; // // agregarmermas // - 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(800, 450); - this.Controls.Add(this.textBox1); + this.ClientSize = new System.Drawing.Size(600, 404); + this.Controls.Add(this.btnCancelar); + this.Controls.Add(this.btnAgregar); + this.Controls.Add(this.txtResponsable); + this.Controls.Add(this.label3); + this.Controls.Add(this.dtFecha); + this.Controls.Add(this.txtDescripcion); this.Controls.Add(this.label2); this.Controls.Add(this.label1); + this.Margin = new System.Windows.Forms.Padding(2); this.Name = "agregarmermas"; - this.Text = "agregarmermas"; + this.Text = "Agregar Merma"; this.ResumeLayout(false); this.PerformLayout(); @@ -77,6 +144,11 @@ private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox txtDescripcion; + private System.Windows.Forms.DateTimePicker dtFecha; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txtResponsable; + private System.Windows.Forms.Button btnAgregar; + private System.Windows.Forms.Button btnCancelar; } } \ No newline at end of file diff --git a/agregarmermas.cs b/agregarmermas.cs index d962dda..c4cadd9 100644 --- a/agregarmermas.cs +++ b/agregarmermas.cs @@ -1,4 +1,6 @@ -using System; +using compabetov2.database; +using compabetov2.database.modelos; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -12,9 +14,28 @@ namespace compabetov2 { public partial class agregarmermas : Form { - public agregarmermas() + private mermas ventanaPadre; + public agregarmermas(mermas ventanaPadre) { InitializeComponent(); + this.ventanaPadre = ventanaPadre; + } + + private void label2_Click(object sender, EventArgs e) + { + + } + + private void btnAgregar_Click(object sender, EventArgs e) + { + string descripcion = txtDescripcion.Text; + string fecha = dtFecha.Text; + string responsable = txtResponsable.Text; + Merma merma = new Merma(-1,fecha,responsable,descripcion); + if (service.insertarMerma(merma)) { + ventanaPadre.llenarPanel(); + Close(); + } } } } diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe index 9ecc006..f740321 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 da6e687..e2bd9ec 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 3928388..0055a4e 100644 Binary files a/bin/Debug/data.db and b/bin/Debug/data.db differ diff --git a/compabetov2.csproj b/compabetov2.csproj index 23ea79b..fbb5e8d 100644 --- a/compabetov2.csproj +++ b/compabetov2.csproj @@ -103,6 +103,12 @@ + + Form + + + ActualizarMerma.cs + Form @@ -131,10 +137,13 @@ + + + Form @@ -198,6 +207,15 @@ vender.cs + + Form + + + verMerma.cs + + + ActualizarMerma.cs + AgregarEmpleado.cs Designer @@ -253,6 +271,9 @@ vender.cs + + verMerma.cs + diff --git a/database/DAO.cs b/database/DAO.cs index ba8a26c..6c10cc6 100644 --- a/database/DAO.cs +++ b/database/DAO.cs @@ -697,6 +697,181 @@ namespace compabetov2.database return rutaDestino; } + public static SQLiteDataReader conseguirMermaDAO() + { + SQLiteDataReader reader = null; + var db_conexion = new Conexion(); + try + { + SQLiteConnection conexion = db_conexion.get_connection(); + + conexion.Open(); + + string sql = "SELECT * FROM Merma"; + SQLiteCommand command = new SQLiteCommand(sql, conexion); + reader = command.ExecuteReader(); + + return reader; + + } + catch (SQLiteException ex) + { + MessageBox.Show(ex.Message); + return reader; + } + } + + public static bool insertarMermaDAO(Merma merma) + { + var db_conexion = new Conexion(); + try + { + using (SQLiteConnection conexion = db_conexion.get_connection()) + { + conexion.Open(); + + string sql = "INSERT INTO Merma (fecha, responsable, razon) VALUES(@fecha, @responsable, @razon);"; + + using (SQLiteCommand command = new SQLiteCommand(sql, conexion)) + { + command.Parameters.AddWithValue("@fecha", merma.fecha); + command.Parameters.AddWithValue("@responsable", merma.responsable); + command.Parameters.AddWithValue("@razon", merma.razon); + int filasAfectadas = command.ExecuteNonQuery(); + + if (filasAfectadas > 0) { return true; } + else { return false; } + } + } + } + catch (SQLiteException ex) + { + MessageBox.Show(ex.Message); + return false; + } + } + + public static bool crearVentaDAO(VentaModel venta, List detalleVentas) + { + var db_conexion = new Conexion(); + try + { + using (SQLiteConnection conexion = db_conexion.get_connection()) + { + conexion.Open(); + + using (var transaccion = conexion.BeginTransaction()) + { + try + { + string sqlVenta = "INSERT INTO venta (fecha, total) VALUES(@fecha, @total);"; + string sqlDetalle = "INSERT INTO detalle_venta (fk_venta, fk_producto, cantidad) VALUES(@idVenta, @idProducto, @cantidada);"; + string sqlIdVenta = "SELECT idVenta FROM venta ORDER BY idVenta DESC LIMIT 1"; + + + SQLiteCommand commandVenta = new SQLiteCommand(sqlVenta, conexion); + commandVenta.Parameters.AddWithValue("@fecha", DateTime.Now.ToString()); + commandVenta.Parameters.AddWithValue("@total", venta.total); + commandVenta.ExecuteNonQuery(); + + SQLiteCommand commandConsulta = new SQLiteCommand(sqlIdVenta, conexion); + SQLiteDataReader reader = commandConsulta.ExecuteReader(); + + long idVenta = -1; + while (reader.Read()) + { + idVenta = reader.GetInt64(0); + } + + foreach (DetalleVentaModel detalleVenta in detalleVentas) + { + SQLiteCommand commandEmpleado = new SQLiteCommand(sqlDetalle, conexion); + commandEmpleado.Parameters.AddWithValue("@idVenta", idVenta); + commandEmpleado.Parameters.AddWithValue("@idProducto", detalleVenta.producto.idProducto); + commandEmpleado.Parameters.AddWithValue("@cantidada", detalleVenta.cantidad); + commandEmpleado.ExecuteNonQuery(); + } + + transaccion.Commit(); + return true; + } + catch (SQLiteException ex) + { + transaccion.Rollback(); + MessageBox.Show(ex.Message); + return false; + } + } + } + } + catch (SQLiteException ex) + { + MessageBox.Show(ex.Message); + return false; + } + } + + public static bool eliminarMermaDAO(Merma merma) + { + var db_conexion = new Conexion(); + try + { + using (SQLiteConnection conexion = db_conexion.get_connection()) + { + conexion.Open(); + + string sql = "DELETE FROM Merma WHERE idmerma = @idmerma;"; + + using (SQLiteCommand command = new SQLiteCommand(sql, conexion)) + { + command.Parameters.AddWithValue("@idmerma", merma.idMerma); + int filasAfectadas = command.ExecuteNonQuery(); + + if (filasAfectadas > 0) { return true; } + else { return false; } + } + } + } + catch (SQLiteException ex) + { + MessageBox.Show(ex.Message); + return false; + } + } + + public static bool actualizarMermaDAO(Merma merma) + { + var db_conexion = new Conexion(); + try + { + using (SQLiteConnection conexion = db_conexion.get_connection()) + { + conexion.Open(); + + string sql = "UPDATE Merma SET fecha = @fecha, responsable = @responsable, razon = @razon WHERE idmerma = @idmerma; "; + + using (SQLiteCommand command = new SQLiteCommand(sql, conexion)) + { + command.Parameters.AddWithValue("@fecha", merma.fecha); + command.Parameters.AddWithValue("@responsable", merma.responsable); + command.Parameters.AddWithValue("@razon", merma.razon); + command.Parameters.AddWithValue("@idmerma", merma.idMerma); + + int filasAfectadas = command.ExecuteNonQuery(); + + if (filasAfectadas > 0) { return true; } + else { return false; } + } + } + } + catch (SQLiteException ex) + { + MessageBox.Show(ex.Message); + return false; + } + } + + private static void crearDB() { var db_conexion = new Conexion(); @@ -708,16 +883,19 @@ namespace compabetov2.database { "DROP TABLE IF EXISTS Empleado", "DROP TABLE IF EXISTS Login", + "DROP TABLE IF EXISTS detalle_venta", "DROP TABLE IF EXISTS Producto", "DROP TABLE IF EXISTS Categoria", "DROP TABLE IF EXISTS Cliente", + "DROP TABLE IF EXISTS Merma", + "DROP TABLE IF EXISTS venta", "CREATE TABLE Login (idlogin INTEGER PRIMARY KEY AUTOINCREMENT, tipo TEXT NOT NULL, usuario TEXT NOT NULL, "+ "contra TEXT NOT NULL)", "CREATE TABLE Empleado (idempleado INTEGER PRIMARY KEY AUTOINCREMENT, nombre TEXT NOT NULL, "+ "apellidos TEXT NOT NULL, calle TEXT NOT NULL, fecha_contratacion TEXT NOT NULL,estado TEXT NOT NULL, colonia TEXT NOT NULL, cp TEXT NOT NULL, no_ext TEXT NOT NULL," + - "no_int TEXT NOT NULL, referencia TEXT NOT NULL, fecha_nac TEXT NOT NULL, telefono TEXT NOT NULL, fk_idLogin INTEGER," + + "no_int TEXT NOT NULL, referencia TEXT NOT NULL, fecha_nac TEXT NOT NULL, telefono TEXT NOT NULL,img TEXT DEFAULT '', fk_idLogin INTEGER," + "FOREIGN KEY (fk_idLogin) REFERENCES Login(idlogin))", "CREATE TABLE Categoria (idcategoria INTEGER PRIMARY KEY AUTOINCREMENT, nombre TEXT NOT NULL, descripcion TEXT NOT NULL)", @@ -730,6 +908,13 @@ namespace compabetov2.database "calle TEXT NOT NULL, colonia TEXT NOT NULL, cp TEXT NOT NULL, no_ext TEXT NOT NULL, no_int TEXT NOT NULL, referencia TEXT NOT NULL, " + "telefono TEXT NOT NULL, telefono_extra TEXT NOT NULL)", + "CREATE TABLE Merma (idmerma INTEGER PRIMARY KEY AUTOINCREMENT, fecha TEXT, responsable TEXT, razon TEXT)", + + "CREATE TABLE venta (idVenta INTEGER PRIMARY KEY AUTOINCREMENT,fecha TEXT, total DECIMAL(10, 2));", + + "CREATE TABLE detalle_venta (fk_venta INTEGER, fk_producto INTEGER, PRIMARY KEY (fk_venta, fk_producto), " + + "FOREIGN KEY (fk_venta) REFERENCES venta(idVenta),FOREIGN KEY (fk_producto) REFERENCES producto(idproducto));", + "INSERT INTO Login ( tipo, usuario, contra) VALUES('admin', 'admin', '12345');", "INSERT INTO Empleado ( nombre, apellidos, calle, fecha_contratacion,estado, colonia, cp, no_ext,no_int, referencia, fecha_nac, telefono,fk_idLogin) VALUES('jefe', '', '', '', '', '', '', '', '', '', '', '',1);", diff --git a/database/modelos/Categoria.cs b/database/modelos/Categoria.cs index 0e17572..07d3971 100644 --- a/database/modelos/Categoria.cs +++ b/database/modelos/Categoria.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace compabetov2.database.modelos { - internal class Categoria + public class Categoria { public int idCategoria; public string nombre; diff --git a/database/modelos/DetalleVentaModel.cs b/database/modelos/DetalleVentaModel.cs new file mode 100644 index 0000000..e102b67 --- /dev/null +++ b/database/modelos/DetalleVentaModel.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace compabetov2.database.modelos +{ + public class DetalleVentaModel + { + public int id; + public int cantidad; + public Producto producto; + + public DetalleVentaModel(int cantidad, Producto producto, int id = -1) + { + this.cantidad = cantidad; + this.producto = producto; + this.id = id; + } + } +} diff --git a/database/modelos/Merma.cs b/database/modelos/Merma.cs new file mode 100644 index 0000000..8d9491d --- /dev/null +++ b/database/modelos/Merma.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace compabetov2.database.modelos +{ + public class Merma + { + public long idMerma; + public string fecha; + public string responsable; + public string razon; + + public Merma(long idMerma, string fecha, string responsable, string razon) + { + this.idMerma = idMerma; + this.fecha = fecha; + this.responsable = responsable; + this.razon = razon; + } + } +} diff --git a/database/modelos/Producto.cs b/database/modelos/Producto.cs index df9cf79..a84afb3 100644 --- a/database/modelos/Producto.cs +++ b/database/modelos/Producto.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace compabetov2.database.modelos { - internal class Producto + public class Producto { public int idProducto; public string nombre; diff --git a/database/modelos/VentaModel.cs b/database/modelos/VentaModel.cs new file mode 100644 index 0000000..b110e17 --- /dev/null +++ b/database/modelos/VentaModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace compabetov2.database.modelos +{ + public class VentaModel + { + public int id; + public string fecha; + public decimal total; + + public VentaModel(decimal total = 0, int id = -1, string fecha = "") { + this.id = id; + this.fecha = fecha; + this.total = total; + } + } +} diff --git a/database/service.cs b/database/service.cs index f19110a..eeaa496 100644 --- a/database/service.cs +++ b/database/service.cs @@ -183,5 +183,44 @@ namespace compabetov2.database { return DAO.modificarContraDAO(empleado, contra); } + + public static List conseguirMerma() + { + List mermas = new List(); + SQLiteDataReader reader = DAO.conseguirMermaDAO(); + + while (reader.Read()) + { + Merma merma = new Merma( + reader.GetInt64(0), + reader.GetString(1), + reader.GetString(2), + reader.GetString(3) + ); + mermas.Add(merma); + } + + return mermas; + } + + public static bool crearVentaDAO(VentaModel venta, List detalleVentas) + { + return DAO.crearVentaDAO(venta, detalleVentas); + } + + public static bool insertarMerma(Merma merma) + { + return DAO.insertarMermaDAO(merma); + } + + public static bool eliminarMerma(Merma merma) + { + return DAO.eliminarMermaDAO(merma); + } + + public static bool actualizarMerma(Merma merma) + { + return DAO.actualizarMermaDAO(merma); + } } } diff --git a/inventario.cs b/inventario.cs index cc59d35..7c1d485 100644 --- a/inventario.cs +++ b/inventario.cs @@ -141,7 +141,7 @@ namespace compabetov2 private void button1_Click(object sender, EventArgs e) { MenuPrincipal menuPrincipal = new MenuPrincipal(loginPrincipal); - menuPrincipal.Show(); + menuPrincipal.ShowDialog(); this.Dispose(); diff --git a/mermas.Designer.cs b/mermas.Designer.cs index 626ab5c..2faa4ff 100644 --- a/mermas.Designer.cs +++ b/mermas.Designer.cs @@ -40,6 +40,8 @@ this.lblfecha = new System.Windows.Forms.Label(); this.lblhora = new System.Windows.Forms.Label(); this.horafecha = new System.Windows.Forms.Timer(this.components); + this.mermaPanel = new System.Windows.Forms.FlowLayoutPanel(); + this.btnAgregar = new System.Windows.Forms.Button(); this.flowLayoutPanel1.SuspendLayout(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit(); @@ -55,26 +57,26 @@ this.flowLayoutPanel1.Controls.Add(this.button4); this.flowLayoutPanel1.Controls.Add(this.button5); this.flowLayoutPanel1.Location = new System.Drawing.Point(-1, -1); - this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(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 = 9; // // panel2 // this.panel2.BackColor = System.Drawing.Color.Transparent; this.panel2.Controls.Add(this.pictureBox7); - this.panel2.Location = new System.Drawing.Point(3, 2); - this.panel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel2.Location = new System.Drawing.Point(2, 2); + this.panel2.Margin = new System.Windows.Forms.Padding(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, 34); - this.pictureBox7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.pictureBox7.Location = new System.Drawing.Point(48, 28); + this.pictureBox7.Margin = new System.Windows.Forms.Padding(2); this.pictureBox7.Name = "pictureBox7"; this.pictureBox7.Size = new System.Drawing.Size(190, 197); this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; @@ -90,11 +92,11 @@ 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, 269); - this.button1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button1.Location = new System.Drawing.Point(2, 220); + this.button1.Margin = new System.Windows.Forms.Padding(2); this.button1.Name = "button1"; - this.button1.Padding = new System.Windows.Forms.Padding(51, 0, 0, 0); - this.button1.Size = new System.Drawing.Size(312, 114); + 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; @@ -109,11 +111,11 @@ 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, 387); - this.button2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button2.Location = new System.Drawing.Point(2, 317); + this.button2.Margin = new System.Windows.Forms.Padding(2); this.button2.Name = "button2"; - this.button2.Padding = new System.Windows.Forms.Padding(51, 0, 0, 0); - this.button2.Size = new System.Drawing.Size(312, 114); + 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; @@ -128,11 +130,11 @@ 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, 505); - this.button3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button3.Location = new System.Drawing.Point(2, 414); + this.button3.Margin = new System.Windows.Forms.Padding(2); this.button3.Name = "button3"; - this.button3.Padding = new System.Windows.Forms.Padding(51, 0, 0, 0); - this.button3.Size = new System.Drawing.Size(312, 114); + 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; @@ -146,11 +148,11 @@ 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, 623); - this.button4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button4.Location = new System.Drawing.Point(2, 511); + this.button4.Margin = new System.Windows.Forms.Padding(2); this.button4.Name = "button4"; - this.button4.Padding = new System.Windows.Forms.Padding(51, 0, 0, 0); - this.button4.Size = new System.Drawing.Size(312, 114); + 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; @@ -164,11 +166,11 @@ 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, 741); - this.button5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button5.Location = new System.Drawing.Point(2, 608); + this.button5.Margin = new System.Windows.Forms.Padding(2); this.button5.Name = "button5"; - this.button5.Padding = new System.Windows.Forms.Padding(51, 0, 0, 0); - this.button5.Size = new System.Drawing.Size(312, 114); + 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; @@ -178,9 +180,10 @@ this.lblfecha.AutoSize = true; 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(741, 154); + this.lblfecha.Location = new System.Drawing.Point(556, 125); + this.lblfecha.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.lblfecha.Name = "lblfecha"; - this.lblfecha.Size = new System.Drawing.Size(159, 58); + this.lblfecha.Size = new System.Drawing.Size(126, 46); this.lblfecha.TabIndex = 15; this.lblfecha.Text = "label2"; this.lblfecha.TextAlign = System.Drawing.ContentAlignment.TopCenter; @@ -190,9 +193,10 @@ this.lblhora.AutoSize = true; 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(929, 35); + this.lblhora.Location = new System.Drawing.Point(697, 28); + this.lblhora.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.lblhora.Name = "lblhora"; - this.lblhora.Size = new System.Drawing.Size(318, 113); + this.lblhora.Size = new System.Drawing.Size(249, 91); this.lblhora.TabIndex = 14; this.lblhora.Text = "label1"; // @@ -201,14 +205,36 @@ this.horafecha.Enabled = true; this.horafecha.Tick += new System.EventHandler(this.horafecha_Tick_2); // + // mermaPanel + // + this.mermaPanel.Location = new System.Drawing.Point(429, 283); + this.mermaPanel.Name = "mermaPanel"; + this.mermaPanel.Size = new System.Drawing.Size(779, 402); + this.mermaPanel.TabIndex = 16; + this.mermaPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.mermaPanel_Paint); + // + // btnAgregar + // + this.btnAgregar.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnAgregar.Location = new System.Drawing.Point(787, 219); + this.btnAgregar.Name = "btnAgregar"; + this.btnAgregar.Size = new System.Drawing.Size(89, 28); + this.btnAgregar.TabIndex = 17; + this.btnAgregar.Text = "Agregar"; + this.btnAgregar.UseVisualStyleBackColor = true; + this.btnAgregar.Click += new System.EventHandler(this.btnAgregar_Click); + // // mermas // - 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(1370, 749); + this.Controls.Add(this.btnAgregar); + this.Controls.Add(this.mermaPanel); this.Controls.Add(this.lblfecha); this.Controls.Add(this.lblhora); this.Controls.Add(this.flowLayoutPanel1); + this.Margin = new System.Windows.Forms.Padding(2); this.Name = "mermas"; this.Text = "mermas"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; @@ -235,5 +261,7 @@ private System.Windows.Forms.Label lblfecha; private System.Windows.Forms.Label lblhora; private System.Windows.Forms.Timer horafecha; + private System.Windows.Forms.FlowLayoutPanel mermaPanel; + private System.Windows.Forms.Button btnAgregar; } } \ No newline at end of file diff --git a/mermas.cs b/mermas.cs index c3428f9..1c210c5 100644 --- a/mermas.cs +++ b/mermas.cs @@ -1,10 +1,12 @@ -using compabetov2.database.modelos; +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.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; @@ -14,10 +16,111 @@ namespace compabetov2 public partial class mermas : Form { private LoginModel loginPrincipal; + private List mermasList; public mermas(LoginModel loginPrincipal) { InitializeComponent(); this.loginPrincipal = loginPrincipal; + llenarPanel(); + } + + public void llenarPanel() + { + mermaPanel.Controls.Clear(); + getData(); + foreach (Merma merma in mermasList) + { + TableLayoutPanel carta = new TableLayoutPanel(); + carta.RowCount = 1; + carta.ColumnCount = 2; + carta.Height = 100; + carta.Width = 770; + carta.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); + carta.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); + carta.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); + carta.BorderStyle = BorderStyle.FixedSingle; + + + Label fecha = new Label(); + fecha.Text = merma.fecha; + fecha.Dock = DockStyle.Fill; + fecha.TextAlign = ContentAlignment.MiddleLeft; + fecha.Font = new Font(fecha.Font.FontFamily, 16, FontStyle.Bold); + + TableLayoutPanel panelBotones = new TableLayoutPanel(); + panelBotones.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F)); + panelBotones.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F)); + panelBotones.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F)); + panelBotones.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); + panelBotones.Dock = DockStyle.Fill; + + Button btnVer = new Button(); + btnVer.Text = "Ver"; + btnVer.Dock = DockStyle.Fill; + btnVer.FlatStyle = FlatStyle.Flat; + btnVer.FlatAppearance.BorderSize = 0; + btnVer.BackColor = Color.FromArgb(33, 90, 255); + btnVer.Font = new Font(btnVer.Font.FontFamily, 16); + btnVer.ForeColor = Color.White; + btnVer.Click += new EventHandler(delegate (object sender, EventArgs e) + { + verMerma ver = new verMerma(merma); + ver.Owner = this; + ver.Show(); + }); + + Button btnEditar = new Button(); + btnEditar.Text = "Editar"; + btnEditar.Dock = DockStyle.Fill; + btnEditar.FlatStyle = FlatStyle.Flat; + btnEditar.FlatAppearance.BorderSize = 0; + btnEditar.BackColor = Color.FromArgb(33, 90, 255); + btnEditar.Font = new Font(btnVer.Font.FontFamily, 16); + btnEditar.ForeColor = Color.White; + btnEditar.Click += new EventHandler(delegate (object sender, EventArgs e) + { + ActualizarMerma ver = new ActualizarMerma(merma,this); + ver.Owner = this; + ver.Show(); + }); + + + Button btnEliminar = new Button(); + btnEliminar.Text = "Eliminar"; + btnEliminar.Dock = DockStyle.Fill; + btnEliminar.BackColor = Color.Red; + btnEliminar.FlatStyle = FlatStyle.Flat; + btnEliminar.FlatAppearance.BorderSize = 0; + btnEliminar.Font = new Font(btnVer.Font.FontFamily, 16); + btnEliminar.ForeColor = Color.White; + btnEliminar.Click += new EventHandler(delegate (object sender, EventArgs e) + { + DialogResult result = MessageBox.Show("¿Está seguro de que desea eliminar este registro?", + "Confirmación", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (result == DialogResult.Yes) + { + if (service.eliminarMerma(merma)) + { + llenarPanel(); + } + } + }); + + + panelBotones.Controls.Add(btnVer,0,0); + panelBotones.Controls.Add(btnEditar,1,0); + panelBotones.Controls.Add(btnEliminar,2,0); + + carta.Controls.Add(fecha,0,0); + carta.Controls.Add(panelBotones,1,0); + + mermaPanel.Controls.Add(carta); + } + } + + private void getData() + { + mermasList = service.conseguirMerma(); } private void mermas_Load(object sender, EventArgs e) @@ -44,8 +147,20 @@ namespace compabetov2 private void button1_Click(object sender, EventArgs e) { MenuPrincipal menuPrincipal = new MenuPrincipal(loginPrincipal); - menuPrincipal.Show(); + menuPrincipal.ShowDialog(); this.Dispose(true); } + + private void mermaPanel_Paint(object sender, PaintEventArgs e) + { + + } + + private void btnAgregar_Click(object sender, EventArgs e) + { + agregarmermas agregarmermas = new agregarmermas(this); + agregarmermas.Owner = this; + agregarmermas.Show(); + } } } diff --git a/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 10a1a65..7a5c292 100644 Binary files a/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/obj/Debug/compabetov2.csproj.AssemblyReference.cache b/obj/Debug/compabetov2.csproj.AssemblyReference.cache index 5093a0c..668157a 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.CoreCompileInputs.cache b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache index 8a75a03..43969d6 100644 --- a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache +++ b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -b60c4bccea7fa102c5702d841868eb254cf2d68402605cb55dccf5a699b75adb +695db7c462a1bf4a0ef5990fcb38d3c5e4635ed46c5dd09022ca189de9b89e5b diff --git a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt index 85143a7..5cbbf72 100644 --- a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt +++ b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt @@ -100,3 +100,10 @@ C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.EditarEmpleado.resour C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.Confirmacion.resources >>>>>>> c224b1f121cf870873d6bc2414ec92b69d8a3668 C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.ModificarContra.resources +C:\Users\carsu\Source\Repos\compabetoOG\obj\Debug\compabetov2.agregarmermas.resources +C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.verMerma.resources +C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.ActualizarMerma.resources +C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.ActualizarMerma.resources +C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.agregarmermas.resources +C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.ModificarContra.resources +C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.verMerma.resources diff --git a/obj/Debug/compabetov2.csproj.GenerateResource.cache b/obj/Debug/compabetov2.csproj.GenerateResource.cache index 74b9fdb..0e58fab 100644 Binary files a/obj/Debug/compabetov2.csproj.GenerateResource.cache and b/obj/Debug/compabetov2.csproj.GenerateResource.cache differ diff --git a/obj/Debug/compabetov2.exe b/obj/Debug/compabetov2.exe index 9ecc006..f740321 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 da6e687..e2bd9ec 100644 Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ diff --git a/personal.cs b/personal.cs index 46855a7..8cb068c 100644 --- a/personal.cs +++ b/personal.cs @@ -227,7 +227,7 @@ namespace compabetov2 private void button1_Click(object sender, EventArgs e) { MenuPrincipal menuPrincipal = new MenuPrincipal(loginPrincipal); - menuPrincipal.Show(); + menuPrincipal.ShowDialog(); this.Dispose(true); } } diff --git a/vender.Designer.cs b/vender.Designer.cs index 3114b55..5d07be8 100644 --- a/vender.Designer.cs +++ b/vender.Designer.cs @@ -51,6 +51,7 @@ this.textBox2 = new System.Windows.Forms.TextBox(); this.bntImprimir = new System.Windows.Forms.Button(); this.button6 = new System.Windows.Forms.Button(); + this.btnVender = new System.Windows.Forms.Button(); this.flowLayoutPanel2.SuspendLayout(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).BeginInit(); @@ -69,9 +70,10 @@ this.lblfecha.AutoSize = true; 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(493, 105); + this.lblfecha.Location = new System.Drawing.Point(370, 85); + this.lblfecha.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.lblfecha.Name = "lblfecha"; - this.lblfecha.Size = new System.Drawing.Size(159, 58); + this.lblfecha.Size = new System.Drawing.Size(126, 46); this.lblfecha.TabIndex = 13; this.lblfecha.Text = "label2"; this.lblfecha.TextAlign = System.Drawing.ContentAlignment.TopCenter; @@ -82,9 +84,10 @@ this.lblhora.AutoSize = true; 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(681, -14); + this.lblhora.Location = new System.Drawing.Point(511, -11); + this.lblhora.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.lblhora.Name = "lblhora"; - this.lblhora.Size = new System.Drawing.Size(318, 113); + this.lblhora.Size = new System.Drawing.Size(249, 91); this.lblhora.TabIndex = 12; this.lblhora.Text = "label1"; this.lblhora.Click += new System.EventHandler(this.lblhora_Click); @@ -95,10 +98,10 @@ this.flowLayoutPanel2.Controls.Add(this.panel1); this.flowLayoutPanel2.Controls.Add(this.label1); this.flowLayoutPanel2.Controls.Add(this.labeltotal); - this.flowLayoutPanel2.Location = new System.Drawing.Point(1605, -1); - this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.flowLayoutPanel2.Location = new System.Drawing.Point(1204, -1); + this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; - this.flowLayoutPanel2.Size = new System.Drawing.Size(324, 1191); + this.flowLayoutPanel2.Size = new System.Drawing.Size(243, 968); this.flowLayoutPanel2.TabIndex = 11; this.flowLayoutPanel2.Paint += new System.Windows.Forms.PaintEventHandler(this.flowLayoutPanel2_Paint); // @@ -106,17 +109,17 @@ // this.panel1.BackColor = System.Drawing.Color.Transparent; this.panel1.Controls.Add(this.pictureBox9); - this.panel1.Location = new System.Drawing.Point(3, 2); - this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel1.Location = new System.Drawing.Point(2, 2); + this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(312, 263); + this.panel1.Size = new System.Drawing.Size(234, 214); this.panel1.TabIndex = 8; // // pictureBox9 // this.pictureBox9.Image = global::compabetov2.Properties.Resources.HomeroMenu; - this.pictureBox9.Location = new System.Drawing.Point(64, 34); - this.pictureBox9.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.pictureBox9.Location = new System.Drawing.Point(48, 28); + this.pictureBox9.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.pictureBox9.Name = "pictureBox9"; this.pictureBox9.Size = new System.Drawing.Size(190, 197); this.pictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; @@ -129,9 +132,10 @@ this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F); this.label1.ForeColor = System.Drawing.Color.AliceBlue; - this.label1.Location = new System.Drawing.Point(3, 267); + this.label1.Location = new System.Drawing.Point(2, 218); + this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(102, 39); + this.label1.Size = new System.Drawing.Size(83, 31); this.label1.TabIndex = 17; this.label1.Text = "Total:"; this.label1.Click += new System.EventHandler(this.label1_Click); @@ -142,9 +146,10 @@ this.labeltotal.BackColor = System.Drawing.Color.Transparent; this.labeltotal.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F); this.labeltotal.ForeColor = System.Drawing.Color.AliceBlue; - this.labeltotal.Location = new System.Drawing.Point(111, 267); + this.labeltotal.Location = new System.Drawing.Point(89, 218); + this.labeltotal.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.labeltotal.Name = "labeltotal"; - this.labeltotal.Size = new System.Drawing.Size(0, 39); + this.labeltotal.Size = new System.Drawing.Size(0, 31); this.labeltotal.TabIndex = 18; // // flowLayoutPanel1 @@ -157,26 +162,26 @@ this.flowLayoutPanel1.Controls.Add(this.button4); this.flowLayoutPanel1.Controls.Add(this.button5); this.flowLayoutPanel1.Location = new System.Drawing.Point(-1, 0); - this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(324, 1199); + this.flowLayoutPanel1.Size = new System.Drawing.Size(243, 974); 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, 2); - this.panel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + 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, 34); - this.pictureBox7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + 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; @@ -192,11 +197,11 @@ 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, 269); - this.button1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + 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(51, 0, 0, 0); - this.button1.Size = new System.Drawing.Size(312, 114); + 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; @@ -211,11 +216,11 @@ 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, 387); - this.button2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + 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(51, 0, 0, 0); - this.button2.Size = new System.Drawing.Size(312, 114); + 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; @@ -230,11 +235,11 @@ 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, 505); - this.button3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + 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(51, 0, 0, 0); - this.button3.Size = new System.Drawing.Size(312, 114); + 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; @@ -248,11 +253,11 @@ 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, 623); - this.button4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + 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(51, 0, 0, 0); - this.button4.Size = new System.Drawing.Size(312, 114); + 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; @@ -266,47 +271,48 @@ 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, 741); - this.button5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + 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(51, 0, 0, 0); - this.button5.Size = new System.Drawing.Size(312, 114); + 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; // // flowLayoutPanel3 // - this.flowLayoutPanel3.Location = new System.Drawing.Point(325, 283); - this.flowLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.flowLayoutPanel3.Location = new System.Drawing.Point(244, 230); + this.flowLayoutPanel3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.flowLayoutPanel3.Name = "flowLayoutPanel3"; - this.flowLayoutPanel3.Size = new System.Drawing.Size(1273, 946); + this.flowLayoutPanel3.Size = new System.Drawing.Size(955, 769); this.flowLayoutPanel3.TabIndex = 14; this.flowLayoutPanel3.Paint += new System.Windows.Forms.PaintEventHandler(this.flowLayoutPanel3_Paint); // // textBox1 // this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F); - this.textBox1.Location = new System.Drawing.Point(365, 229); - this.textBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.textBox1.Location = new System.Drawing.Point(274, 186); + this.textBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(399, 36); + this.textBox1.Size = new System.Drawing.Size(300, 30); this.textBox1.TabIndex = 15; // // textBox2 // this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F); - this.textBox2.Location = new System.Drawing.Point(792, 229); - this.textBox2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.textBox2.Location = new System.Drawing.Point(594, 186); + this.textBox2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(399, 36); + this.textBox2.Size = new System.Drawing.Size(300, 30); this.textBox2.TabIndex = 16; // // bntImprimir // - this.bntImprimir.Location = new System.Drawing.Point(1347, 76); + this.bntImprimir.Location = new System.Drawing.Point(1010, 62); + this.bntImprimir.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.bntImprimir.Name = "bntImprimir"; - this.bntImprimir.Size = new System.Drawing.Size(75, 23); + this.bntImprimir.Size = new System.Drawing.Size(56, 19); this.bntImprimir.TabIndex = 17; this.bntImprimir.Text = "button6"; this.bntImprimir.UseVisualStyleBackColor = true; @@ -314,19 +320,31 @@ // // button6 // - this.button6.Location = new System.Drawing.Point(1347, 140); + this.button6.Location = new System.Drawing.Point(1010, 114); + this.button6.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.button6.Name = "button6"; - this.button6.Size = new System.Drawing.Size(75, 23); + this.button6.Size = new System.Drawing.Size(56, 19); this.button6.TabIndex = 18; this.button6.Text = "arre"; this.button6.UseVisualStyleBackColor = true; // + // btnVender + // + this.btnVender.Location = new System.Drawing.Point(846, 100); + this.btnVender.Name = "btnVender"; + this.btnVender.Size = new System.Drawing.Size(75, 23); + this.btnVender.TabIndex = 19; + this.btnVender.Text = "Vender"; + this.btnVender.UseVisualStyleBackColor = true; + this.btnVender.Click += new System.EventHandler(this.button7_Click); + // // vender // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScroll = true; - this.ClientSize = new System.Drawing.Size(1827, 968); + this.ClientSize = new System.Drawing.Size(1337, 609); + this.Controls.Add(this.btnVender); this.Controls.Add(this.button6); this.Controls.Add(this.bntImprimir); this.Controls.Add(this.textBox2); @@ -336,7 +354,7 @@ this.Controls.Add(this.lblhora); this.Controls.Add(this.flowLayoutPanel2); this.Controls.Add(this.flowLayoutPanel1); - this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.Name = "vender"; this.Text = "vender"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; @@ -379,5 +397,6 @@ private System.Windows.Forms.Label labeltotal; private System.Windows.Forms.Button bntImprimir; private System.Windows.Forms.Button button6; + private System.Windows.Forms.Button btnVender; } } \ No newline at end of file diff --git a/vender.cs b/vender.cs index b6bf9ef..02cf259 100644 --- a/vender.cs +++ b/vender.cs @@ -22,8 +22,6 @@ namespace compabetov2 { - - private int cantidad = 0; private bool masBtnPresionado = false; private bool menosBtnPresionado = false; private List productos; @@ -64,13 +62,6 @@ namespace compabetov2 pic.BackgroundImageLayout = ImageLayout.Stretch; pic.Tag = producto.idProducto; - - - - - - - Label id = new Label(); id.Text = producto.idProducto.ToString(); id.BackColor = Color.FromArgb(82, 82, 82); @@ -161,23 +152,8 @@ namespace compabetov2 // Obtener información del Label id y precio int idProducto = int.Parse(id.Text); decimal precioProducto = producto.precion; - if (decimal.TryParse(precio.Text, NumberStyles.Currency, CultureInfo.CurrentCulture, out precioProducto)) - { - // Generar ticket y agregarlo al flowLayoutPanel2 - //GenerarTicket(idProducto, producto.nombre, precioProducto, int.Parse(contador.Text), total); - } - else - { - // Manejar el caso en el que la conversión no sea exitosa - //MessageBox.Show("Formato de precio no válido.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - // Generar ticket y agregarlo al flowLayoutPanel2 GenerarTicket(idProducto, producto.nombre, producto.precion, int.Parse(contador.Text), total, rutaImg); - - MessageBox.Show(crearContenidoImprimir()); - - }); HUD.Controls.Add(btnMenos); @@ -293,6 +269,15 @@ namespace compabetov2 pic.Image = Image.FromFile(rutaImg);//hay error aquí pic.BackgroundImageLayout = ImageLayout.Stretch; + Label id = new Label(); + id.Text = idProducto.ToString(); + id.BackColor = Color.FromArgb(82, 82, 82); + id.ForeColor = Color.White; + id.Width = 20; + id.Font = new Font(id.Font, FontStyle.Bold); + id.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + pic.Controls.Add(id); + TableLayoutPanel infoTicket = new TableLayoutPanel(); infoTicket.ColumnCount = 1; infoTicket.RowCount = 4; @@ -378,7 +363,7 @@ namespace compabetov2 private void button1_Click(object sender, EventArgs e) { MenuPrincipal menuPrincipal = new MenuPrincipal(loginPrincipal); - menuPrincipal.Show(); + menuPrincipal.ShowDialog(); this.Dispose(true); } @@ -491,6 +476,62 @@ namespace compabetov2 return resultado; } + private void button7_Click(object sender, EventArgs e) + { + List detalleVentas = listaProductosVenta(); + if(detalleVentas.Count > 0) + { + VentaModel ventaModel = new VentaModel(total); + if(service.crearVentaDAO(ventaModel, detalleVentas)) + { + MessageBox.Show("Venta hecha"); + } + } + else + { + MessageBox.Show("No hay ningun producto agregado"); + } + } + + private List listaProductosVenta() + { + List detalleVentas = new List(); + int contador_saltar_2_vueltas = 1; + foreach (var item in flowLayoutPanel2.Controls) + { + if (contador_saltar_2_vueltas <= 3) + { + contador_saltar_2_vueltas++; + continue; + } + TableLayoutPanel panelProducto = item as TableLayoutPanel; + TableLayoutPanel panelInfo = panelProducto.Controls[1] as TableLayoutPanel; + PictureBox pic = panelProducto.Controls[0] as PictureBox; + Label idLabel = null; + foreach (Control control in pic.Controls) + { + if (control is Label) + { + idLabel = (Label)control; + break; + } + } + int idProducto = int.Parse(idLabel.Text); + Producto producto = new Producto(idProducto); + + Label Lbcantidad = panelInfo.Controls[2] as Label; + string textcantidad = Lbcantidad.Text; + string[] cantidadCadenas = textcantidad.Split(' '); + int cantidad = int.Parse(cantidadCadenas[1]); + + DetalleVentaModel detalleVenta = new DetalleVentaModel(cantidad, producto); + + + detalleVentas.Add(detalleVenta); + } + + return detalleVentas; + } } } diff --git a/verMerma.Designer.cs b/verMerma.Designer.cs new file mode 100644 index 0000000..c4d2206 --- /dev/null +++ b/verMerma.Designer.cs @@ -0,0 +1,126 @@ +namespace compabetov2 +{ + partial class verMerma + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.txtResponsable = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.dtFecha = new System.Windows.Forms.DateTimePicker(); + this.txtDescripcion = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // txtResponsable + // + this.txtResponsable.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtResponsable.Location = new System.Drawing.Point(241, 10); + this.txtResponsable.Name = "txtResponsable"; + this.txtResponsable.Size = new System.Drawing.Size(348, 29); + this.txtResponsable.TabIndex = 11; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.Location = new System.Drawing.Point(110, 10); + this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(126, 24); + this.label3.TabIndex = 10; + this.label3.Text = "Responsable:"; + // + // dtFecha + // + this.dtFecha.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.dtFecha.Location = new System.Drawing.Point(241, 85); + this.dtFecha.Name = "dtFecha"; + this.dtFecha.Size = new System.Drawing.Size(348, 29); + this.dtFecha.TabIndex = 9; + // + // txtDescripcion + // + this.txtDescripcion.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtDescripcion.Location = new System.Drawing.Point(11, 119); + this.txtDescripcion.Margin = new System.Windows.Forms.Padding(2); + this.txtDescripcion.Multiline = true; + this.txtDescripcion.Name = "txtDescripcion"; + this.txtDescripcion.Size = new System.Drawing.Size(578, 195); + this.txtDescripcion.TabIndex = 8; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(11, 85); + this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(115, 24); + this.label2.TabIndex = 7; + this.label2.Text = "Descripcion:"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(167, 89); + this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(69, 24); + this.label1.TabIndex = 6; + this.label1.Text = "Fecha:"; + // + // verMerma + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(615, 325); + this.Controls.Add(this.txtResponsable); + this.Controls.Add(this.label3); + this.Controls.Add(this.dtFecha); + this.Controls.Add(this.txtDescripcion); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Name = "verMerma"; + this.Text = "Merma"; + this.Load += new System.EventHandler(this.verMerma_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox txtResponsable; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.DateTimePicker dtFecha; + private System.Windows.Forms.TextBox txtDescripcion; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + } +} \ No newline at end of file diff --git a/verMerma.cs b/verMerma.cs new file mode 100644 index 0000000..5db024f --- /dev/null +++ b/verMerma.cs @@ -0,0 +1,36 @@ +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 verMerma : Form + { + private Merma merma; + public verMerma(Merma merma) + { + InitializeComponent(); + this.merma = merma; + llenarComponentes(); + } + + private void llenarComponentes() + { + txtDescripcion.Text = merma.razon; + txtResponsable.Text = merma.responsable; + dtFecha.Text = merma.fecha; + } + + private void verMerma_Load(object sender, EventArgs e) + { + + } + } +} diff --git a/verMerma.resx b/verMerma.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/verMerma.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file