From 152bba07891d663da7a52f4c1ddbb0d245ae0e8f Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Wed, 1 Mar 2017 01:29:05 -0300 Subject: [PATCH 01/27] Cargar DataGridView --- SireCu/Clases/Egreso.vb | 60 +++++++++++++++++++++++++++ SireCu/Egresos/ABMEgresos.Designer.vb | 42 +++++++++++++++++++ SireCu/Egresos/ABMEgresos.vb | 4 +- 3 files changed, 105 insertions(+), 1 deletion(-) diff --git a/SireCu/Clases/Egreso.vb b/SireCu/Clases/Egreso.vb index 35b9bbd..2562c4b 100644 --- a/SireCu/Clases/Egreso.vb +++ b/SireCu/Clases/Egreso.vb @@ -18,4 +18,64 @@ Module Egreso End Function + Public Sub CargardDGV(ByRef dgv As DataGridView) + Dim cmd = New SqlCeCommand + Dim con = New SqlCeConnection(My.Settings.CadenaConexion) + If con.State = ConnectionState.Closed Then + con.Open() + End If + + cmd.CommandText = "SELECT E.id AS id, + E.nro_comprobante AS nro_comprobante, + E.tipo_comprobante_id AS tipo_comprobante_id, + Comp.nombre AS tipo_comprobante_nombre, + E.proveedor_id AS proveedor_id, + Pro.nombre AS proveedor_nombre, + E.categoria_gasto_id AS categoria_gasto_id, + Gastos.nombre AS categoria_nombre, + E.persona_id AS persona_id, + Per.nombre AS persona_nombre, + E.fecha AS fecha, + E.seccional_id AS seccional_id, + Secc.nombre AS seccional_nombre, + E.mes_reintegro AS mes_reintegro, + E.monto AS monto, + E.comentario AS comentario + FROM Egresos AS E + LEFT JOIN TiposComprobantes AS Comp ON E.tipo_comprobante_id = Comp.id + LEFT JOIN Proveedores AS Pro ON E.proveedor_id = Pro.id + LEFT JOIN CategoriasGastos AS Gastos ON E.categoria_gasto_id = Gastos.id + LEFT JOIN Personas AS Per ON E.persona_id = Per.id + LEFT JOIN Seccionales AS Secc ON E.seccional_id = Secc.id" + cmd.Connection = con + Dim tableadapter = New SqlCeDataAdapter(cmd) + Dim dataset = New DataSet + + tableadapter.Fill(dataset, "Egresos_Modificar") + Dim mybinding = New BindingSource(dataset, "Egresos_Modificar") + + + dgv.DataSource = mybinding + + dgv.Columns.Item("id").HeaderText = "Id" + dgv.Columns.Item("nro_comprobante").HeaderText = "Nro Comprobante" + dgv.Columns.Item("tipo_comprobante_nombre").HeaderText = "Tipo Comprobante" + dgv.Columns.Item("proveedor_nombre").HeaderText = "Proveedor" + dgv.Columns.Item("categoria_nombre").HeaderText = "Categoria Gasto" + dgv.Columns.Item("persona_nombre").HeaderText = "Persona" + dgv.Columns.Item("fecha").HeaderText = "Fecha" + dgv.Columns.Item("seccional_nombre").HeaderText = "Seccional" + dgv.Columns.Item("mes_reintegro").HeaderText = "Mes Reintegro" + dgv.Columns.Item("monto").HeaderText = "Monto" + dgv.Columns.Item("comentario").HeaderText = "Comentario" + + dgv.Columns.Item("tipo_comprobante_id").Visible = False + dgv.Columns.Item("proveedor_id").Visible = False + dgv.Columns.Item("categoria_gasto_id").Visible = False + dgv.Columns.Item("persona_id").Visible = False + dgv.Columns.Item("seccional_id").Visible = False + + + End Sub + End Module diff --git a/SireCu/Egresos/ABMEgresos.Designer.vb b/SireCu/Egresos/ABMEgresos.Designer.vb index 802eaf6..2e5f0f5 100644 --- a/SireCu/Egresos/ABMEgresos.Designer.vb +++ b/SireCu/Egresos/ABMEgresos.Designer.vb @@ -55,11 +55,17 @@ Partial Class ABMEgresos Me.tbComentario = New System.Windows.Forms.TextBox() Me.tbProveedor = New System.Windows.Forms.TextBox() Me.SplitContainerModificar = New System.Windows.Forms.SplitContainer() + Me.ToolStripContainerModificar = New System.Windows.Forms.ToolStripContainer() + Me.DataGridViewModificar = New System.Windows.Forms.DataGridView() Me.TabControl.SuspendLayout() Me.TabPageAgregar.SuspendLayout() Me.TabPageModificar.SuspendLayout() CType(Me.SplitContainerModificar, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerModificar.Panel1.SuspendLayout() Me.SplitContainerModificar.SuspendLayout() + Me.ToolStripContainerModificar.ContentPanel.SuspendLayout() + Me.ToolStripContainerModificar.SuspendLayout() + CType(Me.DataGridViewModificar, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'TabControl @@ -399,10 +405,39 @@ Partial Class ABMEgresos Me.SplitContainerModificar.Location = New System.Drawing.Point(3, 3) Me.SplitContainerModificar.Name = "SplitContainerModificar" Me.SplitContainerModificar.Orientation = System.Windows.Forms.Orientation.Horizontal + ' + 'SplitContainerModificar.Panel1 + ' + Me.SplitContainerModificar.Panel1.Controls.Add(Me.ToolStripContainerModificar) Me.SplitContainerModificar.Size = New System.Drawing.Size(741, 421) Me.SplitContainerModificar.SplitterDistance = 201 Me.SplitContainerModificar.TabIndex = 0 ' + 'ToolStripContainerModificar + ' + ' + 'ToolStripContainerModificar.ContentPanel + ' + Me.ToolStripContainerModificar.ContentPanel.Controls.Add(Me.DataGridViewModificar) + Me.ToolStripContainerModificar.ContentPanel.Size = New System.Drawing.Size(741, 176) + Me.ToolStripContainerModificar.Dock = System.Windows.Forms.DockStyle.Fill + Me.ToolStripContainerModificar.Location = New System.Drawing.Point(0, 0) + Me.ToolStripContainerModificar.Name = "ToolStripContainerModificar" + Me.ToolStripContainerModificar.Size = New System.Drawing.Size(741, 201) + Me.ToolStripContainerModificar.TabIndex = 0 + Me.ToolStripContainerModificar.Text = "ToolStripContainer1" + ' + 'DataGridViewModificar + ' + Me.DataGridViewModificar.AllowUserToDeleteRows = False + Me.DataGridViewModificar.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridViewModificar.Dock = System.Windows.Forms.DockStyle.Fill + Me.DataGridViewModificar.Location = New System.Drawing.Point(0, 0) + Me.DataGridViewModificar.Name = "DataGridViewModificar" + Me.DataGridViewModificar.ReadOnly = True + Me.DataGridViewModificar.Size = New System.Drawing.Size(741, 176) + Me.DataGridViewModificar.TabIndex = 0 + ' 'ABMEgresos ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -415,8 +450,13 @@ Partial Class ABMEgresos Me.TabPageAgregar.ResumeLayout(False) Me.TabPageAgregar.PerformLayout() Me.TabPageModificar.ResumeLayout(False) + Me.SplitContainerModificar.Panel1.ResumeLayout(False) CType(Me.SplitContainerModificar, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerModificar.ResumeLayout(False) + Me.ToolStripContainerModificar.ContentPanel.ResumeLayout(False) + Me.ToolStripContainerModificar.ResumeLayout(False) + Me.ToolStripContainerModificar.PerformLayout() + CType(Me.DataGridViewModificar, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub @@ -454,4 +494,6 @@ Partial Class ABMEgresos Friend WithEvents tbProveedor As TextBox Friend WithEvents TabPageModificar As TabPage Friend WithEvents SplitContainerModificar As SplitContainer + Friend WithEvents ToolStripContainerModificar As ToolStripContainer + Friend WithEvents DataGridViewModificar As DataGridView End Class diff --git a/SireCu/Egresos/ABMEgresos.vb b/SireCu/Egresos/ABMEgresos.vb index 620bd0e..fe28738 100644 --- a/SireCu/Egresos/ABMEgresos.vb +++ b/SireCu/Egresos/ABMEgresos.vb @@ -5,8 +5,10 @@ Public Class ABMEgresos #Region "Eventos" Private Sub ABMEgresos_Load(sender As Object, e As EventArgs) Handles MyBase.Load - + Egreso.CargardDGV(DataGridViewModificar) End Sub + + #End Region #Region "Helpers" From 81d4af391d2bccb1b22347f035a6578a4ab81a4e Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Tue, 7 Mar 2017 21:40:06 -0300 Subject: [PATCH 02/27] Cargar Formulario para modificar egresos (Dataset con valores duplicados) --- SireCu/Clases/Egreso.vb | 54 ++-- SireCu/Egresos/ABMEgresos.Designer.vb | 426 ++++++++++++++++++++++++++ SireCu/Egresos/ABMEgresos.resx | 96 ++++++ SireCu/Egresos/ABMEgresos.vb | 86 +++++- 4 files changed, 621 insertions(+), 41 deletions(-) diff --git a/SireCu/Clases/Egreso.vb b/SireCu/Clases/Egreso.vb index b6dea7c..283fddc 100644 --- a/SireCu/Clases/Egreso.vb +++ b/SireCu/Clases/Egreso.vb @@ -9,6 +9,7 @@ Module Egreso "fecha, tipo_comprobante_id, seccional_id, mes_reintegro, monto, comentario)" & "VALUES (@nro_comprobante, @proveedor, @cat_gasto, @persona, @fecha, @t_comprobante, " & "@seccional, @reintegro, @monto, @comentario)" + Principal.command.Parameters.Clear() Principal.command.Parameters.AddWithValue("@nro_comprobante", compro) Principal.command.Parameters.AddWithValue("@proveedor", proveedor) Principal.command.Parameters.AddWithValue("@cat_gasto", categoria) @@ -36,13 +37,12 @@ Module Egreso End Function Public Sub CargardDGV(ByRef dgv As DataGridView) - Dim cmd = New SqlCeCommand Dim con = New SqlCeConnection(My.Settings.CadenaConexion) If con.State = ConnectionState.Closed Then con.Open() End If - cmd.CommandText = "SELECT E.id AS id, + Principal.command.CommandText = "SELECT E.id AS id, E.nro_comprobante AS nro_comprobante, E.tipo_comprobante_id AS tipo_comprobante_id, Comp.nombre AS tipo_comprobante_nombre, @@ -64,33 +64,33 @@ Module Egreso LEFT JOIN CategoriasGastos AS Gastos ON E.categoria_gasto_id = Gastos.id LEFT JOIN Personas AS Per ON E.persona_id = Per.id LEFT JOIN Seccionales AS Secc ON E.seccional_id = Secc.id" - cmd.Connection = con - Dim tableadapter = New SqlCeDataAdapter(cmd) - Dim dataset = New DataSet - - tableadapter.Fill(dataset, "Egresos_Modificar") - Dim mybinding = New BindingSource(dataset, "Egresos_Modificar") - - + Principal.command.Connection = con + Dim tableadapter = New SqlCeDataAdapter(Principal.command) + + tableadapter.Fill(Principal.dataset, "Egresos_Modificar") + Dim mybinding = New BindingSource(Principal.dataset, "Egresos_Modificar") + + dgv.AutoGenerateColumns = False + + dgv.Columns.Item("id").DataPropertyName = "id" + dgv.Columns.Item("nro_comprobante").DataPropertyName = "nro_comprobante" + dgv.Columns.Item("tipo_comprobante_id").DataPropertyName = "tipo_comprobante_id" + dgv.Columns.Item("tipo_comprobante_nombre").DataPropertyName = "tipo_comprobante_nombre" + dgv.Columns.Item("proveedor_id").DataPropertyName = "proveedor_id" + dgv.Columns.Item("proveedor_nombre").DataPropertyName = "proveedor_nombre" + dgv.Columns.Item("categoria_gasto_id").DataPropertyName = "categoria_gasto_id" + dgv.Columns.Item("categoria_nombre").DataPropertyName = "categoria_nombre" + dgv.Columns.Item("persona_id").DataPropertyName = "persona_id" + dgv.Columns.Item("persona_nombre").DataPropertyName = "persona_nombre" + dgv.Columns.Item("fecha").DataPropertyName = "fecha" + dgv.Columns.Item("seccional_id").DataPropertyName = "seccional_id" + dgv.Columns.Item("seccional_nombre").DataPropertyName = "seccional_nombre" + dgv.Columns.Item("mes_reintegro").DataPropertyName = "mes_reintegro" + dgv.Columns.Item("monto").DataPropertyName = "monto" + dgv.Columns.Item("comentario").DataPropertyName = "comentario" dgv.DataSource = mybinding - dgv.Columns.Item("id").HeaderText = "Id" - dgv.Columns.Item("nro_comprobante").HeaderText = "Nro Comprobante" - dgv.Columns.Item("tipo_comprobante_nombre").HeaderText = "Tipo Comprobante" - dgv.Columns.Item("proveedor_nombre").HeaderText = "Proveedor" - dgv.Columns.Item("categoria_nombre").HeaderText = "Categoria Gasto" - dgv.Columns.Item("persona_nombre").HeaderText = "Persona" - dgv.Columns.Item("fecha").HeaderText = "Fecha" - dgv.Columns.Item("seccional_nombre").HeaderText = "Seccional" - dgv.Columns.Item("mes_reintegro").HeaderText = "Mes Reintegro" - dgv.Columns.Item("monto").HeaderText = "Monto" - dgv.Columns.Item("comentario").HeaderText = "Comentario" - - dgv.Columns.Item("tipo_comprobante_id").Visible = False - dgv.Columns.Item("proveedor_id").Visible = False - dgv.Columns.Item("categoria_gasto_id").Visible = False - dgv.Columns.Item("persona_id").Visible = False - dgv.Columns.Item("seccional_id").Visible = False + End Sub diff --git a/SireCu/Egresos/ABMEgresos.Designer.vb b/SireCu/Egresos/ABMEgresos.Designer.vb index f14749b..3b6e591 100644 --- a/SireCu/Egresos/ABMEgresos.Designer.vb +++ b/SireCu/Egresos/ABMEgresos.Designer.vb @@ -57,11 +57,51 @@ Partial Class ABMEgresos Me.SplitContainerModificar = New System.Windows.Forms.SplitContainer() Me.ToolStripContainerModificar = New System.Windows.Forms.ToolStripContainer() Me.DataGridViewModificar = New System.Windows.Forms.DataGridView() + Me.id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.nro_comprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.tipo_comprobante_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.tipo_comprobante_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.proveedor_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.proveedor_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.categoria_gasto_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.categoria_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.persona_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.persona_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.fecha = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.seccional_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.seccional_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.mes_reintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.monto = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.comentario = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.TextBoxNroComprobante = New System.Windows.Forms.TextBox() + Me.ComboBoxTipoComprobante = New System.Windows.Forms.ComboBox() + Me.TextBoxPVenta = New System.Windows.Forms.TextBox() + Me.Label4 = New System.Windows.Forms.Label() + Me.Label5 = New System.Windows.Forms.Label() + Me.TextBoxMonto = New System.Windows.Forms.TextBox() + Me.ComboBoxCategGasto = New System.Windows.Forms.ComboBox() + Me.ButtonGuardar = New System.Windows.Forms.Button() + Me.Label6 = New System.Windows.Forms.Label() + Me.TextBoxNombre = New System.Windows.Forms.TextBox() + Me.Label7 = New System.Windows.Forms.Label() + Me.Label8 = New System.Windows.Forms.Label() + Me.Label9 = New System.Windows.Forms.Label() + Me.Label10 = New System.Windows.Forms.Label() + Me.Label11 = New System.Windows.Forms.Label() + Me.Label12 = New System.Windows.Forms.Label() + Me.TextBoxComentario = New System.Windows.Forms.TextBox() + Me.TextBoxProveedor = New System.Windows.Forms.TextBox() + Me.DateTimePickerFecha = New System.Windows.Forms.DateTimePicker() + Me.Label1 = New System.Windows.Forms.Label() + Me.DateTimePickerMesReintegro = New System.Windows.Forms.DateTimePicker() + Me.ComboBoxSeccional = New System.Windows.Forms.ComboBox() + Me.LabelSeccional = New System.Windows.Forms.Label() Me.TabControl.SuspendLayout() Me.TabPageAgregar.SuspendLayout() Me.TabPageModificar.SuspendLayout() CType(Me.SplitContainerModificar, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainerModificar.Panel1.SuspendLayout() + Me.SplitContainerModificar.Panel2.SuspendLayout() Me.SplitContainerModificar.SuspendLayout() Me.ToolStripContainerModificar.ContentPanel.SuspendLayout() Me.ToolStripContainerModificar.SuspendLayout() @@ -412,6 +452,32 @@ Partial Class ABMEgresos 'SplitContainerModificar.Panel1 ' Me.SplitContainerModificar.Panel1.Controls.Add(Me.ToolStripContainerModificar) + ' + 'SplitContainerModificar.Panel2 + ' + Me.SplitContainerModificar.Panel2.Controls.Add(Me.LabelSeccional) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxSeccional) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.DateTimePickerMesReintegro) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label1) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.DateTimePickerFecha) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxNroComprobante) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxTipoComprobante) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxPVenta) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label4) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label5) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxMonto) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxCategGasto) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ButtonGuardar) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label6) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxNombre) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label7) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label8) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label9) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label10) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label11) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label12) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxComentario) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxProveedor) Me.SplitContainerModificar.Size = New System.Drawing.Size(741, 421) Me.SplitContainerModificar.SplitterDistance = 201 Me.SplitContainerModificar.TabIndex = 0 @@ -432,15 +498,334 @@ Partial Class ABMEgresos ' 'DataGridViewModificar ' + Me.DataGridViewModificar.AllowUserToAddRows = False Me.DataGridViewModificar.AllowUserToDeleteRows = False Me.DataGridViewModificar.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridViewModificar.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.id, Me.nro_comprobante, Me.tipo_comprobante_id, Me.tipo_comprobante_nombre, Me.proveedor_id, Me.proveedor_nombre, Me.categoria_gasto_id, Me.categoria_nombre, Me.persona_id, Me.persona_nombre, Me.fecha, Me.seccional_id, Me.seccional_nombre, Me.mes_reintegro, Me.monto, Me.comentario}) Me.DataGridViewModificar.Dock = System.Windows.Forms.DockStyle.Fill Me.DataGridViewModificar.Location = New System.Drawing.Point(0, 0) Me.DataGridViewModificar.Name = "DataGridViewModificar" Me.DataGridViewModificar.ReadOnly = True + Me.DataGridViewModificar.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect Me.DataGridViewModificar.Size = New System.Drawing.Size(741, 176) Me.DataGridViewModificar.TabIndex = 0 ' + 'id + ' + Me.id.HeaderText = "Id" + Me.id.Name = "id" + Me.id.ReadOnly = True + ' + 'nro_comprobante + ' + Me.nro_comprobante.HeaderText = "Nro Comprobante" + Me.nro_comprobante.Name = "nro_comprobante" + Me.nro_comprobante.ReadOnly = True + ' + 'tipo_comprobante_id + ' + Me.tipo_comprobante_id.HeaderText = "tipo_comprobante_id" + Me.tipo_comprobante_id.Name = "tipo_comprobante_id" + Me.tipo_comprobante_id.ReadOnly = True + Me.tipo_comprobante_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.tipo_comprobante_id.Visible = False + ' + 'tipo_comprobante_nombre + ' + Me.tipo_comprobante_nombre.HeaderText = "Tipo Comprobante" + Me.tipo_comprobante_nombre.Name = "tipo_comprobante_nombre" + Me.tipo_comprobante_nombre.ReadOnly = True + ' + 'proveedor_id + ' + Me.proveedor_id.HeaderText = "proveedor_id" + Me.proveedor_id.Name = "proveedor_id" + Me.proveedor_id.ReadOnly = True + Me.proveedor_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.proveedor_id.Visible = False + ' + 'proveedor_nombre + ' + Me.proveedor_nombre.HeaderText = "Proveedor" + Me.proveedor_nombre.Name = "proveedor_nombre" + Me.proveedor_nombre.ReadOnly = True + ' + 'categoria_gasto_id + ' + Me.categoria_gasto_id.HeaderText = "categoria_gasto_id" + Me.categoria_gasto_id.Name = "categoria_gasto_id" + Me.categoria_gasto_id.ReadOnly = True + Me.categoria_gasto_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.categoria_gasto_id.Visible = False + ' + 'categoria_nombre + ' + Me.categoria_nombre.HeaderText = "Categoria Gasto" + Me.categoria_nombre.Name = "categoria_nombre" + Me.categoria_nombre.ReadOnly = True + ' + 'persona_id + ' + Me.persona_id.HeaderText = "persona_id" + Me.persona_id.Name = "persona_id" + Me.persona_id.ReadOnly = True + Me.persona_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.persona_id.Visible = False + ' + 'persona_nombre + ' + Me.persona_nombre.HeaderText = "Persona" + Me.persona_nombre.Name = "persona_nombre" + Me.persona_nombre.ReadOnly = True + ' + 'fecha + ' + Me.fecha.HeaderText = "Fecha" + Me.fecha.Name = "fecha" + Me.fecha.ReadOnly = True + ' + 'seccional_id + ' + Me.seccional_id.HeaderText = "seccional_id" + Me.seccional_id.Name = "seccional_id" + Me.seccional_id.ReadOnly = True + Me.seccional_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.seccional_id.Visible = False + ' + 'seccional_nombre + ' + Me.seccional_nombre.HeaderText = "Seccional" + Me.seccional_nombre.Name = "seccional_nombre" + Me.seccional_nombre.ReadOnly = True + ' + 'mes_reintegro + ' + Me.mes_reintegro.HeaderText = "Mes Reintegro" + Me.mes_reintegro.Name = "mes_reintegro" + Me.mes_reintegro.ReadOnly = True + ' + 'monto + ' + Me.monto.HeaderText = "Monto" + Me.monto.Name = "monto" + Me.monto.ReadOnly = True + ' + 'comentario + ' + Me.comentario.HeaderText = "Comentario" + Me.comentario.Name = "comentario" + Me.comentario.ReadOnly = True + ' + 'TextBoxNroComprobante + ' + Me.TextBoxNroComprobante.Location = New System.Drawing.Point(595, 71) + Me.TextBoxNroComprobante.Name = "TextBoxNroComprobante" + Me.TextBoxNroComprobante.Size = New System.Drawing.Size(97, 22) + Me.TextBoxNroComprobante.TabIndex = 99 + ' + 'ComboBoxTipoComprobante + ' + Me.ComboBoxTipoComprobante.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.ComboBoxTipoComprobante.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.ComboBoxTipoComprobante.FormattingEnabled = True + Me.ComboBoxTipoComprobante.Items.AddRange(New Object() {"Factura A", "Factura B", "Factura C", "Recibo A", "Recibo B", "Recibo C", "Recibo X", "Tique Fact. A", "Tique Fact. B", "Tique Fact. C", "Tique", "Pasaje", "Extracto Bancario", "Otro"}) + Me.ComboBoxTipoComprobante.Location = New System.Drawing.Point(529, 41) + Me.ComboBoxTipoComprobante.Name = "ComboBoxTipoComprobante" + Me.ComboBoxTipoComprobante.Size = New System.Drawing.Size(163, 24) + Me.ComboBoxTipoComprobante.TabIndex = 97 + ' + 'TextBoxPVenta + ' + Me.TextBoxPVenta.Location = New System.Drawing.Point(529, 71) + Me.TextBoxPVenta.Name = "TextBoxPVenta" + Me.TextBoxPVenta.Size = New System.Drawing.Size(56, 22) + Me.TextBoxPVenta.TabIndex = 98 + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(508, 102) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(15, 16) + Me.Label4.TabIndex = 114 + Me.Label4.Text = "$" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(383, 44) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(140, 16) + Me.Label5.TabIndex = 113 + Me.Label5.Text = "Tipo de Comprobante" + ' + 'TextBoxMonto + ' + Me.TextBoxMonto.Location = New System.Drawing.Point(529, 99) + Me.TextBoxMonto.Name = "TextBoxMonto" + Me.TextBoxMonto.Size = New System.Drawing.Size(163, 22) + Me.TextBoxMonto.TabIndex = 101 + Me.TextBoxMonto.Tag = "" + ' + 'ComboBoxCategGasto + ' + Me.ComboBoxCategGasto.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.ComboBoxCategGasto.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.ComboBoxCategGasto.FormattingEnabled = True + Me.ComboBoxCategGasto.Location = New System.Drawing.Point(145, 41) + Me.ComboBoxCategGasto.Name = "ComboBoxCategGasto" + Me.ComboBoxCategGasto.Size = New System.Drawing.Size(197, 24) + Me.ComboBoxCategGasto.TabIndex = 95 + ' + 'ButtonGuardar + ' + Me.ButtonGuardar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.ButtonGuardar.ForeColor = System.Drawing.Color.Green + Me.ButtonGuardar.Location = New System.Drawing.Point(529, 157) + Me.ButtonGuardar.Name = "ButtonGuardar" + Me.ButtonGuardar.Size = New System.Drawing.Size(163, 56) + Me.ButtonGuardar.TabIndex = 105 + Me.ButtonGuardar.Text = "Guardar" + Me.ButtonGuardar.UseVisualStyleBackColor = True + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(22, 44) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(63, 16) + Me.Label6.TabIndex = 112 + Me.Label6.Text = "Gasto de" + ' + 'TextBoxNombre + ' + Me.TextBoxNombre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TextBoxNombre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.TextBoxNombre.BackColor = System.Drawing.SystemColors.Window + Me.TextBoxNombre.Location = New System.Drawing.Point(145, 13) + Me.TextBoxNombre.Name = "TextBoxNombre" + Me.TextBoxNombre.Size = New System.Drawing.Size(197, 22) + Me.TextBoxNombre.TabIndex = 91 + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(22, 101) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(115, 16) + Me.Label7.TabIndex = 111 + Me.Label7.Text = "Mes de Reintegro" + ' + 'Label8 + ' + Me.Label8.AutoSize = True + Me.Label8.Location = New System.Drawing.Point(22, 161) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(77, 16) + Me.Label8.TabIndex = 110 + Me.Label8.Text = "Comentario" + ' + 'Label9 + ' + Me.Label9.AutoSize = True + Me.Label9.Location = New System.Drawing.Point(383, 102) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(45, 16) + Me.Label9.TabIndex = 109 + Me.Label9.Text = "Monto" + ' + 'Label10 + ' + Me.Label10.AutoSize = True + Me.Label10.Location = New System.Drawing.Point(22, 74) + Me.Label10.Name = "Label10" + Me.Label10.Size = New System.Drawing.Size(72, 16) + Me.Label10.TabIndex = 108 + Me.Label10.Text = "Proveedor" + ' + 'Label11 + ' + Me.Label11.AutoSize = True + Me.Label11.Location = New System.Drawing.Point(22, 16) + Me.Label11.Name = "Label11" + Me.Label11.Size = New System.Drawing.Size(120, 16) + Me.Label11.TabIndex = 107 + Me.Label11.Text = "Nombre y Apellido" + ' + 'Label12 + ' + Me.Label12.AutoSize = True + Me.Label12.Location = New System.Drawing.Point(383, 74) + Me.Label12.Name = "Label12" + Me.Label12.Size = New System.Drawing.Size(107, 16) + Me.Label12.TabIndex = 106 + Me.Label12.Text = "N° Comprobante" + ' + 'TextBoxComentario + ' + Me.TextBoxComentario.Location = New System.Drawing.Point(145, 157) + Me.TextBoxComentario.Multiline = True + Me.TextBoxComentario.Name = "TextBoxComentario" + Me.TextBoxComentario.Size = New System.Drawing.Size(378, 56) + Me.TextBoxComentario.TabIndex = 104 + ' + 'TextBoxProveedor + ' + Me.TextBoxProveedor.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TextBoxProveedor.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.TextBoxProveedor.Location = New System.Drawing.Point(145, 71) + Me.TextBoxProveedor.Name = "TextBoxProveedor" + Me.TextBoxProveedor.Size = New System.Drawing.Size(197, 22) + Me.TextBoxProveedor.TabIndex = 96 + ' + 'DateTimePickerFecha + ' + Me.DateTimePickerFecha.CustomFormat = "" + Me.DateTimePickerFecha.Format = System.Windows.Forms.DateTimePickerFormat.[Short] + Me.DateTimePickerFecha.Location = New System.Drawing.Point(529, 13) + Me.DateTimePickerFecha.Name = "DateTimePickerFecha" + Me.DateTimePickerFecha.Size = New System.Drawing.Size(163, 22) + Me.DateTimePickerFecha.TabIndex = 115 + Me.DateTimePickerFecha.Value = New Date(2017, 3, 4, 19, 31, 9, 0) + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(383, 16) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(49, 16) + Me.Label1.TabIndex = 116 + Me.Label1.Text = "Fecha:" + ' + 'DateTimePickerMesReintegro + ' + Me.DateTimePickerMesReintegro.CustomFormat = "" + Me.DateTimePickerMesReintegro.Format = System.Windows.Forms.DateTimePickerFormat.[Short] + Me.DateTimePickerMesReintegro.Location = New System.Drawing.Point(145, 99) + Me.DateTimePickerMesReintegro.Name = "DateTimePickerMesReintegro" + Me.DateTimePickerMesReintegro.Size = New System.Drawing.Size(197, 22) + Me.DateTimePickerMesReintegro.TabIndex = 117 + Me.DateTimePickerMesReintegro.Value = New Date(2017, 3, 4, 19, 31, 9, 0) + ' + 'ComboBoxSeccional + ' + Me.ComboBoxSeccional.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.ComboBoxSeccional.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.ComboBoxSeccional.FormattingEnabled = True + Me.ComboBoxSeccional.Location = New System.Drawing.Point(145, 127) + Me.ComboBoxSeccional.Name = "ComboBoxSeccional" + Me.ComboBoxSeccional.Size = New System.Drawing.Size(197, 24) + Me.ComboBoxSeccional.TabIndex = 118 + ' + 'LabelSeccional + ' + Me.LabelSeccional.AutoSize = True + Me.LabelSeccional.Location = New System.Drawing.Point(22, 130) + Me.LabelSeccional.Name = "LabelSeccional" + Me.LabelSeccional.Size = New System.Drawing.Size(68, 16) + Me.LabelSeccional.TabIndex = 119 + Me.LabelSeccional.Text = "Seccional" + ' 'ABMEgresos ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -454,6 +839,8 @@ Partial Class ABMEgresos Me.TabPageAgregar.PerformLayout() Me.TabPageModificar.ResumeLayout(False) Me.SplitContainerModificar.Panel1.ResumeLayout(False) + Me.SplitContainerModificar.Panel2.ResumeLayout(False) + Me.SplitContainerModificar.Panel2.PerformLayout() CType(Me.SplitContainerModificar, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerModificar.ResumeLayout(False) Me.ToolStripContainerModificar.ContentPanel.ResumeLayout(False) @@ -499,4 +886,43 @@ Partial Class ABMEgresos Friend WithEvents SplitContainerModificar As SplitContainer Friend WithEvents ToolStripContainerModificar As ToolStripContainer Friend WithEvents DataGridViewModificar As DataGridView + Friend WithEvents id As DataGridViewTextBoxColumn + Friend WithEvents nro_comprobante As DataGridViewTextBoxColumn + Friend WithEvents tipo_comprobante_id As DataGridViewTextBoxColumn + Friend WithEvents tipo_comprobante_nombre As DataGridViewTextBoxColumn + Friend WithEvents proveedor_id As DataGridViewTextBoxColumn + Friend WithEvents proveedor_nombre As DataGridViewTextBoxColumn + Friend WithEvents categoria_gasto_id As DataGridViewTextBoxColumn + Friend WithEvents categoria_nombre As DataGridViewTextBoxColumn + Friend WithEvents persona_id As DataGridViewTextBoxColumn + Friend WithEvents persona_nombre As DataGridViewTextBoxColumn + Friend WithEvents fecha As DataGridViewTextBoxColumn + Friend WithEvents seccional_id As DataGridViewTextBoxColumn + Friend WithEvents seccional_nombre As DataGridViewTextBoxColumn + Friend WithEvents mes_reintegro As DataGridViewTextBoxColumn + Friend WithEvents monto As DataGridViewTextBoxColumn + Friend WithEvents comentario As DataGridViewTextBoxColumn + Friend WithEvents TextBoxNroComprobante As TextBox + Friend WithEvents ComboBoxTipoComprobante As ComboBox + Friend WithEvents TextBoxPVenta As TextBox + Friend WithEvents Label4 As Label + Friend WithEvents Label5 As Label + Friend WithEvents TextBoxMonto As TextBox + Friend WithEvents ComboBoxCategGasto As ComboBox + Friend WithEvents ButtonGuardar As Button + Friend WithEvents Label6 As Label + Friend WithEvents TextBoxNombre As TextBox + Friend WithEvents Label7 As Label + Friend WithEvents Label8 As Label + Friend WithEvents Label9 As Label + Friend WithEvents Label10 As Label + Friend WithEvents Label11 As Label + Friend WithEvents Label12 As Label + Friend WithEvents TextBoxComentario As TextBox + Friend WithEvents TextBoxProveedor As TextBox + Friend WithEvents DateTimePickerFecha As DateTimePicker + Friend WithEvents Label1 As Label + Friend WithEvents LabelSeccional As Label + Friend WithEvents ComboBoxSeccional As ComboBox + Friend WithEvents DateTimePickerMesReintegro As DateTimePicker End Class diff --git a/SireCu/Egresos/ABMEgresos.resx b/SireCu/Egresos/ABMEgresos.resx index 1af7de1..0d9d1cc 100644 --- a/SireCu/Egresos/ABMEgresos.resx +++ b/SireCu/Egresos/ABMEgresos.resx @@ -117,4 +117,100 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + \ No newline at end of file diff --git a/SireCu/Egresos/ABMEgresos.vb b/SireCu/Egresos/ABMEgresos.vb index 3199204..f406e6f 100644 --- a/SireCu/Egresos/ABMEgresos.vb +++ b/SireCu/Egresos/ABMEgresos.vb @@ -2,7 +2,6 @@ Public Class ABMEgresos - Private data As New DataSet #Region "Eventos" Private Sub ABMEgresos_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -12,19 +11,26 @@ Public Class ABMEgresos 'usamos el año mas grande de la base de datos tbYear.Text = ultimoaño("Egresos") - data.Tables.Add("Proveedores") - data.Tables.Add("Personas") - data.Tables.Add("CategoriasGastos") - data.Tables.Add("TiposComprobantes") - data.Tables.Add("Seccionales") - tbProveedor.AutoCompleteCustomSource = autocomplete("Proveedores", "nombre") tbNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") tbTGasto.AutoCompleteCustomSource = autocomplete("CategoriasGastos", "nombre") - tbTComprobante.AutoCompleteCustomSource = autocomplete("tiposComprobantes", "nombre") + tbTComprobante.AutoCompleteCustomSource = autocomplete("TiposComprobantes", "nombre") ' Tab Modificar + activarModificar(False) Egreso.CargardDGV(DataGridViewModificar) + TextBoxNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") + ComboBoxCategGasto.AutoCompleteCustomSource = autocomplete("CategoriasGastos", "nombre") + ComboBoxCategGasto.DataSource = Principal.dataset.Tables("CategoriasGastos") + ComboBoxCategGasto.Enabled = True + ComboBoxCategGasto.ValueMember = "id" + ComboBoxCategGasto.DisplayMember = "nombre" + TextBoxProveedor.AutoCompleteCustomSource = autocomplete("Proveedores", "nombre") + DateTimePickerMesReintegro.Value = Now + ComboBoxSeccional.AutoCompleteCustomSource = autocomplete("Seccionales", "nombre") + DateTimePickerFecha.Value = Now + ComboBoxTipoComprobante.AutoCompleteCustomSource = autocomplete("TiposComprobantes", "nombre") + End Sub @@ -82,6 +88,37 @@ Public Class ABMEgresos 'End If End Sub + Private Sub DataGridViewModificar_CellMouseDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DataGridViewModificar.CellMouseDoubleClick + ' Cargar el formulario con los datos para modificar + Try + TextBoxNombre.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("persona_nombre").Value + ComboBoxCategGasto.SelectedItem = DataGridViewModificar.Rows(e.RowIndex).Cells("categoria_nombre").Value + TextBoxProveedor.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("proveedor_nombre").Value + If DataGridViewModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value Is DBNull.Value Then + DateTimePickerMesReintegro.Value = CDate(DataGridViewModificar.Rows(e.RowIndex).Cells("fecha").Value) + Else + DateTimePickerMesReintegro.Value = CDate(DataGridViewModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value) + End If + ComboBoxSeccional.SelectedItem = DataGridViewModificar.Rows(e.RowIndex).Cells("seccional_nombre").Value + TextBoxComentario.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("comentario").Value.ToString + DateTimePickerFecha.Value = CDate(DataGridViewModificar.Rows(e.RowIndex).Cells("fecha").Value) + ComboBoxTipoComprobante.SelectedItem = DataGridViewModificar.Rows(e.RowIndex).Cells("tipo_comprobante_nombre").Value + If DataGridViewModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Contains("-") Then + TextBoxPVenta.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Split("-")(0) + TextBoxNroComprobante.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Split("-")(1) + Else + TextBoxPVenta.Text = "0" + TextBoxNroComprobante.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value + End If + TextBoxMonto.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("monto").Value + Catch ex As Exception + MessageBox.Show(ex.Message, "Error al cargar el formulario", MessageBoxButtons.OK, MessageBoxIcon.Error) + End Try + + activarModificar(True) + + End Sub + #End Region #Region "Helpers" @@ -92,10 +129,10 @@ Public Class ABMEgresos Principal.query = "SELECT * FROM " & tabla consultarNQ(Principal.query, Principal.command) Principal.adapter = New SqlCeDataAdapter(Principal.command) - Principal.adapter.Fill(data.Tables(tabla)) + Principal.adapter.Fill(Principal.dataset.Tables(tabla)) - For i = 0 To data.Tables(tabla).Rows.Count - 1 - coleccion.Add(Convert.ToString(data.Tables(tabla).Rows.Item(i).Item(Campo_a_Mostrar))) + For Each row As DataRow In Principal.dataset.Tables(tabla).Rows + coleccion.Add(Convert.ToString(row.Item(Campo_a_Mostrar))) Next ' Administrativos @@ -143,16 +180,37 @@ Public Class ABMEgresos Principal.adapter = New SqlCeDataAdapter(Principal.command) Principal.adapter.Fill(Principal.dataset.Tables(tabla)) - For i = 0 To Principal.dataset.Tables(tabla).Rows.Count - 1 - If (LCase(Principal.dataset.Tables(tabla).Rows.Item(i).Item("nombre")) = LCase(Campo_a_comparar)) Then - id = Principal.dataset.Tables(tabla).Rows.Item(i).Item("id") + For Each row As DataRow In Principal.dataset.Tables(tabla).Rows + If (LCase(row.Item("nombre")) = LCase(Campo_a_comparar)) Then + id = row.Item("id") End If Next + + Return (id) End Function + ' Activa o desactiva la modificación de un Egreso + Private Sub activarModificar(ByVal activar As Boolean) + If activar Then + For Each control As Control In SplitContainerModificar.Panel2.Controls + If TypeOf control Is TextBox Or TypeOf control Is ComboBox Then + control.Enabled = True + End If + Next + ButtonGuardar.Enabled = True + Else + For Each control As Control In SplitContainerModificar.Panel2.Controls + If TypeOf control Is TextBox Or TypeOf control Is ComboBox Then + control.Enabled = False + End If + Next + ButtonGuardar.Enabled = False + End If + End Sub + #End Region #Region "Validaciones" From c5065703c7399975bb8830ea4f96f042bd4b38cd Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 8 Mar 2017 17:54:51 -0300 Subject: [PATCH 03/27] ABM Menores ABM de Proveedores, Tipos de comprobantes, Categorias de Gastos y Personas. --- SireCu/OtrasFunciones.vb | 47 +++++- .../ABMEgresos.Designer.vb | 4 +- SireCu/{Egresos => Paneles}/ABMEgresos.resx | 0 SireCu/{Egresos => Paneles}/ABMEgresos.vb | 33 ---- .../ABMIngresos.Designer.vb | 0 SireCu/{Ingresos => Paneles}/ABMIngresos.resx | 0 SireCu/{Ingresos => Paneles}/ABMIngresos.vb | 0 SireCu/Paneles/Otros_AMB.Designer.vb | 147 ++++++++++++++++++ SireCu/Paneles/Otros_AMB.resx | 120 ++++++++++++++ SireCu/Paneles/Otros_AMB.vb | 147 ++++++++++++++++++ SireCu/Principal.Designer.vb | 44 +++++- SireCu/Principal.vb | 20 +++ SireCu/SireCu.vbproj | 21 ++- 13 files changed, 538 insertions(+), 45 deletions(-) rename SireCu/{Egresos => Paneles}/ABMEgresos.Designer.vb (99%) rename SireCu/{Egresos => Paneles}/ABMEgresos.resx (100%) rename SireCu/{Egresos => Paneles}/ABMEgresos.vb (93%) rename SireCu/{Ingresos => Paneles}/ABMIngresos.Designer.vb (100%) rename SireCu/{Ingresos => Paneles}/ABMIngresos.resx (100%) rename SireCu/{Ingresos => Paneles}/ABMIngresos.vb (100%) create mode 100644 SireCu/Paneles/Otros_AMB.Designer.vb create mode 100644 SireCu/Paneles/Otros_AMB.resx create mode 100644 SireCu/Paneles/Otros_AMB.vb diff --git a/SireCu/OtrasFunciones.vb b/SireCu/OtrasFunciones.vb index fc5a8b9..d471cce 100644 --- a/SireCu/OtrasFunciones.vb +++ b/SireCu/OtrasFunciones.vb @@ -66,10 +66,12 @@ Module OtrasFunciones Public Sub ClearDataset(ByVal dataset As DataSet) Principal.dataset.Tables("Ingresos").Clear() Principal.dataset.Tables("Egresos").Clear() - Principal.dataset.Tables("Saldos").Clear() + Principal.dataset.Tables("Proveedores").Clear() + Principal.dataset.Tables("CategoriasGastos").Clear() + Principal.dataset.Tables("Personas").Clear() + Principal.dataset.Tables("TiposComprobantes").Clear() End Sub - 'Verificación de solo entrada por teclado Public Sub keyverify(ByVal e As System.Windows.Forms.KeyPressEventArgs, Optional ByVal letras As Boolean = False, Optional ByVal numeros As Boolean = False, @@ -118,5 +120,46 @@ Module OtrasFunciones End Function + Public Sub abm_otros(ByVal tabla As String) + + ClearDataset(Principal.dataset) + + Principal.query = "SELECT * FROM " & tabla + consultarNQ(Principal.query, Principal.command) + Principal.adapter = New SqlCeDataAdapter(Principal.command) + Principal.adapter.Fill(Principal.dataset.Tables(tabla)) + + Dim bindSource As New BindingSource + bindSource.DataSource = Principal.dataset.Tables(tabla) + Otros_AMB.dgv_otros.DataSource = bindSource + Otros_AMB.dgv_otros.Columns.Item("id").Visible = False + + End Sub + + Public Function exist(ByVal tabla As String, ByVal campo As String, ByVal comparar As String) + + Principal.query = "SELECT * FROM " & tabla + consultarNQ(Principal.query, Principal.command) + Principal.adapter = New SqlCeDataAdapter(Principal.command) + Principal.adapter.Fill(Principal.dataset.Tables(tabla)) + + Dim flag As Boolean = False + + For i = 0 To Principal.dataset.Tables(tabla).Rows.Count - 1 + If (LCase(Principal.dataset.Tables(tabla).Rows.Item(i).Item(campo)) = LCase(comparar)) Then + flag = True + End If + Next + + ClearDataset(Principal.dataset) + + If flag = True Then + Return (True) + Else + Return (False) + End If + + End Function + End Module diff --git a/SireCu/Egresos/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb similarity index 99% rename from SireCu/Egresos/ABMEgresos.Designer.vb rename to SireCu/Paneles/ABMEgresos.Designer.vb index 3b6e591..aa6fd81 100644 --- a/SireCu/Egresos/ABMEgresos.Designer.vb +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -190,7 +190,7 @@ Partial Class ABMEgresos 'bttnConsultar ' Me.bttnConsultar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.bttnConsultar.Location = New System.Drawing.Point(603, 308) + Me.bttnConsultar.Location = New System.Drawing.Point(603, 324) Me.bttnConsultar.Name = "bttnConsultar" Me.bttnConsultar.Size = New System.Drawing.Size(126, 61) Me.bttnConsultar.TabIndex = 90 @@ -313,7 +313,7 @@ Partial Class ABMEgresos ' Me.btnGuardar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnGuardar.ForeColor = System.Drawing.Color.Green - Me.btnGuardar.Location = New System.Drawing.Point(467, 308) + Me.btnGuardar.Location = New System.Drawing.Point(467, 324) Me.btnGuardar.Name = "btnGuardar" Me.btnGuardar.Size = New System.Drawing.Size(126, 61) Me.btnGuardar.TabIndex = 15 diff --git a/SireCu/Egresos/ABMEgresos.resx b/SireCu/Paneles/ABMEgresos.resx similarity index 100% rename from SireCu/Egresos/ABMEgresos.resx rename to SireCu/Paneles/ABMEgresos.resx diff --git a/SireCu/Egresos/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb similarity index 93% rename from SireCu/Egresos/ABMEgresos.vb rename to SireCu/Paneles/ABMEgresos.vb index f406e6f..170b91d 100644 --- a/SireCu/Egresos/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -135,39 +135,6 @@ Public Class ABMEgresos coleccion.Add(Convert.ToString(row.Item(Campo_a_Mostrar))) Next - ' Administrativos - ' Alquileres - ' Bancarios - ' Coparticipación - ' Desenvolvimiento - ' Filiales - ' Franqueo y Encomiendas - 'Honorarios - ' Impuestos y servicios - 'Librería e impresiones - 'Seguros - ' Movilidad y traslado - 'Prensa y difusión - 'Prestaciones - ' Subsidios - - - - ' Factura A - 'Factura B - 'Factura C - 'Recibo A - 'Recibo B - 'Recibo C - 'Recibo X - 'Tique Fact.A - 'Tique Fact.B - 'Tique Fact.C - 'Tique - ' Pasaje - ' Extracto Bancario - 'Otro - Return (coleccion) End Function diff --git a/SireCu/Ingresos/ABMIngresos.Designer.vb b/SireCu/Paneles/ABMIngresos.Designer.vb similarity index 100% rename from SireCu/Ingresos/ABMIngresos.Designer.vb rename to SireCu/Paneles/ABMIngresos.Designer.vb diff --git a/SireCu/Ingresos/ABMIngresos.resx b/SireCu/Paneles/ABMIngresos.resx similarity index 100% rename from SireCu/Ingresos/ABMIngresos.resx rename to SireCu/Paneles/ABMIngresos.resx diff --git a/SireCu/Ingresos/ABMIngresos.vb b/SireCu/Paneles/ABMIngresos.vb similarity index 100% rename from SireCu/Ingresos/ABMIngresos.vb rename to SireCu/Paneles/ABMIngresos.vb diff --git a/SireCu/Paneles/Otros_AMB.Designer.vb b/SireCu/Paneles/Otros_AMB.Designer.vb new file mode 100644 index 0000000..8c36195 --- /dev/null +++ b/SireCu/Paneles/Otros_AMB.Designer.vb @@ -0,0 +1,147 @@ + +Partial Class Otros_AMB + Inherits System.Windows.Forms.Form + + 'Form reemplaza a Dispose para limpiar la lista de componentes. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Requerido por el Diseñador de Windows Forms + Private components As System.ComponentModel.IContainer + + 'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento + 'Se puede modificar usando el Diseñador de Windows Forms. + 'No lo modifique con el editor de código. + + Private Sub InitializeComponent() + Me.SplitContainer1 = New System.Windows.Forms.SplitContainer() + Me.dgv_otros = New System.Windows.Forms.DataGridView() + Me.tb_editar = New System.Windows.Forms.TextBox() + Me.btn_Cancelar = New System.Windows.Forms.Button() + Me.cb_tabla = New System.Windows.Forms.ComboBox() + Me.btn_Guardar = New System.Windows.Forms.Button() + Me.btn_Eliminar = New System.Windows.Forms.Button() + CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainer1.Panel1.SuspendLayout() + Me.SplitContainer1.Panel2.SuspendLayout() + Me.SplitContainer1.SuspendLayout() + CType(Me.dgv_otros, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'SplitContainer1 + ' + Me.SplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainer1.Location = New System.Drawing.Point(0, 0) + Me.SplitContainer1.Name = "SplitContainer1" + ' + 'SplitContainer1.Panel1 + ' + Me.SplitContainer1.Panel1.Controls.Add(Me.dgv_otros) + ' + 'SplitContainer1.Panel2 + ' + Me.SplitContainer1.Panel2.Controls.Add(Me.btn_Eliminar) + Me.SplitContainer1.Panel2.Controls.Add(Me.tb_editar) + Me.SplitContainer1.Panel2.Controls.Add(Me.btn_Cancelar) + Me.SplitContainer1.Panel2.Controls.Add(Me.cb_tabla) + Me.SplitContainer1.Panel2.Controls.Add(Me.btn_Guardar) + Me.SplitContainer1.Size = New System.Drawing.Size(381, 201) + Me.SplitContainer1.SplitterDistance = 226 + Me.SplitContainer1.TabIndex = 0 + ' + 'dgv_otros + ' + Me.dgv_otros.AllowUserToAddRows = False + Me.dgv_otros.AllowUserToDeleteRows = False + Me.dgv_otros.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill + Me.dgv_otros.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dgv_otros.Dock = System.Windows.Forms.DockStyle.Fill + Me.dgv_otros.Location = New System.Drawing.Point(0, 0) + Me.dgv_otros.MultiSelect = False + Me.dgv_otros.Name = "dgv_otros" + Me.dgv_otros.ReadOnly = True + Me.dgv_otros.Size = New System.Drawing.Size(226, 201) + Me.dgv_otros.TabIndex = 0 + ' + 'tb_editar + ' + Me.tb_editar.Location = New System.Drawing.Point(8, 69) + Me.tb_editar.Name = "tb_editar" + Me.tb_editar.Size = New System.Drawing.Size(131, 20) + Me.tb_editar.TabIndex = 5 + ' + 'btn_Cancelar + ' + Me.btn_Cancelar.Location = New System.Drawing.Point(41, 166) + Me.btn_Cancelar.Name = "btn_Cancelar" + Me.btn_Cancelar.Size = New System.Drawing.Size(75, 23) + Me.btn_Cancelar.TabIndex = 4 + Me.btn_Cancelar.Text = "Cancelar" + Me.btn_Cancelar.UseVisualStyleBackColor = True + ' + 'cb_tabla + ' + Me.cb_tabla.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.cb_tabla.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems + Me.cb_tabla.FormattingEnabled = True + Me.cb_tabla.Items.AddRange(New Object() {"Proveedor", "Tipo de Comprobante", "Tipo de Gasto", "Persona"}) + Me.cb_tabla.Location = New System.Drawing.Point(8, 19) + Me.cb_tabla.Name = "cb_tabla" + Me.cb_tabla.Size = New System.Drawing.Size(131, 21) + Me.cb_tabla.TabIndex = 3 + ' + 'btn_Guardar + ' + Me.btn_Guardar.Location = New System.Drawing.Point(8, 108) + Me.btn_Guardar.Name = "btn_Guardar" + Me.btn_Guardar.Size = New System.Drawing.Size(64, 36) + Me.btn_Guardar.TabIndex = 0 + Me.btn_Guardar.Text = "Guardar Nuevo" + Me.btn_Guardar.UseVisualStyleBackColor = True + ' + 'btn_Eliminar + ' + Me.btn_Eliminar.Location = New System.Drawing.Point(78, 108) + Me.btn_Eliminar.Name = "btn_Eliminar" + Me.btn_Eliminar.Size = New System.Drawing.Size(64, 36) + Me.btn_Eliminar.TabIndex = 6 + Me.btn_Eliminar.Text = "Eliminar" + Me.btn_Eliminar.UseVisualStyleBackColor = True + ' + 'Otros_AMB + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(381, 201) + Me.Controls.Add(Me.SplitContainer1) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "Otros_AMB" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "SireCu" + Me.SplitContainer1.Panel1.ResumeLayout(False) + Me.SplitContainer1.Panel2.ResumeLayout(False) + Me.SplitContainer1.Panel2.PerformLayout() + CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainer1.ResumeLayout(False) + CType(Me.dgv_otros, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents SplitContainer1 As SplitContainer + Friend WithEvents dgv_otros As DataGridView + Friend WithEvents btn_Guardar As Button + Friend WithEvents cb_tabla As ComboBox + Friend WithEvents btn_Cancelar As Button + Friend WithEvents tb_editar As TextBox + Friend WithEvents btn_Eliminar As Button +End Class diff --git a/SireCu/Paneles/Otros_AMB.resx b/SireCu/Paneles/Otros_AMB.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/SireCu/Paneles/Otros_AMB.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/SireCu/Paneles/Otros_AMB.vb b/SireCu/Paneles/Otros_AMB.vb new file mode 100644 index 0000000..9093ca8 --- /dev/null +++ b/SireCu/Paneles/Otros_AMB.vb @@ -0,0 +1,147 @@ +Imports System.ComponentModel + +Public Class Otros_AMB + + Public tabla As String + +#Region "Botones" + Private Sub btn_Cancelar_Click(sender As Object, e As EventArgs) Handles btn_Cancelar.Click + dgv_otros.Enabled = True + tb_editar.Text = "" + cb_tabla.Enabled = True + btn_Guardar.Text = "Guardar" & vbCrLf & "Nuevo" + End Sub + Private Sub btn_Guardar_Click(sender As Object, e As EventArgs) Handles btn_Guardar.Click + + 'Verificación de tabla correcta + If (verificarTabla() = 0) Then + MsgBox("Por favor, seleccione una opción correcta", MsgBoxStyle.Exclamation, "Error") + Exit Sub + End If + + 'Verificacion de campos vacios + If (tb_editar.Text = "") Or (cb_tabla.Text = "") Then + MsgBox("Por favor, complete todos los campos", MsgBoxStyle.Exclamation, "Error") + Exit Sub + End If + + + If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Guardar?") = MsgBoxResult.Ok) Then + + If (btn_Guardar.Text = "Guardar Nuevo") Then + + 'Verificación de registro repetido + If (exist(tabla, "nombre", tb_editar.Text) = True) Then + MsgBox("Ese " & cb_tabla.Text & " ya se encuentra cargado", MsgBoxStyle.Exclamation, "Error") + Exit Sub + End If + Principal.query = "INSERT INTO [" & tabla & "] ([nombre]) VALUES (@nombre)" + + ElseIf (btn_Guardar.Text = "Actualizar") Then + + Principal.query = "UPDATE " & tabla & " SET [nombre] = @nombre WHERE id=@id " + Principal.command.Parameters.AddWithValue("@id", dgv_otros.CurrentRow.Cells(0).Value) + + dgv_otros.Enabled = True + cb_tabla.Enabled = True + btn_Guardar.Text = "Guardar Nuevo" + + End If + + Principal.command.Parameters.AddWithValue("@nombre", tb_editar.Text) + consultarNQ(Principal.query, Principal.command) + + Principal.command.Parameters.Clear() + + MsgBox("Guardado Correctamente!", MsgBoxStyle.Information, "Guardado") + tb_editar.Text = "" + actualizar() + + End If + + End Sub + Private Sub btn_Eliminar_Click(sender As Object, e As EventArgs) Handles btn_Eliminar.Click + + 'Verificacion de selección + If dgv_otros.SelectedCells.Count = 0 Then + MsgBox("Por favor seleccione un registro", MsgBoxStyle.Exclamation, "Error") + Exit Sub + End If + + If (verificarTabla() = 0) Then + MsgBox("Por favor, seleccione una opción correcta", MsgBoxStyle.Exclamation, "Error") + Exit Sub + End If + + If (MsgBox("Eliminar registro?", MsgBoxStyle.OkCancel, "Eliminar?") = MsgBoxResult.Ok) Then + + Principal.query = "DELETE FROM [" & tabla & "] WHERE id = @id" + Principal.command.Parameters.AddWithValue("@id", dgv_otros.CurrentRow.Cells(0).Value) + consultarNQ(Principal.query, Principal.command) + + Principal.command.Parameters.Clear() + + MsgBox("Eliminado correctamente", MsgBoxStyle.Information, "Eliminado") + tb_editar.Text = "" + actualizar() + + End If + + End Sub +#End Region + +#Region "Otros" + Private Sub dgv_otros_CellMouseDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles dgv_otros.CellMouseDoubleClick + tb_editar.Text = dgv_otros.CurrentRow.Cells(1).Value + dgv_otros.Enabled = False + cb_tabla.Enabled = False + btn_Guardar.Text = "Actualizar" + End Sub + Private Sub Otros_AMB_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing + dgv_otros.DataSource = Nothing + End Sub + Private Sub cb_tabla_TextChanged(sender As Object, e As EventArgs) Handles cb_tabla.TextChanged + actualizar() + End Sub + Private Sub actualizar() + Select Case cb_tabla.Text + Case "Proveedor" + abm_otros("Proveedores") + Case "Tipo de Comprobante" + abm_otros("TiposComprobantes") + Case "Tipo de Gasto" + abm_otros("CategoriasGastos") + Case "Persona" + abm_otros("Personas") + End Select + End Sub + Private Sub Otros_AMB_Load(sender As Object, e As EventArgs) Handles MyBase.Load + Select Case cb_tabla.Text + Case "Proveedor" + tabla = "Proveedores" + Case "Tipo de Comprobante" + tabla = "TiposComprobantes" + Case "Tipo de Gasto" + tabla = "CategoriasGastos" + Case "Persona" + tabla = "Personas" + End Select + End Sub + Private Function verificarTabla() + If (tabla <> "Proveedores") And (tabla <> "TiposComprobantes") And (tabla <> "CategoriasGastos") And (tabla <> "Personas") Then + Return (0) + Else Return (1) + End If + End Function +#End Region + +#Region "Validaciones" + Private Sub cb_tabla_KeyPress(sender As Object, e As KeyPressEventArgs) Handles cb_tabla.KeyPress + keyverify(e, letras:=True, espacios:=True) + End Sub + Private Sub tb_editar_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tb_editar.KeyPress + keyverify(e, letras:=True, espacios:=True) + End Sub +#End Region + +End Class \ No newline at end of file diff --git a/SireCu/Principal.Designer.vb b/SireCu/Principal.Designer.vb index 35c2945..47972b5 100644 --- a/SireCu/Principal.Designer.vb +++ b/SireCu/Principal.Designer.vb @@ -34,6 +34,11 @@ Partial Class Principal Me.MenuStripPrincipal = New System.Windows.Forms.MenuStrip() Me.ArchivoToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.SalirToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.EditarToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ProveedoresToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.TiposDeGastosToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.CategoríasDeGastosToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.PersonasToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ErrorProvider = New System.Windows.Forms.ErrorProvider(Me.components) Me.ToolStripContainerPrincipal.BottomToolStripPanel.SuspendLayout() Me.ToolStripContainerPrincipal.ContentPanel.SuspendLayout() @@ -145,7 +150,7 @@ Partial Class Principal 'MenuStripPrincipal ' Me.MenuStripPrincipal.Dock = System.Windows.Forms.DockStyle.None - Me.MenuStripPrincipal.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ArchivoToolStripMenuItem}) + Me.MenuStripPrincipal.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ArchivoToolStripMenuItem, Me.EditarToolStripMenuItem}) Me.MenuStripPrincipal.Location = New System.Drawing.Point(0, 0) Me.MenuStripPrincipal.Name = "MenuStripPrincipal" Me.MenuStripPrincipal.Size = New System.Drawing.Size(982, 24) @@ -165,6 +170,37 @@ Partial Class Principal Me.SalirToolStripMenuItem.Size = New System.Drawing.Size(96, 22) Me.SalirToolStripMenuItem.Text = "&Salir" ' + 'EditarToolStripMenuItem + ' + Me.EditarToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ProveedoresToolStripMenuItem, Me.TiposDeGastosToolStripMenuItem, Me.CategoríasDeGastosToolStripMenuItem, Me.PersonasToolStripMenuItem}) + Me.EditarToolStripMenuItem.Name = "EditarToolStripMenuItem" + Me.EditarToolStripMenuItem.Size = New System.Drawing.Size(49, 20) + Me.EditarToolStripMenuItem.Text = "Editar" + ' + 'ProveedoresToolStripMenuItem + ' + Me.ProveedoresToolStripMenuItem.Name = "ProveedoresToolStripMenuItem" + Me.ProveedoresToolStripMenuItem.Size = New System.Drawing.Size(201, 22) + Me.ProveedoresToolStripMenuItem.Text = "Proveedores" + ' + 'TiposDeGastosToolStripMenuItem + ' + Me.TiposDeGastosToolStripMenuItem.Name = "TiposDeGastosToolStripMenuItem" + Me.TiposDeGastosToolStripMenuItem.Size = New System.Drawing.Size(201, 22) + Me.TiposDeGastosToolStripMenuItem.Text = "Tipos de Comprobantes" + ' + 'CategoríasDeGastosToolStripMenuItem + ' + Me.CategoríasDeGastosToolStripMenuItem.Name = "CategoríasDeGastosToolStripMenuItem" + Me.CategoríasDeGastosToolStripMenuItem.Size = New System.Drawing.Size(201, 22) + Me.CategoríasDeGastosToolStripMenuItem.Text = "Tipos de Gastos" + ' + 'PersonasToolStripMenuItem + ' + Me.PersonasToolStripMenuItem.Name = "PersonasToolStripMenuItem" + Me.PersonasToolStripMenuItem.Size = New System.Drawing.Size(201, 22) + Me.PersonasToolStripMenuItem.Text = "Personas" + ' 'ErrorProvider ' Me.ErrorProvider.ContainerControl = Me @@ -210,5 +246,9 @@ Partial Class Principal Friend WithEvents stat_Bar As System.Windows.Forms.ToolStripProgressBar Friend WithEvents RadioButtonEgresos As System.Windows.Forms.RadioButton Friend WithEvents ErrorProvider As System.Windows.Forms.ErrorProvider - + Friend WithEvents EditarToolStripMenuItem As ToolStripMenuItem + Friend WithEvents ProveedoresToolStripMenuItem As ToolStripMenuItem + Friend WithEvents TiposDeGastosToolStripMenuItem As ToolStripMenuItem + Friend WithEvents CategoríasDeGastosToolStripMenuItem As ToolStripMenuItem + Friend WithEvents PersonasToolStripMenuItem As ToolStripMenuItem End Class diff --git a/SireCu/Principal.vb b/SireCu/Principal.vb index a648b24..ab5b191 100644 --- a/SireCu/Principal.vb +++ b/SireCu/Principal.vb @@ -64,4 +64,24 @@ Public Class Principal dataset.Tables.Add("Seccionales") End Sub + + Private Sub ProveedoresToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ProveedoresToolStripMenuItem.Click + Otros_AMB.cb_tabla.Text = "Proveedor" + Otros_AMB.ShowDialog() + End Sub + + Private Sub TiposDeGastosToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TiposDeGastosToolStripMenuItem.Click + Otros_AMB.cb_tabla.Text = "Tipo de Comprobante" + Otros_AMB.ShowDialog() + End Sub + + Private Sub CategoríasDeGastosToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CategoríasDeGastosToolStripMenuItem.Click + Otros_AMB.cb_tabla.Text = "Tipo de Gasto" + Otros_AMB.ShowDialog() + End Sub + + Private Sub PersonasToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PersonasToolStripMenuItem.Click + Otros_AMB.cb_tabla.Text = "Persona" + Otros_AMB.ShowDialog() + End Sub End Class diff --git a/SireCu/SireCu.vbproj b/SireCu/SireCu.vbproj index f039514..d8aa3d2 100644 --- a/SireCu/SireCu.vbproj +++ b/SireCu/SireCu.vbproj @@ -125,19 +125,25 @@ - + ABMEgresos.vb - + UserControl - + ABMIngresos.vb - + UserControl + + Otros_AMB.vb + + + Form + Form @@ -162,10 +168,10 @@ - + ABMEgresos.vb - + ABMIngresos.vb @@ -174,6 +180,9 @@ My.Resources Designer + + Otros_AMB.vb + Principal.vb From 0ff93e609eaaa60ebd1c5f6526cf0d1fd93323ec Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Thu, 9 Mar 2017 03:25:42 -0300 Subject: [PATCH 04/27] Validaciones y Guardar Modificaciones --- SireCu/Clases/Egreso.vb | 32 +++++- SireCu/Clases/Ingreso.vb | 16 ++- SireCu/Conexion.vb | 20 +++- SireCu/OtrasFunciones.vb | 37 +++--- SireCu/Paneles/ABMEgresos.Designer.vb | 107 +++++++++-------- SireCu/Paneles/ABMEgresos.vb | 160 +++++++++++++++++++++++--- SireCu/Principal.vb | 21 ++-- 7 files changed, 287 insertions(+), 106 deletions(-) diff --git a/SireCu/Clases/Egreso.vb b/SireCu/Clases/Egreso.vb index 283fddc..71cdb36 100644 --- a/SireCu/Clases/Egreso.vb +++ b/SireCu/Clases/Egreso.vb @@ -24,8 +24,32 @@ Module Egreso consultarNQ(Principal.query, Principal.command) End Sub - Public Sub modificar_egreso() + Public Sub modificar_egreso(ByVal id As Integer, ByVal compro As String, ByVal proveedor As Integer, ByVal categoria As Integer, + ByVal persona As Integer, ByVal fecha As Date, ByVal tipo_comp As Integer, ByVal secc As Integer, + ByVal reintegro As Date, ByVal monto As Decimal, ByVal comentario As String) + + Principal.query = "UPDATE Egresos SET nro_comprobante = @nro_comprobante, proveedor_id = @proveedor, categoria_gasto_id = @cat_gasto, " & + "persona_id = @persona, fecha = @fecha, tipo_comprobante_id = @t_comprobante, seccional_id = @seccional, " & + "mes_reintegro = @reintegro, monto = @monto, comentario = @comentario " & + "WHERE id = @id" + Principal.command.Parameters.Clear() + Principal.command.Parameters.AddWithValue("@nro_comprobante", compro) + Principal.command.Parameters.AddWithValue("@proveedor", proveedor) + Principal.command.Parameters.AddWithValue("@cat_gasto", categoria) + Principal.command.Parameters.AddWithValue("@persona", persona) + Principal.command.Parameters.AddWithValue("@fecha", fecha) + Principal.command.Parameters.AddWithValue("@t_comprobante", tipo_comp) + Principal.command.Parameters.AddWithValue("@seccional", secc) + Principal.command.Parameters.AddWithValue("@reintegro", reintegro) + Principal.command.Parameters.AddWithValue("@monto", monto) + Principal.command.Parameters.AddWithValue("@comentario", comentario) + Principal.command.Parameters.AddWithValue("@id", id) + If consultarNQ(Principal.query, Principal.command) > 0 Then + MsgBox("Egreso modificado exitosamente", MsgBoxStyle.OkOnly, "Guardar Cambios") + Else + MsgBox("Ocurrio un error al guardar los cambios", MsgBoxStyle.Exclamation, "Guardar Cambios") + End If End Sub Public Sub eliminar_egreso() @@ -33,7 +57,7 @@ Module Egreso End Sub Public Function mostrar_egreso() - + Throw New NotImplementedException() End Function Public Sub CargardDGV(ByRef dgv As DataGridView) @@ -67,6 +91,10 @@ Module Egreso Principal.command.Connection = con Dim tableadapter = New SqlCeDataAdapter(Principal.command) + If Principal.dataset.Tables.Contains("Egresos_Modificar") Then + Principal.dataset.Tables("Egresos_Modificar").Clear() + End If + tableadapter.Fill(Principal.dataset, "Egresos_Modificar") Dim mybinding = New BindingSource(Principal.dataset, "Egresos_Modificar") diff --git a/SireCu/Clases/Ingreso.vb b/SireCu/Clases/Ingreso.vb index f41103f..17393ca 100644 --- a/SireCu/Clases/Ingreso.vb +++ b/SireCu/Clases/Ingreso.vb @@ -19,13 +19,15 @@ Module Ingreso Public Function mostrar_ingreso(ByVal mes As Integer, ByVal año As Integer) + ' TODO reemplazar fill dataset por command.ExecuteReader + Principal.query = "SELECT * from ingresos where DATEPART(month, fecha) = '" & mes & "'" & " And DatePart(Year, fecha) = '" & año & "'" consultarNQ(Principal.query, Principal.command) - Principal.adapter = New SqlCeDataAdapter(Principal.command) - ClearDataset(Principal.dataset) - Principal.adapter.Fill(Principal.dataset.Tables("ingresos")) + Principal.tableadapters("Ingresos") = New SqlCeDataAdapter(Principal.command) + ClearDataset(Principal.dataset) ' TODO limpiar solo tabla a usar + Principal.tableadapters("Ingresos").Fill(Principal.dataset.Tables("ingresos")) Dim array() As String If (Principal.dataset.Tables("ingresos").Rows.Count = 0) Then @@ -44,11 +46,13 @@ Module Ingreso Public Function verificar_año(ByVal año As Integer) + ' TODO reemplazar fill dataset por command.ExecuteReader + Principal.query = "SELECT * from ingresos where DATEPART(Year, fecha) = '" & año & "'" consultarNQ(Principal.query, Principal.command) - ClearDataset(Principal.dataset) - Principal.adapter = New SqlCeDataAdapter(Principal.command) - Principal.adapter.Fill(Principal.dataset.Tables("ingresos")) + ClearDataset(Principal.dataset) ' TODO limpiar solo tabla a usar + Principal.tableadapters("Ingresos") = New SqlCeDataAdapter(Principal.command) + Principal.tableadapters("Ingresos").Fill(Principal.dataset.Tables("ingresos")) If (Principal.dataset.Tables("ingresos").Rows.Count = 0) Then Return (False) diff --git a/SireCu/Conexion.vb b/SireCu/Conexion.vb index 4a5b9f8..a9980f4 100644 --- a/SireCu/Conexion.vb +++ b/SireCu/Conexion.vb @@ -2,7 +2,7 @@ Module Conexion - Private conexion As New SqlCeConnection(My.Settings.CadenaConexion) + Public conexion As New SqlCeConnection(My.Settings.CadenaConexion) Private Sub conectar() @@ -56,5 +56,23 @@ Module Conexion Return resultado End Function + Sub cargarTablaEnDataSet(ByVal tabla As String) + + Principal.command.Connection = conexion + + ' Crea tabla en dataset si no existe + If Not Principal.dataset.Tables.Contains(tabla) Then + Principal.dataset.Tables.Add(tabla) + End If + + Principal.command.CommandText = "Select * FROM " & tabla + + ' Crea tableadapter si no existe + If Not Principal.tableadapters.ContainsKey(tabla) Then + Principal.tableadapters.Add(tabla, New SqlCeDataAdapter(Principal.command)) + End If + Principal.tableadapters(tabla).Fill(Principal.dataset.Tables.Item(tabla)) + End Sub + End Module diff --git a/SireCu/OtrasFunciones.vb b/SireCu/OtrasFunciones.vb index d471cce..19bf504 100644 --- a/SireCu/OtrasFunciones.vb +++ b/SireCu/OtrasFunciones.vb @@ -106,12 +106,15 @@ Module OtrasFunciones Public Function ultimoaño(ByVal tabla As String) + ' TODO reemplazar fill dataset por command.ExecuteReader + Principal.query = "SELECT fecha FROM " & tabla & " ORDER BY fecha DESC" consultarNQ(Principal.query, Principal.command) - ClearDataset(Principal.dataset) + ' ClearDataset(Principal.dataset) Borrar solo tabla + Principal.dataset.Tables(tabla).Clear() - Principal.adapter = New SqlCeDataAdapter(Principal.command) - Principal.adapter.Fill(Principal.dataset.Tables(tabla)) + Principal.tableadapters(tabla) = New SqlCeDataAdapter(Principal.command) + Principal.tableadapters(tabla).Fill(Principal.dataset.Tables(tabla)) If (Principal.dataset.Tables(tabla).Rows.Count() = 0) Then Return ("2000") @@ -122,12 +125,10 @@ Module OtrasFunciones Public Sub abm_otros(ByVal tabla As String) - ClearDataset(Principal.dataset) + ' ClearDataset(Principal.dataset) - Principal.query = "SELECT * FROM " & tabla - consultarNQ(Principal.query, Principal.command) - Principal.adapter = New SqlCeDataAdapter(Principal.command) - Principal.adapter.Fill(Principal.dataset.Tables(tabla)) + Principal.dataset.Tables(tabla).Clear() + cargarTablaEnDataSet(tabla) Dim bindSource As New BindingSource bindSource.DataSource = Principal.dataset.Tables(tabla) @@ -138,10 +139,13 @@ Module OtrasFunciones Public Function exist(ByVal tabla As String, ByVal campo As String, ByVal comparar As String) - Principal.query = "SELECT * FROM " & tabla - consultarNQ(Principal.query, Principal.command) - Principal.adapter = New SqlCeDataAdapter(Principal.command) - Principal.adapter.Fill(Principal.dataset.Tables(tabla)) + 'Principal.query = "SELECT * FROM " & tabla + 'consultarNQ(Principal.query, Principal.command) + 'Principal.tableadapters(tabla) = New SqlCeDataAdapter(Principal.command) + 'Principal.tableadapters(tabla).Fill(Principal.dataset.Tables(tabla)) + + ' TODO Ver si hace falta recargar la tabla en el dataset si no usar el dataset directamente + cargarTablaEnDataSet(tabla) Dim flag As Boolean = False @@ -151,13 +155,10 @@ Module OtrasFunciones End If Next - ClearDataset(Principal.dataset) + ' ClearDataset(Principal.dataset) + Principal.dataset.Tables(tabla).Clear() - If flag = True Then - Return (True) - Else - Return (False) - End If + Return flag End Function diff --git a/SireCu/Paneles/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb index aa6fd81..64d2a27 100644 --- a/SireCu/Paneles/ABMEgresos.Designer.vb +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -73,6 +73,11 @@ Partial Class ABMEgresos Me.mes_reintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.monto = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.comentario = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.LabelSeccional = New System.Windows.Forms.Label() + Me.ComboBoxSeccional = New System.Windows.Forms.ComboBox() + Me.DateTimePickerMesReintegro = New System.Windows.Forms.DateTimePicker() + Me.Label1 = New System.Windows.Forms.Label() + Me.DateTimePickerFecha = New System.Windows.Forms.DateTimePicker() Me.TextBoxNroComprobante = New System.Windows.Forms.TextBox() Me.ComboBoxTipoComprobante = New System.Windows.Forms.ComboBox() Me.TextBoxPVenta = New System.Windows.Forms.TextBox() @@ -91,11 +96,6 @@ Partial Class ABMEgresos Me.Label12 = New System.Windows.Forms.Label() Me.TextBoxComentario = New System.Windows.Forms.TextBox() Me.TextBoxProveedor = New System.Windows.Forms.TextBox() - Me.DateTimePickerFecha = New System.Windows.Forms.DateTimePicker() - Me.Label1 = New System.Windows.Forms.Label() - Me.DateTimePickerMesReintegro = New System.Windows.Forms.DateTimePicker() - Me.ComboBoxSeccional = New System.Windows.Forms.ComboBox() - Me.LabelSeccional = New System.Windows.Forms.Label() Me.TabControl.SuspendLayout() Me.TabPageAgregar.SuspendLayout() Me.TabPageModificar.SuspendLayout() @@ -616,6 +616,54 @@ Partial Class ABMEgresos Me.comentario.Name = "comentario" Me.comentario.ReadOnly = True ' + 'LabelSeccional + ' + Me.LabelSeccional.AutoSize = True + Me.LabelSeccional.Location = New System.Drawing.Point(22, 130) + Me.LabelSeccional.Name = "LabelSeccional" + Me.LabelSeccional.Size = New System.Drawing.Size(68, 16) + Me.LabelSeccional.TabIndex = 119 + Me.LabelSeccional.Text = "Seccional" + ' + 'ComboBoxSeccional + ' + Me.ComboBoxSeccional.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.ComboBoxSeccional.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.ComboBoxSeccional.FormattingEnabled = True + Me.ComboBoxSeccional.Location = New System.Drawing.Point(145, 127) + Me.ComboBoxSeccional.Name = "ComboBoxSeccional" + Me.ComboBoxSeccional.Size = New System.Drawing.Size(197, 24) + Me.ComboBoxSeccional.TabIndex = 118 + ' + 'DateTimePickerMesReintegro + ' + Me.DateTimePickerMesReintegro.CustomFormat = "" + Me.DateTimePickerMesReintegro.Format = System.Windows.Forms.DateTimePickerFormat.[Short] + Me.DateTimePickerMesReintegro.Location = New System.Drawing.Point(145, 99) + Me.DateTimePickerMesReintegro.Name = "DateTimePickerMesReintegro" + Me.DateTimePickerMesReintegro.Size = New System.Drawing.Size(197, 22) + Me.DateTimePickerMesReintegro.TabIndex = 117 + Me.DateTimePickerMesReintegro.Value = New Date(2017, 3, 4, 19, 31, 9, 0) + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(383, 16) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(49, 16) + Me.Label1.TabIndex = 116 + Me.Label1.Text = "Fecha:" + ' + 'DateTimePickerFecha + ' + Me.DateTimePickerFecha.CustomFormat = "" + Me.DateTimePickerFecha.Format = System.Windows.Forms.DateTimePickerFormat.[Short] + Me.DateTimePickerFecha.Location = New System.Drawing.Point(529, 13) + Me.DateTimePickerFecha.Name = "DateTimePickerFecha" + Me.DateTimePickerFecha.Size = New System.Drawing.Size(163, 22) + Me.DateTimePickerFecha.TabIndex = 115 + Me.DateTimePickerFecha.Value = New Date(2017, 3, 4, 19, 31, 9, 0) + ' 'TextBoxNroComprobante ' Me.TextBoxNroComprobante.Location = New System.Drawing.Point(595, 71) @@ -628,7 +676,6 @@ Partial Class ABMEgresos Me.ComboBoxTipoComprobante.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend Me.ComboBoxTipoComprobante.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource Me.ComboBoxTipoComprobante.FormattingEnabled = True - Me.ComboBoxTipoComprobante.Items.AddRange(New Object() {"Factura A", "Factura B", "Factura C", "Recibo A", "Recibo B", "Recibo C", "Recibo X", "Tique Fact. A", "Tique Fact. B", "Tique Fact. C", "Tique", "Pasaje", "Extracto Bancario", "Otro"}) Me.ComboBoxTipoComprobante.Location = New System.Drawing.Point(529, 41) Me.ComboBoxTipoComprobante.Name = "ComboBoxTipoComprobante" Me.ComboBoxTipoComprobante.Size = New System.Drawing.Size(163, 24) @@ -778,54 +825,6 @@ Partial Class ABMEgresos Me.TextBoxProveedor.Size = New System.Drawing.Size(197, 22) Me.TextBoxProveedor.TabIndex = 96 ' - 'DateTimePickerFecha - ' - Me.DateTimePickerFecha.CustomFormat = "" - Me.DateTimePickerFecha.Format = System.Windows.Forms.DateTimePickerFormat.[Short] - Me.DateTimePickerFecha.Location = New System.Drawing.Point(529, 13) - Me.DateTimePickerFecha.Name = "DateTimePickerFecha" - Me.DateTimePickerFecha.Size = New System.Drawing.Size(163, 22) - Me.DateTimePickerFecha.TabIndex = 115 - Me.DateTimePickerFecha.Value = New Date(2017, 3, 4, 19, 31, 9, 0) - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(383, 16) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(49, 16) - Me.Label1.TabIndex = 116 - Me.Label1.Text = "Fecha:" - ' - 'DateTimePickerMesReintegro - ' - Me.DateTimePickerMesReintegro.CustomFormat = "" - Me.DateTimePickerMesReintegro.Format = System.Windows.Forms.DateTimePickerFormat.[Short] - Me.DateTimePickerMesReintegro.Location = New System.Drawing.Point(145, 99) - Me.DateTimePickerMesReintegro.Name = "DateTimePickerMesReintegro" - Me.DateTimePickerMesReintegro.Size = New System.Drawing.Size(197, 22) - Me.DateTimePickerMesReintegro.TabIndex = 117 - Me.DateTimePickerMesReintegro.Value = New Date(2017, 3, 4, 19, 31, 9, 0) - ' - 'ComboBoxSeccional - ' - Me.ComboBoxSeccional.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.ComboBoxSeccional.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.ComboBoxSeccional.FormattingEnabled = True - Me.ComboBoxSeccional.Location = New System.Drawing.Point(145, 127) - Me.ComboBoxSeccional.Name = "ComboBoxSeccional" - Me.ComboBoxSeccional.Size = New System.Drawing.Size(197, 24) - Me.ComboBoxSeccional.TabIndex = 118 - ' - 'LabelSeccional - ' - Me.LabelSeccional.AutoSize = True - Me.LabelSeccional.Location = New System.Drawing.Point(22, 130) - Me.LabelSeccional.Name = "LabelSeccional" - Me.LabelSeccional.Size = New System.Drawing.Size(68, 16) - Me.LabelSeccional.TabIndex = 119 - Me.LabelSeccional.Text = "Seccional" - ' 'ABMEgresos ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index 170b91d..e98ff97 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -2,6 +2,10 @@ Public Class ABMEgresos + Dim ControlesConErroresAgregar As List(Of Control) = New List(Of Control) + Dim ControlesConErroresModificar As List(Of Control) = New List(Of Control) + + Dim idModificando As Integer = 0 #Region "Eventos" Private Sub ABMEgresos_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -22,18 +26,25 @@ Public Class ABMEgresos TextBoxNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") ComboBoxCategGasto.AutoCompleteCustomSource = autocomplete("CategoriasGastos", "nombre") ComboBoxCategGasto.DataSource = Principal.dataset.Tables("CategoriasGastos") - ComboBoxCategGasto.Enabled = True ComboBoxCategGasto.ValueMember = "id" ComboBoxCategGasto.DisplayMember = "nombre" TextBoxProveedor.AutoCompleteCustomSource = autocomplete("Proveedores", "nombre") DateTimePickerMesReintegro.Value = Now ComboBoxSeccional.AutoCompleteCustomSource = autocomplete("Seccionales", "nombre") + ComboBoxSeccional.DataSource = Principal.dataset.Tables("Seccionales") + ComboBoxSeccional.ValueMember = "id" + ComboBoxSeccional.DisplayMember = "nombre" DateTimePickerFecha.Value = Now ComboBoxTipoComprobante.AutoCompleteCustomSource = autocomplete("TiposComprobantes", "nombre") + ComboBoxTipoComprobante.DataSource = Principal.dataset.Tables("TiposComprobantes") + ComboBoxTipoComprobante.ValueMember = "id" + ComboBoxTipoComprobante.DisplayMember = "nombre" End Sub + + ' Click en boton Guardar en Tab: Agregar Private Sub btnGuardar_Click(sender As Object, e As EventArgs) Handles btnGuardar.Click 'Preguntamos si esta seguro If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Guardar?") = MsgBoxResult.Ok) Then @@ -88,9 +99,13 @@ Public Class ABMEgresos 'End If End Sub + + ' Doble click en fila del datagridview en Tab: Modificar Private Sub DataGridViewModificar_CellMouseDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DataGridViewModificar.CellMouseDoubleClick ' Cargar el formulario con los datos para modificar Try + idModificando = CInt(DataGridViewModificar.Rows(e.RowIndex).Cells("id").Value) + TextBoxNombre.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("persona_nombre").Value ComboBoxCategGasto.SelectedItem = DataGridViewModificar.Rows(e.RowIndex).Cells("categoria_nombre").Value TextBoxProveedor.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("proveedor_nombre").Value @@ -119,6 +134,65 @@ Public Class ABMEgresos End Sub + + ' Click en boton Guardar en Tab: Modificar + Private Sub ButtonGuardar_Click(sender As Object, e As EventArgs) Handles ButtonGuardar.Click + + 'Preguntamos si esta seguro + If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Guardar?") = MsgBoxResult.Ok) Then + + ' Verificamos que todos los campos hayan pasado las validaciones + If ControlesConErroresModificar.Count > 0 Then + MsgBox("Por favor revise los campos ingresados", MsgBoxStyle.Exclamation, "Error") + Exit Sub + Else + + ' TODO Verificar si Persona existe si no preguntar si desea agregarlo + If obtenerID(TextBoxNombre.Text, "Personas") = -1 Then + If (MsgBox("Desea agregar a la Persona:" & TextBoxNombre.Text, MsgBoxStyle.OkCancel, "Agregar Persona") = MsgBoxResult.Ok) Then + ' TODO Insert nueva Persona + + Else + Exit Sub + End If + End If + + ' TODO Verificar si proveedor existe si no preguntar si desea agregarlo + If obtenerID(TextBoxProveedor.Text, "Proveedores") = -1 Then + If (MsgBox("Desea agregar al Proveedor:" & TextBoxProveedor.Text, MsgBoxStyle.OkCancel, "Agregar Proveedor") = MsgBoxResult.Ok) Then + ' TODO Insert nuevo Proveedor + + Else + Exit Sub + End If + End If + + ' TODO Verificar si hay saldo para egreso + + ' Actualizar Egreso + Dim comprobante As String = "" + If TextBoxPVenta.Text = 0 Then + comprobante = TextBoxNroComprobante.Text + Else + comprobante = TextBoxPVenta.Text & "-" & TextBoxNroComprobante.Text + End If + modificar_egreso(idModificando, comprobante, obtenerID(TextBoxProveedor.Text, "Proveedores"), + ComboBoxCategGasto.SelectedValue, obtenerID(TextBoxNombre.Text, "Personas"), DateTimePickerFecha.Value, + ComboBoxTipoComprobante.SelectedValue, ComboBoxSeccional.SelectedValue, DateTimePickerMesReintegro.Value, + CDec(TextBoxMonto.Text), TextBoxComentario.Text) + + idModificando = 0 + + limpiarForm(SplitContainerModificar.Panel2) + activarModificar(False) + CargardDGV(DataGridViewModificar) + + End If + Else + Exit Sub + End If + End Sub + #End Region #Region "Helpers" @@ -126,10 +200,13 @@ Public Class ABMEgresos Dim coleccion As New AutoCompleteStringCollection - Principal.query = "SELECT * FROM " & tabla - consultarNQ(Principal.query, Principal.command) - Principal.adapter = New SqlCeDataAdapter(Principal.command) - Principal.adapter.Fill(Principal.dataset.Tables(tabla)) + 'Principal.query = "SELECT * FROM " & tabla + 'consultarNQ(Principal.query, Principal.command) + 'Principal.adapter = New SqlCeDataAdapter(Principal.command) + 'Principal.adapter.Fill(Principal.dataset.Tables(tabla)) + + Principal.dataset.Tables(tabla).Clear() + cargarTablaEnDataSet(tabla) For Each row As DataRow In Principal.dataset.Tables(tabla).Rows coleccion.Add(Convert.ToString(row.Item(Campo_a_Mostrar))) @@ -139,13 +216,16 @@ Public Class ABMEgresos End Function - Private Function obtenerID(ByVal Campo_a_comparar As String, ByVal tabla As String) + Private Function obtenerID(ByVal Campo_a_comparar As String, ByVal tabla As String) As Integer Dim id As Integer = -1 - Principal.query = "SELECT * FROM " & tabla - consultarNQ(Principal.query, Principal.command) - Principal.adapter = New SqlCeDataAdapter(Principal.command) - Principal.adapter.Fill(Principal.dataset.Tables(tabla)) + 'Principal.query = "SELECT * FROM " & tabla + 'consultarNQ(Principal.query, Principal.command) + 'Principal.adapter = New SqlCeDataAdapter(Principal.command) + 'Principal.adapter.Fill(Principal.dataset.Tables(tabla)) + + Principal.dataset.Tables(tabla).Clear() + cargarTablaEnDataSet(tabla) For Each row As DataRow In Principal.dataset.Tables(tabla).Rows If (LCase(row.Item("nombre")) = LCase(Campo_a_comparar)) Then @@ -153,8 +233,6 @@ Public Class ABMEgresos End If Next - - Return (id) End Function @@ -163,14 +241,14 @@ Public Class ABMEgresos Private Sub activarModificar(ByVal activar As Boolean) If activar Then For Each control As Control In SplitContainerModificar.Panel2.Controls - If TypeOf control Is TextBox Or TypeOf control Is ComboBox Then + If TypeOf control Is TextBox Or TypeOf control Is ComboBox Or TypeOf control Is DateTimePicker Then control.Enabled = True End If Next ButtonGuardar.Enabled = True Else For Each control As Control In SplitContainerModificar.Panel2.Controls - If TypeOf control Is TextBox Or TypeOf control Is ComboBox Then + If TypeOf control Is TextBox Or TypeOf control Is ComboBox Or TypeOf control Is DateTimePicker Then control.Enabled = False End If Next @@ -178,6 +256,26 @@ Public Class ABMEgresos End If End Sub + ' Limpia los campos de todos los controles dentro de un contenedor + Private Sub limpiarForm(ByRef contenedor As Object) + For Each control As Object In contenedor.Controls + ' Limpia los textbox + If TypeOf (control) Is TextBox Then + control.Text = "" + End If + + ' Datetimepicker quedan con la fecha actual + If TypeOf (control) Is DateTimePicker Then + control.Value = Now + End If + + ' Resetea selección en combobox + If TypeOf (control) Is ComboBox Then + control.SelectedItem = "" + End If + Next + End Sub + #End Region #Region "Validaciones" @@ -226,6 +324,40 @@ Public Class ABMEgresos End If End Sub + Private Sub TextBoxNombre_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBoxNombre.Validating + If sender.Text = "" Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un nombre") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If + End Sub + + Private Sub TextBoxProveedor_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBoxProveedor.Validating + If sender.Text = "" Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un nombre") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If + End Sub + + Private Sub TextBoxMonto_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBoxMonto.Validating + If Not IsNumeric(sender.Text) Or IsDBNull(sender.Text) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un valor numérico o 0") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If + End Sub + + Private Sub TextBoxMonto_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBoxMonto.KeyPress + keyverify(e, numeros:=True, comas:=True, puntosAComas:=True) + End Sub + #End Region diff --git a/SireCu/Principal.vb b/SireCu/Principal.vb index ab5b191..5cf416d 100644 --- a/SireCu/Principal.vb +++ b/SireCu/Principal.vb @@ -3,8 +3,8 @@ Public Class Principal Public dataset As New DataSet - Public command As New SqlCeCommand - Public adapter As SqlCeDataAdapter + Public command As New SqlCeCommand() + Public tableadapters As New Dictionary(Of String, SqlCeDataAdapter) Public query As String Private Sub SalirToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SalirToolStripMenuItem.Click @@ -53,15 +53,14 @@ Public Class Principal Private Sub Principal_Load(sender As Object, e As EventArgs) Handles MyBase.Load - 'Tablas - dataset.Tables.Add("Ingresos") - dataset.Tables.Add("Egresos") - dataset.Tables.Add("Saldos") - dataset.Tables.Add("Proveedores") - dataset.Tables.Add("Personas") - dataset.Tables.Add("CategoriasGastos") - dataset.Tables.Add("TiposComprobantes") - dataset.Tables.Add("Seccionales") + 'Cargar Tablas en Dataset + cargarTablaEnDataSet("Ingresos") + cargarTablaEnDataSet("Egresos") + cargarTablaEnDataSet("Proveedores") + cargarTablaEnDataSet("Personas") + cargarTablaEnDataSet("CategoriasGastos") + cargarTablaEnDataSet("TiposComprobantes") + cargarTablaEnDataSet("Seccionales") End Sub From d1f61b40eca98ade8423f018cb3e32a3cfdc9b63 Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 29 Mar 2017 19:52:24 -0300 Subject: [PATCH 05/27] Nuevo Egreso MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cargar nuevo egreso. Validaciones de nuevo egreso. Función de saldo actual modificada. Autocomplete de campos --- SireCu/Clases/Egreso.vb | 17 ++ SireCu/Clases/Ingreso.vb | 4 +- SireCu/Conexion.vb | 23 ++ SireCu/DBSireCu.sdf | Bin 294912 -> 294912 bytes SireCu/OtrasFunciones.vb | 91 +++++--- SireCu/Paneles/ABMEgresos.Designer.vb | 97 ++++---- SireCu/Paneles/ABMEgresos.resx | 48 ---- SireCu/Paneles/ABMEgresos.vb | 306 +++++++++++++++++--------- SireCu/Paneles/Otros_AMB.Designer.vb | 54 +++-- SireCu/Paneles/Otros_AMB.vb | 78 ++++--- SireCu/Principal.Designer.vb | 10 +- SireCu/Principal.vb | 5 + 12 files changed, 437 insertions(+), 296 deletions(-) diff --git a/SireCu/Clases/Egreso.vb b/SireCu/Clases/Egreso.vb index 71cdb36..cb0e317 100644 --- a/SireCu/Clases/Egreso.vb +++ b/SireCu/Clases/Egreso.vb @@ -123,4 +123,21 @@ Module Egreso End Sub + Public Function comprobante_repetido(ByVal nComprobante As String, ByVal proveedorID As Integer) + + cargarTablaEnDataSet("Egresos") + + Dim flag As Boolean = False + + For i = 0 To Principal.dataset.Tables("Egresos").Rows.Count - 1 + If (Principal.dataset.Tables("Egresos").Rows.Item(i).Item("nro_comprobante") = nComprobante) And + (Principal.dataset.Tables("Egresos").Rows.Item(i).Item("proveedor_id") = proveedorID) Then + flag = True + End If + Next + + Return flag + + End Function + End Module diff --git a/SireCu/Clases/Ingreso.vb b/SireCu/Clases/Ingreso.vb index 17393ca..b797569 100644 --- a/SireCu/Clases/Ingreso.vb +++ b/SireCu/Clases/Ingreso.vb @@ -26,7 +26,7 @@ Module Ingreso consultarNQ(Principal.query, Principal.command) Principal.tableadapters("Ingresos") = New SqlCeDataAdapter(Principal.command) - ClearDataset(Principal.dataset) ' TODO limpiar solo tabla a usar + Principal.dataset.Tables("Ingresos").Clear() Principal.tableadapters("Ingresos").Fill(Principal.dataset.Tables("ingresos")) Dim array() As String @@ -50,7 +50,7 @@ Module Ingreso Principal.query = "SELECT * from ingresos where DATEPART(Year, fecha) = '" & año & "'" consultarNQ(Principal.query, Principal.command) - ClearDataset(Principal.dataset) ' TODO limpiar solo tabla a usar + Principal.dataset.Tables("Ingresos").Clear() Principal.tableadapters("Ingresos") = New SqlCeDataAdapter(Principal.command) Principal.tableadapters("Ingresos").Fill(Principal.dataset.Tables("ingresos")) diff --git a/SireCu/Conexion.vb b/SireCu/Conexion.vb index a9980f4..8ee31b7 100644 --- a/SireCu/Conexion.vb +++ b/SireCu/Conexion.vb @@ -56,6 +56,24 @@ Module Conexion Return resultado End Function + 'Function consultarReader(ByVal sql As String) + + ' Dim reader As SqlCeDataReader + ' Dim array As String() + + ' Try + ' conectar() + ' Principal.command.CommandText = sql + ' Principal.command.Connection = conexion + ' reader = Principal.command.ExecuteReader() + ' desconectar() + ' Catch ex As SqlCeException + ' MessageBox.Show(ex.Message) + ' End Try + + ' Return (reader.GetString(0)) + 'End Function + Sub cargarTablaEnDataSet(ByVal tabla As String) Principal.command.Connection = conexion @@ -64,6 +82,8 @@ Module Conexion If Not Principal.dataset.Tables.Contains(tabla) Then Principal.dataset.Tables.Add(tabla) End If + 'Limpiamos la tabla + Principal.dataset.Tables(tabla).Clear() Principal.command.CommandText = "Select * FROM " & tabla @@ -71,7 +91,10 @@ Module Conexion If Not Principal.tableadapters.ContainsKey(tabla) Then Principal.tableadapters.Add(tabla, New SqlCeDataAdapter(Principal.command)) End If + + 'Refrescamos el contenido Principal.tableadapters(tabla).Fill(Principal.dataset.Tables.Item(tabla)) + End Sub diff --git a/SireCu/DBSireCu.sdf b/SireCu/DBSireCu.sdf index 0a5de757bcae920d43cf3975501d236a22b194f7..40a759d52872010acd70a4314d1e5f7080fec44c 100644 GIT binary patch delta 381 zcmZo@5Nc=;;=F!pUn~OeUp&)9)lfb2YG1_p=8hD_qD`@b?VtlVsvu$i|>V3`1;fMj)zk*p+(0RtOY69WSy zl(w5(s3<)#!DiwC4n{D0@&ti7(+wOMIksC&WIVywX27`2fN27!*5w_k(kuxK$`dzA zus(2RaBZ00aGzOZv%-Nx{EQQ}|2@yd9KhLq_7;ymP!SVQ5eHZi!?Jgq1rJ>2XS}fe zuRb$#g1y{*(LZ)94h%q-f`KFp&@C63z-*9*9>5&-ZW#lEfI38xf**u7CGZL-!LU)c;kPRdKPxdWNS0o*p3z1cv&bbCgm;c(8z8y zX*L#9O0tpctVG#T%1*ftr*55l?z!JNpX=7UZoSnWT-rj%M&3%u)J5`9Qim;YR|{vl zys6LAr^!tc8gER$^EbZ_>MuH9RggYN8L>dugTZ+zl`Dm|BZY`WtkK<)*=%N+Ek|?m z9?oa0cWf!x#=f=idYm?hqdd!2Q=XGC1Kzx?mMw>jK{rG-XE7X@@u!u)?+ulSz8zg6 zL|FH0I)*e=y@w07%5KfY)QQh~k-sG%D0$b4w<7nIjOj0qJ))Fh>*0H~x t*n7Of7g+nhr~d_t$_ajbdW}t{?Oj}}j*^oLiD&1fx;#B6w{@qc`vV True - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - \ No newline at end of file diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index e98ff97..61e364e 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -1,4 +1,5 @@ -Imports System.Data.SqlServerCe +Imports System.ComponentModel +Imports System.Data.SqlServerCe Public Class ABMEgresos @@ -7,78 +8,48 @@ Public Class ABMEgresos Dim idModificando As Integer = 0 -#Region "Eventos" - Private Sub ABMEgresos_Load(sender As Object, e As EventArgs) Handles MyBase.Load - ' Tab Agregar - tbNombre.Focus() - 'usamos el año mas grande de la base de datos - tbYear.Text = ultimoaño("Egresos") +#Region "TAB Agregar - Eventos" - tbProveedor.AutoCompleteCustomSource = autocomplete("Proveedores", "nombre") - tbNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") - tbTGasto.AutoCompleteCustomSource = autocomplete("CategoriasGastos", "nombre") - tbTComprobante.AutoCompleteCustomSource = autocomplete("TiposComprobantes", "nombre") + Private Sub btnGuardar_Click(sender As Object, e As EventArgs) Handles btnGuardar.Click - ' Tab Modificar - activarModificar(False) - Egreso.CargardDGV(DataGridViewModificar) - TextBoxNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") - ComboBoxCategGasto.AutoCompleteCustomSource = autocomplete("CategoriasGastos", "nombre") - ComboBoxCategGasto.DataSource = Principal.dataset.Tables("CategoriasGastos") - ComboBoxCategGasto.ValueMember = "id" - ComboBoxCategGasto.DisplayMember = "nombre" - TextBoxProveedor.AutoCompleteCustomSource = autocomplete("Proveedores", "nombre") - DateTimePickerMesReintegro.Value = Now - ComboBoxSeccional.AutoCompleteCustomSource = autocomplete("Seccionales", "nombre") - ComboBoxSeccional.DataSource = Principal.dataset.Tables("Seccionales") - ComboBoxSeccional.ValueMember = "id" - ComboBoxSeccional.DisplayMember = "nombre" - DateTimePickerFecha.Value = Now - ComboBoxTipoComprobante.AutoCompleteCustomSource = autocomplete("TiposComprobantes", "nombre") - ComboBoxTipoComprobante.DataSource = Principal.dataset.Tables("TiposComprobantes") - ComboBoxTipoComprobante.ValueMember = "id" - ComboBoxTipoComprobante.DisplayMember = "nombre" + 'Verificamos que todos los campos hayan pasado las validaciones + If ControlesConErroresAgregar.Count > 0 Then + MsgBox("Por favor revise los campos ingresados", MsgBoxStyle.Exclamation, "Error") + Exit Sub + End If + 'Verificar Saldo Disponible 'OPTIMIZAR TODO + Dim saldo As Double + Select Case tbMonth.Text + Case 1 To 3 + saldo = SaldoActual("Primero", tbYear.Text) + Case 4 To 6 + saldo = SaldoActual("Segundo", tbYear.Text) + Case 7 To 9 + saldo = SaldoActual("Tercero", tbYear.Text) + Case 10 To 12 + saldo = SaldoActual("Cuarto", tbYear.Text) + End Select + + If (saldo < tbMonto.Text) Then + If (MsgBox("Su saldo es insuficiente." & vbCrLf & "Desea guardar de todas formas?", MsgBoxStyle.YesNo, "Saldo Insuficiente") = MsgBoxResult.No) Then + Exit Sub + End If + End If - End Sub + Dim comprobante As String = tbPVenta.Text & "-" & tbNComprobante.Text + Dim fecha As Date = tbDay.Text & "/" & tbMonth.Text & "/" & tbYear.Text + Dim reintegro As Date + If tbReintegro.Text = "" Then + reintegro = fecha + Else reintegro = "01" & "/" & tbReintegro.Text & "/" & tbYear.Text + End If - ' Click en boton Guardar en Tab: Agregar - Private Sub btnGuardar_Click(sender As Object, e As EventArgs) Handles btnGuardar.Click - 'Preguntamos si esta seguro + ' GUARDAR If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Guardar?") = MsgBoxResult.Ok) Then - 'Verificamos que todos los campos hayan pasado las validaciones ' TODO - 'If ControlesConErrores.Count > 0 Then - ' MsgBox("Por favor revise los campos ingresados", MsgBoxStyle.Exclamation, "Error") - ' Exit Sub - 'Else - - 'Verificar Tipo de Gasto válido 'TODO - 'Verificar Fecha válida(y mes de reintegro) 'TODO - Dim fecha As Date = tbDay.Text & "/" & tbMonth.Text & "/" & tbYear.Text - Dim reintegro As Date - If tbReintegro.Text = "" Then - reintegro = fecha - Else reintegro = "01" & "/" & tbMonth.Text & "/" & tbYear.Text - End If - - 'Verificar Comprobante Repetido ' TODO - 'Verificar Saldo Disponible ' TODO - - Dim comprobante As String = tbPVenta.Text & "-" & tbNComprobante.Text - Dim seccional As String - If ckCentral.Checked = True Then - seccional = ckCentral.Text - ElseIf ckLarioja.Checked = True Then - seccional = ckLarioja.Text - Else - MsgBox("Por favor seleccione una seccional", MsgBoxStyle.Exclamation, "Error") - Exit Sub - End If - - ' GUARDAR nuevo_egreso( comprobante, obtenerID(tbProveedor.Text, "Proveedores"), @@ -86,21 +57,28 @@ Public Class ABMEgresos obtenerID(tbNombre.Text, "Personas"), fecha, obtenerID(tbTComprobante.Text, "TiposComprobantes"), - obtenerID(seccional, "Seccionales"), + obtenerID(tbSeccional.Text, "Seccionales"), reintegro, CDbl(tbMonto.Text), tbComentario.Text ) + limpiarForm(TabPageAgregar) + End If - ''Else - 'Exit Sub - 'End If + End Sub + Private Sub tbYear_DoubleClick(sender As Object, e As EventArgs) Handles tbYear.DoubleClick + tbYear.ReadOnly = False + End Sub + Private Sub tbYear_Leave(sender As Object, e As EventArgs) Handles tbYear.Leave + tbYear.ReadOnly = True End Sub +#End Region + +#Region "TAB Modificar - Eventos" - ' Doble click en fila del datagridview en Tab: Modificar Private Sub DataGridViewModificar_CellMouseDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DataGridViewModificar.CellMouseDoubleClick ' Cargar el formulario con los datos para modificar Try @@ -133,9 +111,6 @@ Public Class ABMEgresos activarModificar(True) End Sub - - - ' Click en boton Guardar en Tab: Modificar Private Sub ButtonGuardar_Click(sender As Object, e As EventArgs) Handles ButtonGuardar.Click 'Preguntamos si esta seguro @@ -195,36 +170,54 @@ Public Class ABMEgresos #End Region -#Region "Helpers" - Public Function autocomplete(ByVal tabla As String, ByVal Campo_a_Mostrar As String) +#Region "Eventos" - Dim coleccion As New AutoCompleteStringCollection + Private Sub ABMEgresos_Load(sender As Object, e As EventArgs) Handles MyBase.Load - 'Principal.query = "SELECT * FROM " & tabla - 'consultarNQ(Principal.query, Principal.command) - 'Principal.adapter = New SqlCeDataAdapter(Principal.command) - 'Principal.adapter.Fill(Principal.dataset.Tables(tabla)) + 'TAB Agregar + ' Usamos el año mas grande de la base de datos + tbYear.Text = ultimoaño("Egresos") + ' Colección de Items + addColección(tbTGasto, "CategoriasGastos") + addColección(tbTComprobante, "TiposComprobantes") + addColección(tbSeccional, "Seccionales") + ' Autocomplete al escribir + tbProveedor.AutoCompleteCustomSource = autocomplete("Proveedores", "nombre") + tbNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") + tbTGasto.AutoCompleteCustomSource = autocomplete("CategoriasGastos", "nombre") + tbTComprobante.AutoCompleteCustomSource = autocomplete("TiposComprobantes", "nombre") + tbSeccional.AutoCompleteCustomSource = autocomplete("Seccionales", "nombre") - Principal.dataset.Tables(tabla).Clear() - cargarTablaEnDataSet(tabla) + ' TAB Modificar + activarModificar(False) + Egreso.CargardDGV(DataGridViewModificar) + TextBoxNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") + ComboBoxCategGasto.AutoCompleteCustomSource = autocomplete("CategoriasGastos", "nombre") + ComboBoxCategGasto.DataSource = Principal.dataset.Tables("CategoriasGastos") + ComboBoxCategGasto.ValueMember = "id" + ComboBoxCategGasto.DisplayMember = "nombre" + TextBoxProveedor.AutoCompleteCustomSource = autocomplete("Proveedores", "nombre") + DateTimePickerMesReintegro.Value = Now + ComboBoxSeccional.AutoCompleteCustomSource = autocomplete("Seccionales", "nombre") + ComboBoxSeccional.DataSource = Principal.dataset.Tables("Seccionales") + ComboBoxSeccional.ValueMember = "id" + ComboBoxSeccional.DisplayMember = "nombre" + DateTimePickerFecha.Value = Now + ComboBoxTipoComprobante.AutoCompleteCustomSource = autocomplete("TiposComprobantes", "nombre") + ComboBoxTipoComprobante.DataSource = Principal.dataset.Tables("TiposComprobantes") + ComboBoxTipoComprobante.ValueMember = "id" + ComboBoxTipoComprobante.DisplayMember = "nombre" - For Each row As DataRow In Principal.dataset.Tables(tabla).Rows - coleccion.Add(Convert.ToString(row.Item(Campo_a_Mostrar))) - Next - Return (coleccion) + End Sub - End Function +#End Region + +#Region "Helpers" Private Function obtenerID(ByVal Campo_a_comparar As String, ByVal tabla As String) As Integer Dim id As Integer = -1 - 'Principal.query = "SELECT * FROM " & tabla - 'consultarNQ(Principal.query, Principal.command) - 'Principal.adapter = New SqlCeDataAdapter(Principal.command) - 'Principal.adapter.Fill(Principal.dataset.Tables(tabla)) - - Principal.dataset.Tables(tabla).Clear() cargarTablaEnDataSet(tabla) For Each row As DataRow In Principal.dataset.Tables(tabla).Rows @@ -272,13 +265,14 @@ Public Class ABMEgresos ' Resetea selección en combobox If TypeOf (control) Is ComboBox Then control.SelectedItem = "" + control.text = "" End If Next End Sub #End Region -#Region "Validaciones" +#Region "Validaciones TAB Agregar" Private Sub tbDay_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbDay.KeyPress keyverify(e, numeros:=True) @@ -296,7 +290,7 @@ Public Class ABMEgresos keyverify(e, numeros:=True) End Sub Private Sub tbNombre_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbNombre.KeyPress - keyverify(e, letras:=True, numeros:=True) + keyverify(e, letras:=True, numeros:=True, espacios:=True) End Sub Private Sub tbProveedor_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbProveedor.KeyPress keyverify(e, letras:=True, numeros:=True) @@ -305,24 +299,127 @@ Public Class ABMEgresos keyverify(e, numeros:=True) End Sub Private Sub tbReintegro_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbReintegro.KeyPress - keyverify(e, letras:=True) + keyverify(e, numeros:=True) End Sub Private Sub tbTComprobante_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbTComprobante.KeyPress - keyverify(e, letras:=True) + keyverify(e, letras:=True, espacios:=True) End Sub Private Sub tbYear_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbYear.KeyPress keyverify(e, numeros:=True) + If e.KeyChar = ChrW(Keys.Enter) Then + tbYear.ReadOnly = True + tbTGasto.Focus() + End If + End Sub + Private Sub tbSeccional_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbSeccional.KeyPress + keyverify(e, letras:=True, numeros:=True, espacios:=True) + End Sub + + Private Sub tbNombre_Validating(sender As Object, e As CancelEventArgs) Handles tbNombre.Validating + If (sender.Text = "") Or (exist("Personas", "nombre", sender.text) = False) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar una Persona correcta." & vbCrLf & + "Puede agregar una nueva en el menú Editar") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If + End Sub + Private Sub tbTGasto_Validating(sender As Object, e As CancelEventArgs) Handles tbTGasto.Validating + If (sender.Text = "") Or (exist("CategoriasGastos", "nombre", sender.text) = False) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar una Categoría correcta." & vbCrLf & + "Puede agregar una nueva en el menú Editar") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If + End Sub + Private Sub tbProveedor_Validating(sender As Object, e As CancelEventArgs) Handles tbProveedor.Validating + If (sender.Text = "") Or (exist("Proveedores", "nombre", sender.text) = False) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un Proveedor correcto." & vbCrLf & + "Puede agregar uno nuevo en el menú Editar") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If End Sub - Private Sub ckCentral_CheckedChanged(sender As Object, e As EventArgs) Handles ckCentral.CheckedChanged - If ckLarioja.Checked = True Then - ckCentral.Checked = False + Private Sub tbTComprobante_Validating(sender As Object, e As CancelEventArgs) Handles tbTComprobante.Validating + If (sender.Text = "") Or (exist("TiposComprobantes", "nombre", sender.text) = False) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un Tipo de Comprobante correcto." & vbCrLf & + "Puede agregar uno nuevo en el menú Editar") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) End If End Sub - Private Sub ckLarioja_CheckedChanged(sender As Object, e As EventArgs) Handles ckLarioja.CheckedChanged - If ckCentral.Checked = True Then - ckLarioja.Checked = False + Private Sub tbMonto_Validating(sender As Object, e As CancelEventArgs) Handles tbMonto.Validating + If Not IsNumeric(sender.Text) Or IsDBNull(sender.Text) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un valor numérico o cero") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) End If End Sub + Private Sub tbReintegro_Validating(sender As Object, e As CancelEventArgs) Handles tbReintegro.Validating + If sender.text = "" Then + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + Exit Sub + End If + + If (CDbl(sender.Text) < 1) Or (CDbl(sender.Text) > 12) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un mes de reintegro válido") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If + End Sub + Private Sub tbSeccional_Validating(sender As Object, e As CancelEventArgs) Handles tbSeccional.Validating + If (sender.Text = "") Or (exist("Seccionales", "nombre", sender.text) = False) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar una Seccional correcta." & vbCrLf & + "Puede agregar una nueva en el menú Editar") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If + End Sub + Private Sub tbNComprobante_Validating(sender As Object, e As CancelEventArgs) Handles tbNComprobante.Validating + If (sender.text = "") Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar número de comprobante") + ControlesConErroresModificar.Add(sender) + Exit Sub + ElseIf (obtenerID(tbProveedor.Text, "Proveedores") = -1) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un Proveedor correcto." & vbCrLf & + "Puede agregar uno nuevo en el menú Editar") + ControlesConErroresModificar.Add(sender) + Exit Sub + ElseIf (comprobante_repetido(tbPVenta.Text & "-" & tbNComprobante.Text, obtenerID(tbProveedor.Text, "Proveedores"))) Then + Principal.ErrorProvider.SetError(sender, "Ese comprobante ya fué cargado para ese Proveedor") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If + End Sub + Private Sub tbYear_Validating(sender As Object, e As CancelEventArgs) Handles tbYear.Validating + If Not IsNumeric(sender.Text) Or IsDBNull(sender.Text) Or (tbYear.Text = "") Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un Año válido") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If + End Sub + +#End Region + +#Region "Validaciones TAB Modificar" Private Sub TextBoxNombre_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBoxNombre.Validating If sender.Text = "" Then @@ -358,7 +455,10 @@ Public Class ABMEgresos keyverify(e, numeros:=True, comas:=True, puntosAComas:=True) End Sub -#End Region + + +#End Region + End Class \ No newline at end of file diff --git a/SireCu/Paneles/Otros_AMB.Designer.vb b/SireCu/Paneles/Otros_AMB.Designer.vb index 8c36195..1a50bc5 100644 --- a/SireCu/Paneles/Otros_AMB.Designer.vb +++ b/SireCu/Paneles/Otros_AMB.Designer.vb @@ -24,11 +24,12 @@ Partial Class Otros_AMB Private Sub InitializeComponent() Me.SplitContainer1 = New System.Windows.Forms.SplitContainer() Me.dgv_otros = New System.Windows.Forms.DataGridView() + Me.Label1 = New System.Windows.Forms.Label() + Me.btn_Eliminar = New System.Windows.Forms.Button() Me.tb_editar = New System.Windows.Forms.TextBox() Me.btn_Cancelar = New System.Windows.Forms.Button() Me.cb_tabla = New System.Windows.Forms.ComboBox() Me.btn_Guardar = New System.Windows.Forms.Button() - Me.btn_Eliminar = New System.Windows.Forms.Button() CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainer1.Panel1.SuspendLayout() Me.SplitContainer1.Panel2.SuspendLayout() @@ -48,13 +49,14 @@ Partial Class Otros_AMB ' 'SplitContainer1.Panel2 ' + Me.SplitContainer1.Panel2.Controls.Add(Me.Label1) Me.SplitContainer1.Panel2.Controls.Add(Me.btn_Eliminar) Me.SplitContainer1.Panel2.Controls.Add(Me.tb_editar) Me.SplitContainer1.Panel2.Controls.Add(Me.btn_Cancelar) Me.SplitContainer1.Panel2.Controls.Add(Me.cb_tabla) Me.SplitContainer1.Panel2.Controls.Add(Me.btn_Guardar) - Me.SplitContainer1.Size = New System.Drawing.Size(381, 201) - Me.SplitContainer1.SplitterDistance = 226 + Me.SplitContainer1.Size = New System.Drawing.Size(387, 201) + Me.SplitContainer1.SplitterDistance = 229 Me.SplitContainer1.TabIndex = 0 ' 'dgv_otros @@ -68,59 +70,74 @@ Partial Class Otros_AMB Me.dgv_otros.MultiSelect = False Me.dgv_otros.Name = "dgv_otros" Me.dgv_otros.ReadOnly = True - Me.dgv_otros.Size = New System.Drawing.Size(226, 201) + Me.dgv_otros.Size = New System.Drawing.Size(229, 201) Me.dgv_otros.TabIndex = 0 ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(53, 53) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(44, 13) + Me.Label1.TabIndex = 7 + Me.Label1.Text = "Nombre" + ' + 'btn_Eliminar + ' + Me.btn_Eliminar.Location = New System.Drawing.Point(78, 108) + Me.btn_Eliminar.Name = "btn_Eliminar" + Me.btn_Eliminar.Size = New System.Drawing.Size(64, 36) + Me.btn_Eliminar.TabIndex = 6 + Me.btn_Eliminar.TabStop = False + Me.btn_Eliminar.Text = "Eliminar" + Me.btn_Eliminar.UseVisualStyleBackColor = True + ' 'tb_editar ' + Me.tb_editar.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.tb_editar.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource Me.tb_editar.Location = New System.Drawing.Point(8, 69) Me.tb_editar.Name = "tb_editar" Me.tb_editar.Size = New System.Drawing.Size(131, 20) - Me.tb_editar.TabIndex = 5 + Me.tb_editar.TabIndex = 2 ' 'btn_Cancelar ' + Me.btn_Cancelar.Enabled = False Me.btn_Cancelar.Location = New System.Drawing.Point(41, 166) Me.btn_Cancelar.Name = "btn_Cancelar" Me.btn_Cancelar.Size = New System.Drawing.Size(75, 23) Me.btn_Cancelar.TabIndex = 4 + Me.btn_Cancelar.TabStop = False Me.btn_Cancelar.Text = "Cancelar" Me.btn_Cancelar.UseVisualStyleBackColor = True ' 'cb_tabla ' + Me.cb_tabla.AutoCompleteCustomSource.AddRange(New String() {"Proveedor", "Tipo de Comprobante", "Tipo de Gasto", "Persona", "Seccional"}) Me.cb_tabla.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend Me.cb_tabla.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems Me.cb_tabla.FormattingEnabled = True - Me.cb_tabla.Items.AddRange(New Object() {"Proveedor", "Tipo de Comprobante", "Tipo de Gasto", "Persona"}) + Me.cb_tabla.Items.AddRange(New Object() {"Proveedor", "Tipo de Comprobante", "Tipo de Gasto", "Persona", "Seccional"}) Me.cb_tabla.Location = New System.Drawing.Point(8, 19) Me.cb_tabla.Name = "cb_tabla" Me.cb_tabla.Size = New System.Drawing.Size(131, 21) - Me.cb_tabla.TabIndex = 3 + Me.cb_tabla.TabIndex = 1 ' 'btn_Guardar ' Me.btn_Guardar.Location = New System.Drawing.Point(8, 108) Me.btn_Guardar.Name = "btn_Guardar" Me.btn_Guardar.Size = New System.Drawing.Size(64, 36) - Me.btn_Guardar.TabIndex = 0 + Me.btn_Guardar.TabIndex = 3 Me.btn_Guardar.Text = "Guardar Nuevo" Me.btn_Guardar.UseVisualStyleBackColor = True ' - 'btn_Eliminar - ' - Me.btn_Eliminar.Location = New System.Drawing.Point(78, 108) - Me.btn_Eliminar.Name = "btn_Eliminar" - Me.btn_Eliminar.Size = New System.Drawing.Size(64, 36) - Me.btn_Eliminar.TabIndex = 6 - Me.btn_Eliminar.Text = "Eliminar" - Me.btn_Eliminar.UseVisualStyleBackColor = True - ' 'Otros_AMB ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(381, 201) + Me.ClientSize = New System.Drawing.Size(387, 201) Me.Controls.Add(Me.SplitContainer1) Me.MaximizeBox = False Me.MinimizeBox = False @@ -144,4 +161,5 @@ Partial Class Otros_AMB Friend WithEvents btn_Cancelar As Button Friend WithEvents tb_editar As TextBox Friend WithEvents btn_Eliminar As Button + Friend WithEvents Label1 As Label End Class diff --git a/SireCu/Paneles/Otros_AMB.vb b/SireCu/Paneles/Otros_AMB.vb index 9093ca8..b4b4459 100644 --- a/SireCu/Paneles/Otros_AMB.vb +++ b/SireCu/Paneles/Otros_AMB.vb @@ -2,30 +2,25 @@ Public Class Otros_AMB - Public tabla As String + Dim tabla As String + Dim ControlesConErrores As List(Of Control) = New List(Of Control) #Region "Botones" Private Sub btn_Cancelar_Click(sender As Object, e As EventArgs) Handles btn_Cancelar.Click dgv_otros.Enabled = True tb_editar.Text = "" cb_tabla.Enabled = True - btn_Guardar.Text = "Guardar" & vbCrLf & "Nuevo" + btn_Cancelar.Enabled = False + btn_Guardar.Text = "Guardar Nuevo" End Sub Private Sub btn_Guardar_Click(sender As Object, e As EventArgs) Handles btn_Guardar.Click - 'Verificación de tabla correcta - If (verificarTabla() = 0) Then - MsgBox("Por favor, seleccione una opción correcta", MsgBoxStyle.Exclamation, "Error") + ' Verificamos que todos los campos hayan pasado las validaciones + If ControlesConErrores.Count > 0 Then + MsgBox("Por favor revise los campos ingresados", MsgBoxStyle.Exclamation, "Error") Exit Sub End If - 'Verificacion de campos vacios - If (tb_editar.Text = "") Or (cb_tabla.Text = "") Then - MsgBox("Por favor, complete todos los campos", MsgBoxStyle.Exclamation, "Error") - Exit Sub - End If - - If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Guardar?") = MsgBoxResult.Ok) Then If (btn_Guardar.Text = "Guardar Nuevo") Then @@ -55,6 +50,9 @@ Public Class Otros_AMB MsgBox("Guardado Correctamente!", MsgBoxStyle.Information, "Guardado") tb_editar.Text = "" + btn_Cancelar.Enabled = False + + 'Actualizamos el Autocomplete de campos y el DataGridview actualizar() End If @@ -68,8 +66,8 @@ Public Class Otros_AMB Exit Sub End If - If (verificarTabla() = 0) Then - MsgBox("Por favor, seleccione una opción correcta", MsgBoxStyle.Exclamation, "Error") + If ControlesConErrores.Count > 0 Then + MsgBox("Por favor revise los campos ingresados", MsgBoxStyle.Exclamation, "Error") Exit Sub End If @@ -96,43 +94,40 @@ Public Class Otros_AMB dgv_otros.Enabled = False cb_tabla.Enabled = False btn_Guardar.Text = "Actualizar" + btn_Cancelar.Enabled = True End Sub Private Sub Otros_AMB_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing dgv_otros.DataSource = Nothing End Sub Private Sub cb_tabla_TextChanged(sender As Object, e As EventArgs) Handles cb_tabla.TextChanged actualizar() + + 'Sacamos el TB de la lista de errores + Principal.ErrorProvider.SetError(tb_editar, "") + ControlesConErrores.Remove(tb_editar) End Sub Private Sub actualizar() Select Case cb_tabla.Text Case "Proveedor" + tabla = "Proveedores" abm_otros("Proveedores") Case "Tipo de Comprobante" + tabla = "TiposComprobantes" abm_otros("TiposComprobantes") Case "Tipo de Gasto" + tabla = "CategoriasGastos" abm_otros("CategoriasGastos") Case "Persona" + tabla = "Personas" abm_otros("Personas") + Case "Seccional" + tabla = "Seccionales" + abm_otros("Seccionales") End Select End Sub Private Sub Otros_AMB_Load(sender As Object, e As EventArgs) Handles MyBase.Load - Select Case cb_tabla.Text - Case "Proveedor" - tabla = "Proveedores" - Case "Tipo de Comprobante" - tabla = "TiposComprobantes" - Case "Tipo de Gasto" - tabla = "CategoriasGastos" - Case "Persona" - tabla = "Personas" - End Select + actualizar() End Sub - Private Function verificarTabla() - If (tabla <> "Proveedores") And (tabla <> "TiposComprobantes") And (tabla <> "CategoriasGastos") And (tabla <> "Personas") Then - Return (0) - Else Return (1) - End If - End Function #End Region #Region "Validaciones" @@ -142,6 +137,29 @@ Public Class Otros_AMB Private Sub tb_editar_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tb_editar.KeyPress keyverify(e, letras:=True, espacios:=True) End Sub + + Private Sub cb_tabla_Validating(sender As Object, e As CancelEventArgs) Handles cb_tabla.Validating + If (cb_tabla.Text <> "Proveedor") And (cb_tabla.Text <> "Tipo de Comprobante") And + (cb_tabla.Text <> "Tipo de Gasto") And (cb_tabla.Text <> "Persona") And (cb_tabla.Text <> "Seccional") Or + IsDBNull(sender.Text) Or (cb_tabla.Text = "") Then + + Principal.ErrorProvider.SetError(sender, "Debe ingresar una opción válida") + ControlesConErrores.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErrores.Remove(sender) + End If + End Sub + Private Sub tb_editar_Validating(sender As Object, e As CancelEventArgs) Handles tb_editar.Validating + If IsDBNull(sender.Text) Or (tb_editar.Text = "") Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un nombre válido") + ControlesConErrores.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErrores.Remove(sender) + End If + End Sub + #End Region End Class \ No newline at end of file diff --git a/SireCu/Principal.Designer.vb b/SireCu/Principal.Designer.vb index 47972b5..1f3a911 100644 --- a/SireCu/Principal.Designer.vb +++ b/SireCu/Principal.Designer.vb @@ -40,6 +40,7 @@ Partial Class Principal Me.CategoríasDeGastosToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.PersonasToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ErrorProvider = New System.Windows.Forms.ErrorProvider(Me.components) + Me.SeccionalesToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripContainerPrincipal.BottomToolStripPanel.SuspendLayout() Me.ToolStripContainerPrincipal.ContentPanel.SuspendLayout() Me.ToolStripContainerPrincipal.TopToolStripPanel.SuspendLayout() @@ -172,7 +173,7 @@ Partial Class Principal ' 'EditarToolStripMenuItem ' - Me.EditarToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ProveedoresToolStripMenuItem, Me.TiposDeGastosToolStripMenuItem, Me.CategoríasDeGastosToolStripMenuItem, Me.PersonasToolStripMenuItem}) + Me.EditarToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ProveedoresToolStripMenuItem, Me.TiposDeGastosToolStripMenuItem, Me.CategoríasDeGastosToolStripMenuItem, Me.PersonasToolStripMenuItem, Me.SeccionalesToolStripMenuItem}) Me.EditarToolStripMenuItem.Name = "EditarToolStripMenuItem" Me.EditarToolStripMenuItem.Size = New System.Drawing.Size(49, 20) Me.EditarToolStripMenuItem.Text = "Editar" @@ -205,6 +206,12 @@ Partial Class Principal ' Me.ErrorProvider.ContainerControl = Me ' + 'SeccionalesToolStripMenuItem + ' + Me.SeccionalesToolStripMenuItem.Name = "SeccionalesToolStripMenuItem" + Me.SeccionalesToolStripMenuItem.Size = New System.Drawing.Size(201, 22) + Me.SeccionalesToolStripMenuItem.Text = "Seccionales" + ' 'Principal ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -251,4 +258,5 @@ Partial Class Principal Friend WithEvents TiposDeGastosToolStripMenuItem As ToolStripMenuItem Friend WithEvents CategoríasDeGastosToolStripMenuItem As ToolStripMenuItem Friend WithEvents PersonasToolStripMenuItem As ToolStripMenuItem + Friend WithEvents SeccionalesToolStripMenuItem As ToolStripMenuItem End Class diff --git a/SireCu/Principal.vb b/SireCu/Principal.vb index 5cf416d..e2f8b4e 100644 --- a/SireCu/Principal.vb +++ b/SireCu/Principal.vb @@ -83,4 +83,9 @@ Public Class Principal Otros_AMB.cb_tabla.Text = "Persona" Otros_AMB.ShowDialog() End Sub + + Private Sub SeccionalesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SeccionalesToolStripMenuItem.Click + Otros_AMB.cb_tabla.Text = "Seccional" + Otros_AMB.ShowDialog() + End Sub End Class From 9741db0294f39a93df5fab3106cbbcc703c15fb5 Mon Sep 17 00:00:00 2001 From: Javier Date: Sat, 1 Apr 2017 12:11:08 -0300 Subject: [PATCH 06/27] Modificar Egresos Modificar egresos con sus validaciones --- SireCu/Clases/Egreso.vb | 29 ++-- SireCu/Conexion.vb | 33 +++-- SireCu/OtrasFunciones.vb | 23 ---- SireCu/Paneles/ABMEgresos.vb | 259 +++++++++++++++++++++++++---------- SireCu/Paneles/Otros_AMB.vb | 12 ++ 5 files changed, 227 insertions(+), 129 deletions(-) diff --git a/SireCu/Clases/Egreso.vb b/SireCu/Clases/Egreso.vb index cb0e317..4ae3a5e 100644 --- a/SireCu/Clases/Egreso.vb +++ b/SireCu/Clases/Egreso.vb @@ -56,16 +56,16 @@ Module Egreso End Sub - Public Function mostrar_egreso() - Throw New NotImplementedException() - End Function - Public Sub CargardDGV(ByRef dgv As DataGridView) - Dim con = New SqlCeConnection(My.Settings.CadenaConexion) - If con.State = ConnectionState.Closed Then - con.Open() + + 'Creamos la tabla si no existe + If Not Principal.dataset.Tables.Contains("Egresos_Modificar") Then + Principal.dataset.Tables.Add("Egresos_Modificar") End If + 'Limpiamos la tabla + Principal.dataset.Tables("Egresos_Modificar").Clear() + 'Creamos el query Principal.command.CommandText = "SELECT E.id AS id, E.nro_comprobante AS nro_comprobante, E.tipo_comprobante_id AS tipo_comprobante_id, @@ -88,14 +88,16 @@ Module Egreso LEFT JOIN CategoriasGastos AS Gastos ON E.categoria_gasto_id = Gastos.id LEFT JOIN Personas AS Per ON E.persona_id = Per.id LEFT JOIN Seccionales AS Secc ON E.seccional_id = Secc.id" - Principal.command.Connection = con - Dim tableadapter = New SqlCeDataAdapter(Principal.command) - If Principal.dataset.Tables.Contains("Egresos_Modificar") Then - Principal.dataset.Tables("Egresos_Modificar").Clear() + 'Creamos el TableAdapter si no existe + If Not Principal.tableadapters.ContainsKey("Egresos_Modificar") Then + Principal.tableadapters.Add("Egresos_Modificar", New SqlCeDataAdapter(Principal.command)) End If - tableadapter.Fill(Principal.dataset, "Egresos_Modificar") + 'Actualizamos el contenido de la tabla + Principal.tableadapters("Egresos_Modificar").Fill(Principal.dataset.Tables.Item("Egresos_Modificar")) + + 'Asignamos el Bind Dim mybinding = New BindingSource(Principal.dataset, "Egresos_Modificar") dgv.AutoGenerateColumns = False @@ -118,9 +120,6 @@ Module Egreso dgv.Columns.Item("comentario").DataPropertyName = "comentario" dgv.DataSource = mybinding - - - End Sub Public Function comprobante_repetido(ByVal nComprobante As String, ByVal proveedorID As Integer) diff --git a/SireCu/Conexion.vb b/SireCu/Conexion.vb index 8ee31b7..ece0cf9 100644 --- a/SireCu/Conexion.vb +++ b/SireCu/Conexion.vb @@ -56,23 +56,22 @@ Module Conexion Return resultado End Function - 'Function consultarReader(ByVal sql As String) - - ' Dim reader As SqlCeDataReader - ' Dim array As String() - - ' Try - ' conectar() - ' Principal.command.CommandText = sql - ' Principal.command.Connection = conexion - ' reader = Principal.command.ExecuteReader() - ' desconectar() - ' Catch ex As SqlCeException - ' MessageBox.Show(ex.Message) - ' End Try - - ' Return (reader.GetString(0)) - 'End Function + Function consultarReader(ByVal sql As String) + + Dim reader As SqlCeDataReader + + Try + conectar() + Principal.command.CommandText = sql + Principal.command.Connection = conexion + reader = Principal.command.ExecuteReader() + desconectar() + Catch ex As SqlCeException + MessageBox.Show(ex.Message) + End Try + + Return (reader.GetString(0)) + End Function Sub cargarTablaEnDataSet(ByVal tabla As String) diff --git a/SireCu/OtrasFunciones.vb b/SireCu/OtrasFunciones.vb index 290abfb..6028c82 100644 --- a/SireCu/OtrasFunciones.vb +++ b/SireCu/OtrasFunciones.vb @@ -131,19 +131,6 @@ Module OtrasFunciones End Function - Public Sub abm_otros(ByVal tabla As String) - - cargarTablaEnDataSet(tabla) - - Dim bindSource As New BindingSource - bindSource.DataSource = Principal.dataset.Tables(tabla) - Otros_AMB.dgv_otros.DataSource = bindSource - Otros_AMB.dgv_otros.Columns.Item("id").Visible = False - - Otros_AMB.tb_editar.AutoCompleteCustomSource = autocomplete(tabla, "nombre") - - End Sub - Public Function exist(ByVal tabla As String, ByVal campo As String, ByVal comparar As String) cargarTablaEnDataSet(tabla) @@ -174,14 +161,4 @@ Module OtrasFunciones End Function - Public Sub addColección(ByRef combobox As ComboBox, ByVal tabla As String) - - cargarTablaEnDataSet(tabla) - - For Each row As DataRow In Principal.dataset.Tables(tabla).Rows - combobox.Items.Add((Convert.ToString(row.Item("nombre")))) - Next - - End Sub - End Module diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index 61e364e..e723bf2 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -38,7 +38,12 @@ Public Class ABMEgresos End If End If - Dim comprobante As String = tbPVenta.Text & "-" & tbNComprobante.Text + Dim comprobante As String + If (tbPVenta.Text = 0) Or (tbPVenta.Text = "") Then + comprobante = tbNComprobante.Text + Else + comprobante = tbPVenta.Text & "-" & tbNComprobante.Text + End If Dim fecha As Date = tbDay.Text & "/" & tbMonth.Text & "/" & tbYear.Text Dim reintegro As Date If tbReintegro.Text = "" Then @@ -113,59 +118,68 @@ Public Class ABMEgresos End Sub Private Sub ButtonGuardar_Click(sender As Object, e As EventArgs) Handles ButtonGuardar.Click - 'Preguntamos si esta seguro - If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Guardar?") = MsgBoxResult.Ok) Then - - ' Verificamos que todos los campos hayan pasado las validaciones - If ControlesConErroresModificar.Count > 0 Then - MsgBox("Por favor revise los campos ingresados", MsgBoxStyle.Exclamation, "Error") - Exit Sub - Else - - ' TODO Verificar si Persona existe si no preguntar si desea agregarlo - If obtenerID(TextBoxNombre.Text, "Personas") = -1 Then - If (MsgBox("Desea agregar a la Persona:" & TextBoxNombre.Text, MsgBoxStyle.OkCancel, "Agregar Persona") = MsgBoxResult.Ok) Then - ' TODO Insert nueva Persona - - Else - Exit Sub - End If - End If + 'Verificamos que todos los campos hayan pasado las validaciones + If ControlesConErroresModificar.Count > 0 Then + MsgBox("Por favor revise los campos ingresados", MsgBoxStyle.Exclamation, "Error") + Exit Sub + End If - ' TODO Verificar si proveedor existe si no preguntar si desea agregarlo - If obtenerID(TextBoxProveedor.Text, "Proveedores") = -1 Then - If (MsgBox("Desea agregar al Proveedor:" & TextBoxProveedor.Text, MsgBoxStyle.OkCancel, "Agregar Proveedor") = MsgBoxResult.Ok) Then - ' TODO Insert nuevo Proveedor + 'Verificar Saldo Disponible 'OPTIMIZAR TODO + Dim saldo As Double + Select Case DatePart(DateInterval.Month, DateTimePickerFecha.Value) + Case 1 To 3 + saldo = SaldoActual("Primero", DatePart(DateInterval.Year, DateTimePickerFecha.Value)) + Case 4 To 6 + saldo = SaldoActual("Segundo", DatePart(DateInterval.Year, DateTimePickerFecha.Value)) + Case 7 To 9 + saldo = SaldoActual("Tercero", DatePart(DateInterval.Year, DateTimePickerFecha.Value)) + Case 10 To 12 + saldo = SaldoActual("Cuarto", DatePart(DateInterval.Year, DateTimePickerFecha.Value)) + End Select - Else - Exit Sub - End If - End If + If (saldo < TextBoxMonto.Text) Then + If (MsgBox("Su saldo es insuficiente." & vbCrLf & "Desea guardar de todas formas?", MsgBoxStyle.YesNo, "Saldo Insuficiente") = MsgBoxResult.No) Then + Exit Sub + End If + End If - ' TODO Verificar si hay saldo para egreso + Dim comprobante As String + If (TextBoxPVenta.Text = 0) Or (tbPVenta.Text = "") Then + comprobante = TextBoxNroComprobante.Text + Else + comprobante = TextBoxPVenta.Text & "-" & TextBoxNroComprobante.Text + End If + Dim reintegro As Date + If tbReintegro.Text = "" Then + reintegro = DateTimePickerFecha.Value + Else reintegro = DateTimePickerMesReintegro.Value + End If - ' Actualizar Egreso - Dim comprobante As String = "" - If TextBoxPVenta.Text = 0 Then - comprobante = TextBoxNroComprobante.Text - Else - comprobante = TextBoxPVenta.Text & "-" & TextBoxNroComprobante.Text - End If - modificar_egreso(idModificando, comprobante, obtenerID(TextBoxProveedor.Text, "Proveedores"), - ComboBoxCategGasto.SelectedValue, obtenerID(TextBoxNombre.Text, "Personas"), DateTimePickerFecha.Value, - ComboBoxTipoComprobante.SelectedValue, ComboBoxSeccional.SelectedValue, DateTimePickerMesReintegro.Value, - CDec(TextBoxMonto.Text), TextBoxComentario.Text) - idModificando = 0 + ' MODIFICAR + If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Guardar?") = MsgBoxResult.Ok) Then - limpiarForm(SplitContainerModificar.Panel2) - activarModificar(False) - CargardDGV(DataGridViewModificar) + modificar_egreso( + idModificando, + comprobante, + obtenerID(TextBoxProveedor.Text, "Proveedores"), + ComboBoxCategGasto.SelectedValue, + obtenerID(TextBoxNombre.Text, "Personas"), + DateTimePickerFecha.Value, + ComboBoxTipoComprobante.SelectedValue, + ComboBoxSeccional.SelectedValue, + DateTimePickerMesReintegro.Value, + CDec(TextBoxMonto.Text), + TextBoxComentario.Text + ) + + idModificando = 0 + limpiarForm(SplitContainerModificar.Panel2) + activarModificar(False) + CargardDGV(DataGridViewModificar) - End If - Else - Exit Sub End If + End Sub #End Region @@ -174,39 +188,53 @@ Public Class ABMEgresos Private Sub ABMEgresos_Load(sender As Object, e As EventArgs) Handles MyBase.Load - 'TAB Agregar + ' ######################################## TAB Agregar + ' Usamos el año mas grande de la base de datos tbYear.Text = ultimoaño("Egresos") - ' Colección de Items - addColección(tbTGasto, "CategoriasGastos") - addColección(tbTComprobante, "TiposComprobantes") - addColección(tbSeccional, "Seccionales") ' Autocomplete al escribir tbProveedor.AutoCompleteCustomSource = autocomplete("Proveedores", "nombre") tbNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") tbTGasto.AutoCompleteCustomSource = autocomplete("CategoriasGastos", "nombre") tbTComprobante.AutoCompleteCustomSource = autocomplete("TiposComprobantes", "nombre") tbSeccional.AutoCompleteCustomSource = autocomplete("Seccionales", "nombre") + ' Colección de Items + tbTGasto.DataSource = Principal.dataset.Tables("CategoriasGastos") + tbTComprobante.DataSource = Principal.dataset.Tables("TiposComprobantes") + tbSeccional.DataSource = Principal.dataset.Tables("Seccionales") + tbTGasto.ValueMember = "id" + tbTGasto.DisplayMember = "nombre" + tbTComprobante.ValueMember = "id" + tbTComprobante.DisplayMember = "nombre" + tbSeccional.ValueMember = "id" + tbSeccional.DisplayMember = "nombre" + + + ' ######################################## TAB Modificar - ' TAB Modificar activarModificar(False) - Egreso.CargardDGV(DataGridViewModificar) + CargardDGV(DataGridViewModificar) + + ' Autocomplete al escribir TextBoxNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") ComboBoxCategGasto.AutoCompleteCustomSource = autocomplete("CategoriasGastos", "nombre") - ComboBoxCategGasto.DataSource = Principal.dataset.Tables("CategoriasGastos") - ComboBoxCategGasto.ValueMember = "id" - ComboBoxCategGasto.DisplayMember = "nombre" TextBoxProveedor.AutoCompleteCustomSource = autocomplete("Proveedores", "nombre") - DateTimePickerMesReintegro.Value = Now ComboBoxSeccional.AutoCompleteCustomSource = autocomplete("Seccionales", "nombre") + ComboBoxTipoComprobante.AutoCompleteCustomSource = autocomplete("TiposComprobantes", "nombre") + ' Colección de Items + ComboBoxCategGasto.DataSource = Principal.dataset.Tables("CategoriasGastos") ComboBoxSeccional.DataSource = Principal.dataset.Tables("Seccionales") + ComboBoxTipoComprobante.DataSource = Principal.dataset.Tables("TiposComprobantes") + ComboBoxCategGasto.ValueMember = "id" + ComboBoxCategGasto.DisplayMember = "nombre" ComboBoxSeccional.ValueMember = "id" ComboBoxSeccional.DisplayMember = "nombre" - DateTimePickerFecha.Value = Now - ComboBoxTipoComprobante.AutoCompleteCustomSource = autocomplete("TiposComprobantes", "nombre") - ComboBoxTipoComprobante.DataSource = Principal.dataset.Tables("TiposComprobantes") ComboBoxTipoComprobante.ValueMember = "id" ComboBoxTipoComprobante.DisplayMember = "nombre" + ' Setup Panel + DateTimePickerMesReintegro.Value = Now + DateTimePickerFecha.Value = Now + End Sub @@ -274,6 +302,7 @@ Public Class ABMEgresos #Region "Validaciones TAB Agregar" + 'Keypress Private Sub tbDay_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbDay.KeyPress keyverify(e, numeros:=True) End Sub @@ -293,7 +322,7 @@ Public Class ABMEgresos keyverify(e, letras:=True, numeros:=True, espacios:=True) End Sub Private Sub tbProveedor_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbProveedor.KeyPress - keyverify(e, letras:=True, numeros:=True) + keyverify(e, letras:=True, numeros:=True, espacios:=True) End Sub Private Sub tbPVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbPVenta.KeyPress keyverify(e, numeros:=True) @@ -315,6 +344,7 @@ Public Class ABMEgresos keyverify(e, letras:=True, numeros:=True, espacios:=True) End Sub + 'Validating Private Sub tbNombre_Validating(sender As Object, e As CancelEventArgs) Handles tbNombre.Validating If (sender.Text = "") Or (exist("Personas", "nombre", sender.text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Persona correcta." & vbCrLf & @@ -390,6 +420,12 @@ Public Class ABMEgresos End If End Sub Private Sub tbNComprobante_Validating(sender As Object, e As CancelEventArgs) Handles tbNComprobante.Validating + Dim comprobante As String + If (tbPVenta.Text = 0) Or (tbPVenta.Text = "") Then + comprobante = tbNComprobante.Text + Else + comprobante = tbPVenta.Text & "-" & tbNComprobante.Text + End If If (sender.text = "") Then Principal.ErrorProvider.SetError(sender, "Debe ingresar número de comprobante") ControlesConErroresModificar.Add(sender) @@ -399,7 +435,7 @@ Public Class ABMEgresos "Puede agregar uno nuevo en el menú Editar") ControlesConErroresModificar.Add(sender) Exit Sub - ElseIf (comprobante_repetido(tbPVenta.Text & "-" & tbNComprobante.Text, obtenerID(tbProveedor.Text, "Proveedores"))) Then + ElseIf (comprobante_repetido(comprobante, obtenerID(tbProveedor.Text, "Proveedores"))) Then Principal.ErrorProvider.SetError(sender, "Ese comprobante ya fué cargado para ese Proveedor") ControlesConErroresModificar.Add(sender) Else @@ -421,41 +457,116 @@ Public Class ABMEgresos #Region "Validaciones TAB Modificar" + 'Keypress + Private Sub TextBoxMonto_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBoxMonto.KeyPress + keyverify(e, numeros:=True, comas:=True, puntosAComas:=True) + End Sub + Private Sub TextBoxNombre_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBoxNombre.KeyPress + keyverify(e, letras:=True, numeros:=True, espacios:=True) + End Sub + Private Sub TextBoxNroComprobante_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBoxNroComprobante.KeyPress + keyverify(e, numeros:=True) + End Sub + Private Sub TextBoxProveedor_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBoxProveedor.KeyPress + keyverify(e, letras:=True, numeros:=True, espacios:=True) + End Sub + Private Sub TextBoxPVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBoxPVenta.KeyPress + keyverify(e, numeros:=True) + End Sub + Private Sub ComboBoxCategGasto_KeyPress(sender As Object, e As KeyPressEventArgs) Handles ComboBoxCategGasto.KeyPress + keyverify(e, letras:=True) + End Sub + Private Sub ComboBoxSeccional_KeyPress(sender As Object, e As KeyPressEventArgs) Handles ComboBoxSeccional.KeyPress + keyverify(e, letras:=True, numeros:=True, espacios:=True) + End Sub + Private Sub ComboBoxTipoComprobante_KeyPress(sender As Object, e As KeyPressEventArgs) Handles ComboBoxTipoComprobante.KeyPress + keyverify(e, letras:=True, espacios:=True) + End Sub + + 'Validating Private Sub TextBoxNombre_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBoxNombre.Validating - If sender.Text = "" Then - Principal.ErrorProvider.SetError(sender, "Debe ingresar un nombre") + If (sender.Text = "") Or (exist("Personas", "nombre", sender.text) = False) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar una Persona correcta." & vbCrLf & + "Puede agregar una nueva en el menú Editar") ControlesConErroresModificar.Add(sender) Else Principal.ErrorProvider.SetError(sender, "") ControlesConErroresModificar.Remove(sender) End If End Sub - Private Sub TextBoxProveedor_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBoxProveedor.Validating - If sender.Text = "" Then - Principal.ErrorProvider.SetError(sender, "Debe ingresar un nombre") + If (sender.Text = "") Or (exist("Proveedores", "nombre", sender.text) = False) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un Proveedor correcto." & vbCrLf & + "Puede agregar uno nuevo en el menú Editar") ControlesConErroresModificar.Add(sender) Else Principal.ErrorProvider.SetError(sender, "") ControlesConErroresModificar.Remove(sender) End If End Sub - Private Sub TextBoxMonto_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBoxMonto.Validating If Not IsNumeric(sender.Text) Or IsDBNull(sender.Text) Then - Principal.ErrorProvider.SetError(sender, "Debe ingresar un valor numérico o 0") + Principal.ErrorProvider.SetError(sender, "Debe ingresar un valor numérico o cero") ControlesConErroresModificar.Add(sender) Else Principal.ErrorProvider.SetError(sender, "") ControlesConErroresModificar.Remove(sender) End If End Sub - - Private Sub TextBoxMonto_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBoxMonto.KeyPress - keyverify(e, numeros:=True, comas:=True, puntosAComas:=True) + Private Sub TextBoxNroComprobante_Validating(sender As Object, e As CancelEventArgs) Handles TextBoxNroComprobante.Validating + Dim comprobante As String + If (TextBoxPVenta.Text = 0) Or (TextBoxPVenta.Text = "") Then + comprobante = TextBoxNroComprobante.Text + Else + comprobante = TextBoxPVenta.Text & "-" & TextBoxNroComprobante.Text + End If + If (sender.text = "") Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar número de comprobante") + ControlesConErroresModificar.Add(sender) + Exit Sub + ElseIf (obtenerID(TextBoxProveedor.Text, "Proveedores") = -1) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un Proveedor correcto." & vbCrLf & + "Puede agregar uno nuevo en el menú Editar") + ControlesConErroresModificar.Add(sender) + Exit Sub + ElseIf (comprobante_repetido(comprobante, obtenerID(tbProveedor.Text, "Proveedores"))) Then + Principal.ErrorProvider.SetError(sender, "Ese comprobante ya fué cargado para ese Proveedor") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If + End Sub + Private Sub ComboBoxSeccional_Validating(sender As Object, e As CancelEventArgs) Handles ComboBoxSeccional.Validating + If (sender.Text = "") Or (exist("Seccionales", "nombre", sender.text) = False) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar una Seccional correcta." & vbCrLf & + "Puede agregar una nueva en el menú Editar") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If + End Sub + Private Sub ComboBoxTipoComprobante_Validating(sender As Object, e As CancelEventArgs) Handles ComboBoxTipoComprobante.Validating + If (sender.Text = "") Or (exist("TiposComprobantes", "nombre", sender.text) = False) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un Tipo de Comprobante correcto." & vbCrLf & + "Puede agregar uno nuevo en el menú Editar") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If + End Sub + Private Sub ComboBoxCategGasto_Validating(sender As Object, e As CancelEventArgs) Handles ComboBoxCategGasto.Validating + If (sender.Text = "") Or (exist("CategoriasGastos", "nombre", sender.text) = False) Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar una Categoría correcta." & vbCrLf & + "Puede agregar una nueva en el menú Editar") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If End Sub - - diff --git a/SireCu/Paneles/Otros_AMB.vb b/SireCu/Paneles/Otros_AMB.vb index b4b4459..40e25a5 100644 --- a/SireCu/Paneles/Otros_AMB.vb +++ b/SireCu/Paneles/Otros_AMB.vb @@ -128,6 +128,18 @@ Public Class Otros_AMB Private Sub Otros_AMB_Load(sender As Object, e As EventArgs) Handles MyBase.Load actualizar() End Sub + Private Sub abm_otros(ByVal tabla As String) + + cargarTablaEnDataSet(tabla) + + Dim bindSource As New BindingSource + bindSource.DataSource = Principal.dataset.Tables(tabla) + dgv_otros.DataSource = bindSource + dgv_otros.Columns.Item("id").Visible = False + + tb_editar.AutoCompleteCustomSource = autocomplete(tabla, "nombre") + + End Sub #End Region #Region "Validaciones" From 6aac92be7397cd54fd33e7fb1e603b428c26085f Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Sun, 23 Apr 2017 18:15:12 -0300 Subject: [PATCH 07/27] Validaciones y Cambios Menores --- SireCu/Paneles/ABMEgresos.Designer.vb | 153 ++++++++++---------------- SireCu/Paneles/ABMEgresos.resx | 48 ++++++++ SireCu/Paneles/ABMEgresos.vb | 138 ++++++++++++----------- 3 files changed, 179 insertions(+), 160 deletions(-) diff --git a/SireCu/Paneles/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb index 9a5e5cd..7506f49 100644 --- a/SireCu/Paneles/ABMEgresos.Designer.vb +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -24,19 +24,12 @@ Partial Class ABMEgresos Private Sub InitializeComponent() Me.TabControl = New System.Windows.Forms.TabControl() Me.TabPageAgregar = New System.Windows.Forms.TabPage() - Me.Label2 = New System.Windows.Forms.Label() + Me.lbSeccional = New System.Windows.Forms.Label() Me.tbSeccional = New System.Windows.Forms.ComboBox() Me.tbNComprobante = New System.Windows.Forms.TextBox() Me.lb_Titulo = New System.Windows.Forms.Label() Me.tbTComprobante = New System.Windows.Forms.ComboBox() Me.tbPVenta = New System.Windows.Forms.TextBox() - Me.tbReintegro = New System.Windows.Forms.TextBox() - Me.lbYear = New System.Windows.Forms.Label() - Me.lbMonth = New System.Windows.Forms.Label() - Me.lbDay = New System.Windows.Forms.Label() - Me.tbYear = New System.Windows.Forms.TextBox() - Me.tbMonth = New System.Windows.Forms.TextBox() - Me.tbDay = New System.Windows.Forms.TextBox() Me.lbSmonto = New System.Windows.Forms.Label() Me.lbTComprobante = New System.Windows.Forms.Label() Me.tbMonto = New System.Windows.Forms.TextBox() @@ -95,6 +88,9 @@ Partial Class ABMEgresos Me.Label12 = New System.Windows.Forms.Label() Me.TextBoxComentario = New System.Windows.Forms.TextBox() Me.TextBoxProveedor = New System.Windows.Forms.TextBox() + Me.dtpReintegro = New System.Windows.Forms.DateTimePicker() + Me.dtpFecha = New System.Windows.Forms.DateTimePicker() + Me.lbFecha = New System.Windows.Forms.Label() Me.TabControl.SuspendLayout() Me.TabPageAgregar.SuspendLayout() Me.TabPageModificar.SuspendLayout() @@ -121,19 +117,15 @@ Partial Class ABMEgresos ' 'TabPageAgregar ' - Me.TabPageAgregar.Controls.Add(Me.Label2) + Me.TabPageAgregar.Controls.Add(Me.lbFecha) + Me.TabPageAgregar.Controls.Add(Me.dtpFecha) + Me.TabPageAgregar.Controls.Add(Me.dtpReintegro) + Me.TabPageAgregar.Controls.Add(Me.lbSeccional) Me.TabPageAgregar.Controls.Add(Me.tbSeccional) Me.TabPageAgregar.Controls.Add(Me.tbNComprobante) Me.TabPageAgregar.Controls.Add(Me.lb_Titulo) Me.TabPageAgregar.Controls.Add(Me.tbTComprobante) Me.TabPageAgregar.Controls.Add(Me.tbPVenta) - Me.TabPageAgregar.Controls.Add(Me.tbReintegro) - Me.TabPageAgregar.Controls.Add(Me.lbYear) - Me.TabPageAgregar.Controls.Add(Me.lbMonth) - Me.TabPageAgregar.Controls.Add(Me.lbDay) - Me.TabPageAgregar.Controls.Add(Me.tbYear) - Me.TabPageAgregar.Controls.Add(Me.tbMonth) - Me.TabPageAgregar.Controls.Add(Me.tbDay) Me.TabPageAgregar.Controls.Add(Me.lbSmonto) Me.TabPageAgregar.Controls.Add(Me.lbTComprobante) Me.TabPageAgregar.Controls.Add(Me.tbMonto) @@ -157,14 +149,14 @@ Partial Class ABMEgresos Me.TabPageAgregar.Text = "Agregar" Me.TabPageAgregar.UseVisualStyleBackColor = True ' - 'Label2 + 'lbSeccional ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(32, 264) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(68, 16) - Me.Label2.TabIndex = 93 - Me.Label2.Text = "Seccional" + Me.lbSeccional.AutoSize = True + Me.lbSeccional.Location = New System.Drawing.Point(32, 264) + Me.lbSeccional.Name = "lbSeccional" + Me.lbSeccional.Size = New System.Drawing.Size(68, 16) + Me.lbSeccional.TabIndex = 93 + Me.lbSeccional.Text = "Seccional" ' 'tbSeccional ' @@ -210,70 +202,6 @@ Partial Class ABMEgresos Me.tbPVenta.Size = New System.Drawing.Size(56, 22) Me.tbPVenta.TabIndex = 7 ' - 'tbReintegro - ' - Me.tbReintegro.Location = New System.Drawing.Point(151, 215) - Me.tbReintegro.MaxLength = 2 - Me.tbReintegro.Name = "tbReintegro" - Me.tbReintegro.Size = New System.Drawing.Size(156, 22) - Me.tbReintegro.TabIndex = 9 - ' - 'lbYear - ' - Me.lbYear.AutoSize = True - Me.lbYear.Font = New System.Drawing.Font("Microsoft Sans Serif", 6.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lbYear.Location = New System.Drawing.Point(621, 67) - Me.lbYear.Name = "lbYear" - Me.lbYear.Size = New System.Drawing.Size(22, 12) - Me.lbYear.TabIndex = 89 - Me.lbYear.Text = "Año" - ' - 'lbMonth - ' - Me.lbMonth.AutoSize = True - Me.lbMonth.Font = New System.Drawing.Font("Microsoft Sans Serif", 6.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lbMonth.Location = New System.Drawing.Point(578, 67) - Me.lbMonth.Name = "lbMonth" - Me.lbMonth.Size = New System.Drawing.Size(24, 12) - Me.lbMonth.TabIndex = 88 - Me.lbMonth.Text = "Mes" - ' - 'lbDay - ' - Me.lbDay.AutoSize = True - Me.lbDay.Font = New System.Drawing.Font("Microsoft Sans Serif", 6.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lbDay.Location = New System.Drawing.Point(535, 67) - Me.lbDay.Name = "lbDay" - Me.lbDay.Size = New System.Drawing.Size(19, 12) - Me.lbDay.TabIndex = 87 - Me.lbDay.Text = "Dia" - ' - 'tbYear - ' - Me.tbYear.Location = New System.Drawing.Point(623, 82) - Me.tbYear.MaxLength = 4 - Me.tbYear.Name = "tbYear" - Me.tbYear.ReadOnly = True - Me.tbYear.Size = New System.Drawing.Size(54, 22) - Me.tbYear.TabIndex = 454 - Me.tbYear.TabStop = False - ' - 'tbMonth - ' - Me.tbMonth.Location = New System.Drawing.Point(580, 82) - Me.tbMonth.MaxLength = 2 - Me.tbMonth.Name = "tbMonth" - Me.tbMonth.Size = New System.Drawing.Size(34, 22) - Me.tbMonth.TabIndex = 3 - ' - 'tbDay - ' - Me.tbDay.Location = New System.Drawing.Point(537, 82) - Me.tbDay.MaxLength = 2 - Me.tbDay.Name = "tbDay" - Me.tbDay.Size = New System.Drawing.Size(33, 22) - Me.tbDay.TabIndex = 2 - ' 'lbSmonto ' Me.lbSmonto.AutoSize = True @@ -617,10 +545,13 @@ Partial Class ABMEgresos ' 'DateTimePickerMesReintegro ' - Me.DateTimePickerMesReintegro.CustomFormat = "" - Me.DateTimePickerMesReintegro.Format = System.Windows.Forms.DateTimePickerFormat.[Short] + Me.DateTimePickerMesReintegro.Checked = False + Me.DateTimePickerMesReintegro.CustomFormat = "MM/yyyy" + Me.DateTimePickerMesReintegro.Format = System.Windows.Forms.DateTimePickerFormat.Custom Me.DateTimePickerMesReintegro.Location = New System.Drawing.Point(145, 99) Me.DateTimePickerMesReintegro.Name = "DateTimePickerMesReintegro" + Me.DateTimePickerMesReintegro.ShowCheckBox = True + Me.DateTimePickerMesReintegro.ShowUpDown = True Me.DateTimePickerMesReintegro.Size = New System.Drawing.Size(197, 22) Me.DateTimePickerMesReintegro.TabIndex = 117 Me.DateTimePickerMesReintegro.Value = New Date(2017, 3, 4, 19, 31, 9, 0) @@ -805,6 +736,38 @@ Partial Class ABMEgresos Me.TextBoxProveedor.Size = New System.Drawing.Size(197, 22) Me.TextBoxProveedor.TabIndex = 96 ' + 'dtpReintegro + ' + Me.dtpReintegro.Checked = False + Me.dtpReintegro.CustomFormat = "MM/yyyy" + Me.dtpReintegro.Format = System.Windows.Forms.DateTimePickerFormat.Custom + Me.dtpReintegro.Location = New System.Drawing.Point(151, 213) + Me.dtpReintegro.Name = "dtpReintegro" + Me.dtpReintegro.ShowCheckBox = True + Me.dtpReintegro.ShowUpDown = True + Me.dtpReintegro.Size = New System.Drawing.Size(156, 22) + Me.dtpReintegro.TabIndex = 455 + Me.dtpReintegro.Value = New Date(2017, 3, 4, 19, 31, 9, 0) + ' + 'dtpFecha + ' + Me.dtpFecha.CustomFormat = "" + Me.dtpFecha.Format = System.Windows.Forms.DateTimePickerFormat.[Short] + Me.dtpFecha.Location = New System.Drawing.Point(537, 82) + Me.dtpFecha.Name = "dtpFecha" + Me.dtpFecha.Size = New System.Drawing.Size(163, 22) + Me.dtpFecha.TabIndex = 456 + Me.dtpFecha.Value = New Date(2017, 3, 4, 19, 31, 9, 0) + ' + 'lbFecha + ' + Me.lbFecha.AutoSize = True + Me.lbFecha.Location = New System.Drawing.Point(391, 87) + Me.lbFecha.Name = "lbFecha" + Me.lbFecha.Size = New System.Drawing.Size(49, 16) + Me.lbFecha.TabIndex = 457 + Me.lbFecha.Text = "Fecha:" + ' 'ABMEgresos ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -836,13 +799,6 @@ Partial Class ABMEgresos Friend WithEvents lb_Titulo As Label Friend WithEvents tbTComprobante As ComboBox Friend WithEvents tbPVenta As TextBox - Friend WithEvents tbReintegro As TextBox - Friend WithEvents lbYear As Label - Friend WithEvents lbMonth As Label - Friend WithEvents lbDay As Label - Friend WithEvents tbYear As TextBox - Friend WithEvents tbMonth As TextBox - Friend WithEvents tbDay As TextBox Friend WithEvents lbSmonto As Label Friend WithEvents lbTComprobante As Label Friend WithEvents tbMonto As TextBox @@ -901,6 +857,9 @@ Partial Class ABMEgresos Friend WithEvents LabelSeccional As Label Friend WithEvents ComboBoxSeccional As ComboBox Friend WithEvents DateTimePickerMesReintegro As DateTimePicker - Friend WithEvents Label2 As Label + Friend WithEvents lbSeccional As Label Friend WithEvents tbSeccional As ComboBox + Friend WithEvents lbFecha As Label + Friend WithEvents dtpFecha As DateTimePicker + Friend WithEvents dtpReintegro As DateTimePicker End Class diff --git a/SireCu/Paneles/ABMEgresos.resx b/SireCu/Paneles/ABMEgresos.resx index 596096f..0d9d1cc 100644 --- a/SireCu/Paneles/ABMEgresos.resx +++ b/SireCu/Paneles/ABMEgresos.resx @@ -165,4 +165,52 @@ True + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + \ No newline at end of file diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index e723bf2..0d4dc01 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -11,8 +11,27 @@ Public Class ABMEgresos #Region "TAB Agregar - Eventos" + Dim CamposObligatios As List(Of Control) = New List(Of Control) + Private Sub btnGuardar_Click(sender As Object, e As EventArgs) Handles btnGuardar.Click + ' Verificacion de campos obligatorios completos + For Each control As Control In CamposObligatios + If TypeOf (control) Is TextBox Then + If control.Text = "" Then + Principal.ErrorProvider.SetError(control, "Debe completar el campo") + ControlesConErroresAgregar.Add(control) + End If + End If + If TypeOf (control) Is ComboBox Then + Dim combo As ComboBox = control + If combo.SelectedIndex = -1 Then + Principal.ErrorProvider.SetError(control, "Debe Seleccionar una item") + ControlesConErroresAgregar.Add(control) + End If + End If + Next + 'Verificamos que todos los campos hayan pasado las validaciones If ControlesConErroresAgregar.Count > 0 Then MsgBox("Por favor revise los campos ingresados", MsgBoxStyle.Exclamation, "Error") @@ -21,15 +40,18 @@ Public Class ABMEgresos 'Verificar Saldo Disponible 'OPTIMIZAR TODO Dim saldo As Double - Select Case tbMonth.Text + Select Case DatePart(DateInterval.Month, dtpFecha.Value) Case 1 To 3 - saldo = SaldoActual("Primero", tbYear.Text) + saldo = SaldoActual("Primero", DatePart(DateInterval.Year, dtpFecha.Value)) Case 4 To 6 - saldo = SaldoActual("Segundo", tbYear.Text) + saldo = SaldoActual("Segundo", DatePart(DateInterval.Year, dtpFecha.Value)) Case 7 To 9 - saldo = SaldoActual("Tercero", tbYear.Text) + saldo = SaldoActual("Tercero", DatePart(DateInterval.Year, dtpFecha.Value)) Case 10 To 12 - saldo = SaldoActual("Cuarto", tbYear.Text) + saldo = SaldoActual("Cuarto", DatePart(DateInterval.Year, dtpFecha.Value)) + Case Else + MsgBox("Número de Mes Incorrecto", MsgBoxStyle.Exclamation, "Error") + Exit Sub End Select If (saldo < tbMonto.Text) Then @@ -39,16 +61,15 @@ Public Class ABMEgresos End If Dim comprobante As String - If (tbPVenta.Text = 0) Or (tbPVenta.Text = "") Then + If (tbPVenta.Text = "0") Or (tbPVenta.Text = "") Then comprobante = tbNComprobante.Text Else comprobante = tbPVenta.Text & "-" & tbNComprobante.Text End If - Dim fecha As Date = tbDay.Text & "/" & tbMonth.Text & "/" & tbYear.Text Dim reintegro As Date - If tbReintegro.Text = "" Then - reintegro = fecha - Else reintegro = "01" & "/" & tbReintegro.Text & "/" & tbYear.Text + If dtpReintegro.Checked Then + reintegro = dtpReintegro.Value + Else reintegro = dtpFecha.Value End If @@ -60,7 +81,7 @@ Public Class ABMEgresos obtenerID(tbProveedor.Text, "Proveedores"), obtenerID(tbTGasto.Text, "CategoriasGastos"), obtenerID(tbNombre.Text, "Personas"), - fecha, + dtpFecha.Value, obtenerID(tbTComprobante.Text, "TiposComprobantes"), obtenerID(tbSeccional.Text, "Seccionales"), reintegro, @@ -69,16 +90,11 @@ Public Class ABMEgresos ) limpiarForm(TabPageAgregar) + dtpReintegro.Checked = False End If End Sub - Private Sub tbYear_DoubleClick(sender As Object, e As EventArgs) Handles tbYear.DoubleClick - tbYear.ReadOnly = False - End Sub - Private Sub tbYear_Leave(sender As Object, e As EventArgs) Handles tbYear.Leave - tbYear.ReadOnly = True - End Sub #End Region @@ -94,8 +110,10 @@ Public Class ABMEgresos TextBoxProveedor.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("proveedor_nombre").Value If DataGridViewModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value Is DBNull.Value Then DateTimePickerMesReintegro.Value = CDate(DataGridViewModificar.Rows(e.RowIndex).Cells("fecha").Value) + DateTimePickerMesReintegro.Checked = False Else DateTimePickerMesReintegro.Value = CDate(DataGridViewModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value) + DateTimePickerMesReintegro.Checked = True End If ComboBoxSeccional.SelectedItem = DataGridViewModificar.Rows(e.RowIndex).Cells("seccional_nombre").Value TextBoxComentario.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("comentario").Value.ToString @@ -150,9 +168,9 @@ Public Class ABMEgresos comprobante = TextBoxPVenta.Text & "-" & TextBoxNroComprobante.Text End If Dim reintegro As Date - If tbReintegro.Text = "" Then - reintegro = DateTimePickerFecha.Value - Else reintegro = DateTimePickerMesReintegro.Value + If DateTimePickerMesReintegro.Checked Then + reintegro = DateTimePickerMesReintegro.Value + Else reintegro = DateTimePickerFecha.Value End If @@ -168,7 +186,7 @@ Public Class ABMEgresos DateTimePickerFecha.Value, ComboBoxTipoComprobante.SelectedValue, ComboBoxSeccional.SelectedValue, - DateTimePickerMesReintegro.Value, + reintegro, CDec(TextBoxMonto.Text), TextBoxComentario.Text ) @@ -190,8 +208,18 @@ Public Class ABMEgresos ' ######################################## TAB Agregar - ' Usamos el año mas grande de la base de datos - tbYear.Text = ultimoaño("Egresos") + ' Campos Obligatorios + CamposObligatios.AddRange({tbNombre, + tbTGasto, + tbTComprobante, + tbProveedor, + tbNComprobante, + tbMonto, + tbSeccional}) + + dtpFecha.Value = Now + dtpReintegro.Value = Now + dtpReintegro.Checked = False ' Autocomplete al escribir tbProveedor.AutoCompleteCustomSource = autocomplete("Proveedores", "nombre") tbNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") @@ -303,13 +331,13 @@ Public Class ABMEgresos #Region "Validaciones TAB Agregar" 'Keypress - Private Sub tbDay_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbDay.KeyPress + Private Sub tbDay_KeyPress(sender As Object, e As KeyPressEventArgs) keyverify(e, numeros:=True) End Sub Private Sub tbTGasto_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbTGasto.KeyPress keyverify(e, letras:=True) End Sub - Private Sub tbMonth_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbMonth.KeyPress + Private Sub tbMonth_KeyPress(sender As Object, e As KeyPressEventArgs) keyverify(e, numeros:=True) End Sub Private Sub tbMonto_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbMonto.KeyPress @@ -327,19 +355,12 @@ Public Class ABMEgresos Private Sub tbPVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbPVenta.KeyPress keyverify(e, numeros:=True) End Sub - Private Sub tbReintegro_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbReintegro.KeyPress + Private Sub tbReintegro_KeyPress(sender As Object, e As KeyPressEventArgs) keyverify(e, numeros:=True) End Sub Private Sub tbTComprobante_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbTComprobante.KeyPress keyverify(e, letras:=True, espacios:=True) End Sub - Private Sub tbYear_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbYear.KeyPress - keyverify(e, numeros:=True) - If e.KeyChar = ChrW(Keys.Enter) Then - tbYear.ReadOnly = True - tbTGasto.Focus() - End If - End Sub Private Sub tbSeccional_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbSeccional.KeyPress keyverify(e, letras:=True, numeros:=True, espacios:=True) End Sub @@ -349,107 +370,98 @@ Public Class ABMEgresos If (sender.Text = "") Or (exist("Personas", "nombre", sender.text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Persona correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") - ControlesConErroresModificar.Add(sender) + ControlesConErroresAgregar.Add(sender) Else Principal.ErrorProvider.SetError(sender, "") - ControlesConErroresModificar.Remove(sender) + ControlesConErroresAgregar.Remove(sender) End If End Sub Private Sub tbTGasto_Validating(sender As Object, e As CancelEventArgs) Handles tbTGasto.Validating If (sender.Text = "") Or (exist("CategoriasGastos", "nombre", sender.text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Categoría correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") - ControlesConErroresModificar.Add(sender) + ControlesConErroresAgregar.Add(sender) Else Principal.ErrorProvider.SetError(sender, "") - ControlesConErroresModificar.Remove(sender) + ControlesConErroresAgregar.Remove(sender) End If End Sub Private Sub tbProveedor_Validating(sender As Object, e As CancelEventArgs) Handles tbProveedor.Validating If (sender.Text = "") Or (exist("Proveedores", "nombre", sender.text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Proveedor correcto." & vbCrLf & "Puede agregar uno nuevo en el menú Editar") - ControlesConErroresModificar.Add(sender) + ControlesConErroresAgregar.Add(sender) Else Principal.ErrorProvider.SetError(sender, "") - ControlesConErroresModificar.Remove(sender) + ControlesConErroresAgregar.Remove(sender) End If End Sub Private Sub tbTComprobante_Validating(sender As Object, e As CancelEventArgs) Handles tbTComprobante.Validating If (sender.Text = "") Or (exist("TiposComprobantes", "nombre", sender.text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Tipo de Comprobante correcto." & vbCrLf & "Puede agregar uno nuevo en el menú Editar") - ControlesConErroresModificar.Add(sender) + ControlesConErroresAgregar.Add(sender) Else Principal.ErrorProvider.SetError(sender, "") - ControlesConErroresModificar.Remove(sender) + ControlesConErroresAgregar.Remove(sender) End If End Sub Private Sub tbMonto_Validating(sender As Object, e As CancelEventArgs) Handles tbMonto.Validating If Not IsNumeric(sender.Text) Or IsDBNull(sender.Text) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un valor numérico o cero") - ControlesConErroresModificar.Add(sender) + ControlesConErroresAgregar.Add(sender) Else Principal.ErrorProvider.SetError(sender, "") - ControlesConErroresModificar.Remove(sender) + ControlesConErroresAgregar.Remove(sender) End If End Sub - Private Sub tbReintegro_Validating(sender As Object, e As CancelEventArgs) Handles tbReintegro.Validating + Private Sub tbReintegro_Validating(sender As Object, e As CancelEventArgs) If sender.text = "" Then Principal.ErrorProvider.SetError(sender, "") - ControlesConErroresModificar.Remove(sender) + ControlesConErroresAgregar.Remove(sender) Exit Sub End If If (CDbl(sender.Text) < 1) Or (CDbl(sender.Text) > 12) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un mes de reintegro válido") - ControlesConErroresModificar.Add(sender) + ControlesConErroresAgregar.Add(sender) Else Principal.ErrorProvider.SetError(sender, "") - ControlesConErroresModificar.Remove(sender) + ControlesConErroresAgregar.Remove(sender) End If End Sub Private Sub tbSeccional_Validating(sender As Object, e As CancelEventArgs) Handles tbSeccional.Validating If (sender.Text = "") Or (exist("Seccionales", "nombre", sender.text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Seccional correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") - ControlesConErroresModificar.Add(sender) + ControlesConErroresAgregar.Add(sender) Else Principal.ErrorProvider.SetError(sender, "") - ControlesConErroresModificar.Remove(sender) + ControlesConErroresAgregar.Remove(sender) End If End Sub Private Sub tbNComprobante_Validating(sender As Object, e As CancelEventArgs) Handles tbNComprobante.Validating Dim comprobante As String - If (tbPVenta.Text = 0) Or (tbPVenta.Text = "") Then + If (tbPVenta.Text = "0") Or (tbPVenta.Text = "") Then comprobante = tbNComprobante.Text Else comprobante = tbPVenta.Text & "-" & tbNComprobante.Text End If If (sender.text = "") Then Principal.ErrorProvider.SetError(sender, "Debe ingresar número de comprobante") - ControlesConErroresModificar.Add(sender) + ControlesConErroresAgregar.Add(sender) Exit Sub ElseIf (obtenerID(tbProveedor.Text, "Proveedores") = -1) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Proveedor correcto." & vbCrLf & "Puede agregar uno nuevo en el menú Editar") - ControlesConErroresModificar.Add(sender) + ControlesConErroresAgregar.Add(sender) Exit Sub ElseIf (comprobante_repetido(comprobante, obtenerID(tbProveedor.Text, "Proveedores"))) Then Principal.ErrorProvider.SetError(sender, "Ese comprobante ya fué cargado para ese Proveedor") - ControlesConErroresModificar.Add(sender) - Else - Principal.ErrorProvider.SetError(sender, "") - ControlesConErroresModificar.Remove(sender) - End If - End Sub - Private Sub tbYear_Validating(sender As Object, e As CancelEventArgs) Handles tbYear.Validating - If Not IsNumeric(sender.Text) Or IsDBNull(sender.Text) Or (tbYear.Text = "") Then - Principal.ErrorProvider.SetError(sender, "Debe ingresar un Año válido") - ControlesConErroresModificar.Add(sender) + ControlesConErroresAgregar.Add(sender) Else Principal.ErrorProvider.SetError(sender, "") - ControlesConErroresModificar.Remove(sender) + ControlesConErroresAgregar.Remove(sender) End If End Sub From 31152ebee9c06babea6a4bc5e9fd079f67d545b0 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Tue, 25 Apr 2017 10:32:15 -0300 Subject: [PATCH 08/27] Actualizar Saldos y Fecha Reintegro --- SireCu/Conexion.vb | 1 + SireCu/OtrasFunciones.vb | 40 +++++++++++++----- SireCu/Paneles/ABMEgresos.Designer.vb | 34 +++++++-------- SireCu/Paneles/ABMEgresos.resx | 48 --------------------- SireCu/Paneles/ABMEgresos.vb | 61 +++++++++++++++------------ SireCu/Paneles/ABMIngresos.vb | 1 + SireCu/Principal.Designer.vb | 24 ++++++++--- SireCu/Principal.vb | 2 + 8 files changed, 100 insertions(+), 111 deletions(-) diff --git a/SireCu/Conexion.vb b/SireCu/Conexion.vb index ece0cf9..c336499 100644 --- a/SireCu/Conexion.vb +++ b/SireCu/Conexion.vb @@ -68,6 +68,7 @@ Module Conexion desconectar() Catch ex As SqlCeException MessageBox.Show(ex.Message) + reader = Nothing End Try Return (reader.GetString(0)) diff --git a/SireCu/OtrasFunciones.vb b/SireCu/OtrasFunciones.vb index 6028c82..9afbda2 100644 --- a/SireCu/OtrasFunciones.vb +++ b/SireCu/OtrasFunciones.vb @@ -61,20 +61,14 @@ Module OtrasFunciones saldoAnterior = consultarES(Principal.query, Principal.command) ' 2) - - If IsDBNull(consultarES(queryIngresos, Principal.command)) Then - ingresos = 0 - Else - ingresos = consultarES(queryIngresos, Principal.command) - End If + Dim resultadoConsulta = consultarES(queryIngresos, Principal.command) + ingresos = IIf(IsDBNull(resultadoConsulta), 0, resultadoConsulta) ' 3) - If IsDBNull(consultarES(queryEgresos, Principal.command)) Then - egresos = 0 - Else - egresos = consultarES(queryEgresos, Principal.command) - End If + resultadoConsulta = Nothing + resultadoConsulta = consultarES(queryEgresos, Principal.command) + egresos = IIf(IsDBNull(resultadoConsulta), 0, resultadoConsulta) Return (saldoAnterior + ingresos - egresos) @@ -161,4 +155,28 @@ Module OtrasFunciones End Function + Public Sub ActualizarSaldo() + Dim saldo As Double + Select Case Now.Date.Month + Case 1 To 3 + saldo = SaldoActual("Primero", Now.Date.Year) + Case 4 To 6 + saldo = SaldoActual("Segundo", Now.Date.Year) + Case 7 To 9 + saldo = SaldoActual("Tercero", Now.Date.Year) + Case 10 To 12 + saldo = SaldoActual("Cuarto", Now.Date.Year) + Case Else + Exit Sub + End Select + + If saldo >= 0 Then + Principal.TStripLabelSaldo.ForeColor = Color.Green + Else + Principal.TStripLabelSaldo.ForeColor = Color.Red + End If + Principal.TStripLabelSaldo.Text = "Saldo: $" & saldo & " (" & Now.Month & "/" & Now.Year & ")" + + End Sub + End Module diff --git a/SireCu/Paneles/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb index 7506f49..7b6b830 100644 --- a/SireCu/Paneles/ABMEgresos.Designer.vb +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -48,7 +48,7 @@ Partial Class ABMEgresos Me.TabPageModificar = New System.Windows.Forms.TabPage() Me.SplitContainerModificar = New System.Windows.Forms.SplitContainer() Me.ToolStripContainerModificar = New System.Windows.Forms.ToolStripContainer() - Me.DataGridViewModificar = New System.Windows.Forms.DataGridView() + Me.DGVModificar = New System.Windows.Forms.DataGridView() Me.id = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.nro_comprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.tipo_comprobante_id = New System.Windows.Forms.DataGridViewTextBoxColumn() @@ -100,7 +100,7 @@ Partial Class ABMEgresos Me.SplitContainerModificar.SuspendLayout() Me.ToolStripContainerModificar.ContentPanel.SuspendLayout() Me.ToolStripContainerModificar.SuspendLayout() - CType(Me.DataGridViewModificar, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.DGVModificar, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'TabControl @@ -395,7 +395,7 @@ Partial Class ABMEgresos ' 'ToolStripContainerModificar.ContentPanel ' - Me.ToolStripContainerModificar.ContentPanel.Controls.Add(Me.DataGridViewModificar) + Me.ToolStripContainerModificar.ContentPanel.Controls.Add(Me.DGVModificar) Me.ToolStripContainerModificar.ContentPanel.Size = New System.Drawing.Size(741, 176) Me.ToolStripContainerModificar.Dock = System.Windows.Forms.DockStyle.Fill Me.ToolStripContainerModificar.Location = New System.Drawing.Point(0, 0) @@ -404,19 +404,19 @@ Partial Class ABMEgresos Me.ToolStripContainerModificar.TabIndex = 0 Me.ToolStripContainerModificar.Text = "ToolStripContainer1" ' - 'DataGridViewModificar + 'DGVModificar ' - Me.DataGridViewModificar.AllowUserToAddRows = False - Me.DataGridViewModificar.AllowUserToDeleteRows = False - Me.DataGridViewModificar.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DataGridViewModificar.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.id, Me.nro_comprobante, Me.tipo_comprobante_id, Me.tipo_comprobante_nombre, Me.proveedor_id, Me.proveedor_nombre, Me.categoria_gasto_id, Me.categoria_nombre, Me.persona_id, Me.persona_nombre, Me.fecha, Me.seccional_id, Me.seccional_nombre, Me.mes_reintegro, Me.monto, Me.comentario}) - Me.DataGridViewModificar.Dock = System.Windows.Forms.DockStyle.Fill - Me.DataGridViewModificar.Location = New System.Drawing.Point(0, 0) - Me.DataGridViewModificar.Name = "DataGridViewModificar" - Me.DataGridViewModificar.ReadOnly = True - Me.DataGridViewModificar.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DataGridViewModificar.Size = New System.Drawing.Size(741, 176) - Me.DataGridViewModificar.TabIndex = 0 + Me.DGVModificar.AllowUserToAddRows = False + Me.DGVModificar.AllowUserToDeleteRows = False + Me.DGVModificar.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DGVModificar.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.id, Me.nro_comprobante, Me.tipo_comprobante_id, Me.tipo_comprobante_nombre, Me.proveedor_id, Me.proveedor_nombre, Me.categoria_gasto_id, Me.categoria_nombre, Me.persona_id, Me.persona_nombre, Me.fecha, Me.seccional_id, Me.seccional_nombre, Me.mes_reintegro, Me.monto, Me.comentario}) + Me.DGVModificar.Dock = System.Windows.Forms.DockStyle.Fill + Me.DGVModificar.Location = New System.Drawing.Point(0, 0) + Me.DGVModificar.Name = "DGVModificar" + Me.DGVModificar.ReadOnly = True + Me.DGVModificar.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DGVModificar.Size = New System.Drawing.Size(741, 176) + Me.DGVModificar.TabIndex = 0 ' 'id ' @@ -788,7 +788,7 @@ Partial Class ABMEgresos Me.ToolStripContainerModificar.ContentPanel.ResumeLayout(False) Me.ToolStripContainerModificar.ResumeLayout(False) Me.ToolStripContainerModificar.PerformLayout() - CType(Me.DataGridViewModificar, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.DGVModificar, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub @@ -817,7 +817,7 @@ Partial Class ABMEgresos Friend WithEvents TabPageModificar As TabPage Friend WithEvents SplitContainerModificar As SplitContainer Friend WithEvents ToolStripContainerModificar As ToolStripContainer - Friend WithEvents DataGridViewModificar As DataGridView + Friend WithEvents DGVModificar As DataGridView Friend WithEvents id As DataGridViewTextBoxColumn Friend WithEvents nro_comprobante As DataGridViewTextBoxColumn Friend WithEvents tipo_comprobante_id As DataGridViewTextBoxColumn diff --git a/SireCu/Paneles/ABMEgresos.resx b/SireCu/Paneles/ABMEgresos.resx index 0d9d1cc..596096f 100644 --- a/SireCu/Paneles/ABMEgresos.resx +++ b/SireCu/Paneles/ABMEgresos.resx @@ -165,52 +165,4 @@ True - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - \ No newline at end of file diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index 0d4dc01..af78e3b 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -68,8 +68,8 @@ Public Class ABMEgresos End If Dim reintegro As Date If dtpReintegro.Checked Then - reintegro = dtpReintegro.Value - Else reintegro = dtpFecha.Value + reintegro = dtpReintegro.Value.Date + Else reintegro = dtpFecha.Value.Date End If @@ -81,7 +81,7 @@ Public Class ABMEgresos obtenerID(tbProveedor.Text, "Proveedores"), obtenerID(tbTGasto.Text, "CategoriasGastos"), obtenerID(tbNombre.Text, "Personas"), - dtpFecha.Value, + dtpFecha.Value.Date, obtenerID(tbTComprobante.Text, "TiposComprobantes"), obtenerID(tbSeccional.Text, "Seccionales"), reintegro, @@ -91,7 +91,7 @@ Public Class ABMEgresos limpiarForm(TabPageAgregar) dtpReintegro.Checked = False - + ActualizarSaldo() End If End Sub @@ -100,33 +100,38 @@ Public Class ABMEgresos #Region "TAB Modificar - Eventos" - Private Sub DataGridViewModificar_CellMouseDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DataGridViewModificar.CellMouseDoubleClick + Private Sub DataGridViewModificar_CellMouseDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DGVModificar.CellMouseDoubleClick ' Cargar el formulario con los datos para modificar Try - idModificando = CInt(DataGridViewModificar.Rows(e.RowIndex).Cells("id").Value) + idModificando = CInt(DGVModificar.Rows(e.RowIndex).Cells("id").Value) - TextBoxNombre.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("persona_nombre").Value - ComboBoxCategGasto.SelectedItem = DataGridViewModificar.Rows(e.RowIndex).Cells("categoria_nombre").Value - TextBoxProveedor.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("proveedor_nombre").Value - If DataGridViewModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value Is DBNull.Value Then - DateTimePickerMesReintegro.Value = CDate(DataGridViewModificar.Rows(e.RowIndex).Cells("fecha").Value) + TextBoxNombre.Text = DGVModificar.Rows(e.RowIndex).Cells("persona_nombre").Value + ComboBoxCategGasto.SelectedItem = DGVModificar.Rows(e.RowIndex).Cells("categoria_nombre").Value + TextBoxProveedor.Text = DGVModificar.Rows(e.RowIndex).Cells("proveedor_nombre").Value + If DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value Is DBNull.Value Then + DateTimePickerMesReintegro.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("fecha").Value) DateTimePickerMesReintegro.Checked = False Else - DateTimePickerMesReintegro.Value = CDate(DataGridViewModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value) - DateTimePickerMesReintegro.Checked = True + If DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value = DGVModificar.Rows(e.RowIndex).Cells("fecha").Value Then + DateTimePickerMesReintegro.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value) + DateTimePickerMesReintegro.Checked = False + Else + DateTimePickerMesReintegro.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value) + DateTimePickerMesReintegro.Checked = True + End If End If - ComboBoxSeccional.SelectedItem = DataGridViewModificar.Rows(e.RowIndex).Cells("seccional_nombre").Value - TextBoxComentario.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("comentario").Value.ToString - DateTimePickerFecha.Value = CDate(DataGridViewModificar.Rows(e.RowIndex).Cells("fecha").Value) - ComboBoxTipoComprobante.SelectedItem = DataGridViewModificar.Rows(e.RowIndex).Cells("tipo_comprobante_nombre").Value - If DataGridViewModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Contains("-") Then - TextBoxPVenta.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Split("-")(0) - TextBoxNroComprobante.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Split("-")(1) + ComboBoxSeccional.SelectedItem = DGVModificar.Rows(e.RowIndex).Cells("seccional_nombre").Value + TextBoxComentario.Text = DGVModificar.Rows(e.RowIndex).Cells("comentario").Value.ToString + DateTimePickerFecha.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("fecha").Value) + ComboBoxTipoComprobante.SelectedItem = DGVModificar.Rows(e.RowIndex).Cells("tipo_comprobante_nombre").Value + If DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Contains("-") Then + TextBoxPVenta.Text = DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Split("-")(0) + TextBoxNroComprobante.Text = DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Split("-")(1) Else TextBoxPVenta.Text = "0" - TextBoxNroComprobante.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value + TextBoxNroComprobante.Text = DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value End If - TextBoxMonto.Text = DataGridViewModificar.Rows(e.RowIndex).Cells("monto").Value + TextBoxMonto.Text = DGVModificar.Rows(e.RowIndex).Cells("monto").Value Catch ex As Exception MessageBox.Show(ex.Message, "Error al cargar el formulario", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try @@ -169,8 +174,8 @@ Public Class ABMEgresos End If Dim reintegro As Date If DateTimePickerMesReintegro.Checked Then - reintegro = DateTimePickerMesReintegro.Value - Else reintegro = DateTimePickerFecha.Value + reintegro = DateTimePickerMesReintegro.Value.Date + Else reintegro = DateTimePickerFecha.Value.Date End If @@ -183,7 +188,7 @@ Public Class ABMEgresos obtenerID(TextBoxProveedor.Text, "Proveedores"), ComboBoxCategGasto.SelectedValue, obtenerID(TextBoxNombre.Text, "Personas"), - DateTimePickerFecha.Value, + DateTimePickerFecha.Value.Date, ComboBoxTipoComprobante.SelectedValue, ComboBoxSeccional.SelectedValue, reintegro, @@ -194,8 +199,8 @@ Public Class ABMEgresos idModificando = 0 limpiarForm(SplitContainerModificar.Panel2) activarModificar(False) - CargardDGV(DataGridViewModificar) - + CargardDGV(DGVModificar) + ActualizarSaldo() End If End Sub @@ -241,7 +246,7 @@ Public Class ABMEgresos ' ######################################## TAB Modificar activarModificar(False) - CargardDGV(DataGridViewModificar) + CargardDGV(DGVModificar) ' Autocomplete al escribir TextBoxNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") diff --git a/SireCu/Paneles/ABMIngresos.vb b/SireCu/Paneles/ABMIngresos.vb index 6be393a..4d843dd 100644 --- a/SireCu/Paneles/ABMIngresos.vb +++ b/SireCu/Paneles/ABMIngresos.vb @@ -68,6 +68,7 @@ Public Class ABMIngresos End Select activarEdicion(False) + ActualizarSaldo() End If diff --git a/SireCu/Principal.Designer.vb b/SireCu/Principal.Designer.vb index 1f3a911..16ad389 100644 --- a/SireCu/Principal.Designer.vb +++ b/SireCu/Principal.Designer.vb @@ -39,8 +39,9 @@ Partial Class Principal Me.TiposDeGastosToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.CategoríasDeGastosToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.PersonasToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.ErrorProvider = New System.Windows.Forms.ErrorProvider(Me.components) Me.SeccionalesToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ErrorProvider = New System.Windows.Forms.ErrorProvider(Me.components) + Me.TStripLabelSaldo = New System.Windows.Forms.ToolStripStatusLabel() Me.ToolStripContainerPrincipal.BottomToolStripPanel.SuspendLayout() Me.ToolStripContainerPrincipal.ContentPanel.SuspendLayout() Me.ToolStripContainerPrincipal.TopToolStripPanel.SuspendLayout() @@ -80,7 +81,7 @@ Partial Class Principal 'StatusStripPrincipal ' Me.StatusStripPrincipal.Dock = System.Windows.Forms.DockStyle.None - Me.StatusStripPrincipal.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.stat_Label, Me.stat_Bar}) + Me.StatusStripPrincipal.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.stat_Label, Me.stat_Bar, Me.TStripLabelSaldo}) Me.StatusStripPrincipal.Location = New System.Drawing.Point(0, 0) Me.StatusStripPrincipal.Name = "StatusStripPrincipal" Me.StatusStripPrincipal.Size = New System.Drawing.Size(982, 22) @@ -89,8 +90,10 @@ Partial Class Principal 'stat_Label ' Me.stat_Label.Name = "stat_Label" - Me.stat_Label.Size = New System.Drawing.Size(65, 17) + Me.stat_Label.Size = New System.Drawing.Size(795, 17) + Me.stat_Label.Spring = True Me.stat_Label.Text = "Conectado" + Me.stat_Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' 'stat_Bar ' @@ -202,16 +205,22 @@ Partial Class Principal Me.PersonasToolStripMenuItem.Size = New System.Drawing.Size(201, 22) Me.PersonasToolStripMenuItem.Text = "Personas" ' - 'ErrorProvider - ' - Me.ErrorProvider.ContainerControl = Me - ' 'SeccionalesToolStripMenuItem ' Me.SeccionalesToolStripMenuItem.Name = "SeccionalesToolStripMenuItem" Me.SeccionalesToolStripMenuItem.Size = New System.Drawing.Size(201, 22) Me.SeccionalesToolStripMenuItem.Text = "Seccionales" ' + 'ErrorProvider + ' + Me.ErrorProvider.ContainerControl = Me + ' + 'TStripLabelSaldo + ' + Me.TStripLabelSaldo.Name = "TStripLabelSaldo" + Me.TStripLabelSaldo.Size = New System.Drawing.Size(39, 17) + Me.TStripLabelSaldo.Text = "Saldo:" + ' 'Principal ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -259,4 +268,5 @@ Partial Class Principal Friend WithEvents CategoríasDeGastosToolStripMenuItem As ToolStripMenuItem Friend WithEvents PersonasToolStripMenuItem As ToolStripMenuItem Friend WithEvents SeccionalesToolStripMenuItem As ToolStripMenuItem + Friend WithEvents TStripLabelSaldo As ToolStripStatusLabel End Class diff --git a/SireCu/Principal.vb b/SireCu/Principal.vb index e2f8b4e..50f542f 100644 --- a/SireCu/Principal.vb +++ b/SireCu/Principal.vb @@ -62,6 +62,8 @@ Public Class Principal cargarTablaEnDataSet("TiposComprobantes") cargarTablaEnDataSet("Seccionales") + ActualizarSaldo() + End Sub Private Sub ProveedoresToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ProveedoresToolStripMenuItem.Click From 536b50288940046df53e8cf10ff5c6c889e9a7b0 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Wed, 26 Apr 2017 10:25:19 -0300 Subject: [PATCH 09/27] =?UTF-8?q?Fix:=20verificar=5Fa=C3=B1o()=20y=20Execu?= =?UTF-8?q?teReader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SireCu/Clases/Ingreso.vb | 13 ++----------- SireCu/Conexion.vb | 6 ++++-- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/SireCu/Clases/Ingreso.vb b/SireCu/Clases/Ingreso.vb index b797569..3f26d18 100644 --- a/SireCu/Clases/Ingreso.vb +++ b/SireCu/Clases/Ingreso.vb @@ -46,19 +46,10 @@ Module Ingreso Public Function verificar_año(ByVal año As Integer) - ' TODO reemplazar fill dataset por command.ExecuteReader - Principal.query = "SELECT * from ingresos where DATEPART(Year, fecha) = '" & año & "'" - consultarNQ(Principal.query, Principal.command) - Principal.dataset.Tables("Ingresos").Clear() - Principal.tableadapters("Ingresos") = New SqlCeDataAdapter(Principal.command) - Principal.tableadapters("Ingresos").Fill(Principal.dataset.Tables("ingresos")) + Dim dt As DataTable = consultarReader(Principal.query) - If (Principal.dataset.Tables("ingresos").Rows.Count = 0) Then - Return (False) - Else - Return (True) - End If + Return IIf(dt.Rows.Count > 0, True, False) End Function diff --git a/SireCu/Conexion.vb b/SireCu/Conexion.vb index c336499..dbae4cd 100644 --- a/SireCu/Conexion.vb +++ b/SireCu/Conexion.vb @@ -56,22 +56,24 @@ Module Conexion Return resultado End Function - Function consultarReader(ByVal sql As String) + Function consultarReader(ByVal sql As String) As DataTable Dim reader As SqlCeDataReader + Dim dt As New DataTable Try conectar() Principal.command.CommandText = sql Principal.command.Connection = conexion reader = Principal.command.ExecuteReader() + dt.Load(reader) desconectar() Catch ex As SqlCeException MessageBox.Show(ex.Message) reader = Nothing End Try - Return (reader.GetString(0)) + Return dt End Function Sub cargarTablaEnDataSet(ByVal tabla As String) From 5187d8322a4bb757836d92f283e625cea472929f Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Wed, 26 Apr 2017 10:39:52 -0300 Subject: [PATCH 10/27] =?UTF-8?q?A=C3=B1o=20default=20al=20actual?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SireCu/DBSireCu.sdf | Bin 294912 -> 360448 bytes SireCu/OtrasFunciones.vb | 2 +- SireCu/SireCu.vbproj | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SireCu/DBSireCu.sdf b/SireCu/DBSireCu.sdf index 40a759d52872010acd70a4314d1e5f7080fec44c..9e1d0e1e918e45ce08493b6b4aab138db9dad423 100644 GIT binary patch delta 2455 zcmcIleQZ-z6hHUf)2)y3+Sk#o>s!~gV{F0(>u?MPOuCPX(+P}CKoA(=TLX59gapW} z;2(VI=8|1Nkij3-D8fb~4}y_J6Js>M7Ss?VPz;F}A_I+yiBUZ7wcAuMAx3Y~*K^N3 z=iGaK=XdXkMA9RX%<)^!YFB{97UN?Kxe^%tEtAZdDI3y=Vt~T-@h?j@spr^SRytAx zI5ZOAJz6t-&u_E9$r6C9CW~Qi%Bfa>%_Q&S01G-wC6~ox3xEJA5Mkg2$b&Wj zCqM=?Ga#&aLo#GxTE! z5I$g!Mx<_e+FREBH3ZTzu{b2Tbl)5)ZjT0eKz{7ko9`Dx z(h1gJPOA0l7U?5fG{PhD&NaSSDP&zQcJ1f<17wRt?gf5bUh!k+*)bGqhc5T=&n(tw6UK#u#{6r(9IXoz+OdP$ zy_fkKi+uHDg{6W(>KbB_eD#($Cxcid>v9|0$SlSkWBT0}@w;K7%QtRqe7BnX4z~AX z+4^cA)S_sN281Faa*aEwR;TT`KJxw2QBqk&mix@Q4S#Z=R%ENVfO*96LUh|S#cKvo zx~rkFK)k8qQm!dJ@tcZkESk-)XySPXuCizfCs7@X^GVEC3Pfo-E@F9NPdY9W#|m+T z_$3|Ja}OD<9fh0HJc=h7*&%#&I95dJ(JFGCIGw^5h$T)uV%ij#yQhnmQCJ|(IngP) zoY-t3cbhD{Mc7K_kBFj7Y$ctSJP#M)YC4##80*M|%qCmW3hy3!K4K<%5*hV4NDeCsgQbU|yO{En{qaC#~k7Z5m$3bFD3 z!JgpMY@^LXKM-6o&?WUjg2NddmqI!q%$blUp++0D`nV5lw3Dykdl`s z5hV$Cy{;S?Gn0RMGX9iIJ~RdQrVS^bDjLesEe2eeBQCgztOXVLHmws&%%i6y*5g@3 zAayEs(*DF6aiJDB8+@USXNPbxX$_|AnTBtWXwXA>9Je$5XeBmDCA-RgZbeEmH~H|x zofK~+{vkjS31XI*;lpwA2)dt{v{EHD1#vF(=;wksozWHssSI3* z#6DZ%F_1;rL3ijrd>oU^D|R8PrzbQ-cgkm{CAsl|r?8Pk+W28#iHmMr z^3eCqxMb?z7^H~_v$2deHAu92HtuW4|Ki4RqvPcyL1pl-yD2@S0L5lEO~1dJiY;B- vGn$HEj=%KH3V;XpP4{C->*&Xq&6c?-IiHnmnPF6QUzo-15A*G4Q{#UCiBJy( delta 714 zcmYLHO-L0{6#mZK`+i3A%{)uxDduRJP-!EX_=)WiGm7&m|yth!6`d46xU*?%ZA4lH#Vwon_m6HyNc_vos-r%@Lqv-C~Nq~l(W ztXS#z4BySuV(J6i92i;3$xPHU6|${Md$*m#SxdaQk}TwvPQqh?bD*2;qxK*-OUs;Isfj79G;GI`Jcd^kk2PA zlZ|^0bJVX7+9K`pa&!M_>f9PW{bjN-JnCnt0ciw_Lr%044p0o#A`6rN34DhHM?Gc$ zDU~v$33ANcFbGl_m9Pr8M2=7cG$UI;6vHm7uc-rCA?x=7ZQ(KdfL<6JwiJq#o^QLy cwUkWet)}xiLMG#X - PreserveNewest + Always From bf405e0e567dc0309b5098f95185ccc06be1ff7b Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Wed, 26 Apr 2017 18:51:34 -0300 Subject: [PATCH 11/27] Soft Delete en Egresos --- SireCu/Clases/Egreso.vb | 17 +++- SireCu/DBSireCu.sdf | Bin 360448 -> 360448 bytes SireCu/OtrasFunciones.vb | 8 +- SireCu/Paneles/ABMEgresos.Designer.vb | 114 +++++++++++++++----------- SireCu/Paneles/ABMEgresos.resx | 48 +++++++++++ SireCu/Paneles/ABMEgresos.vb | 18 +++- SireCu/SireCu.vbproj | 2 +- 7 files changed, 146 insertions(+), 61 deletions(-) diff --git a/SireCu/Clases/Egreso.vb b/SireCu/Clases/Egreso.vb index 4ae3a5e..4ccb4c6 100644 --- a/SireCu/Clases/Egreso.vb +++ b/SireCu/Clases/Egreso.vb @@ -6,9 +6,9 @@ Module Egreso ByVal fecha As Date, ByVal tipo_comp As String, ByVal secc As String, ByVal reintegro As Date, ByVal monto As Double, ByVal comentario As String) Principal.query = "INSERT INTO egresos (nro_comprobante, proveedor_id, categoria_gasto_id, persona_id, " & - "fecha, tipo_comprobante_id, seccional_id, mes_reintegro, monto, comentario)" & + "fecha, tipo_comprobante_id, seccional_id, mes_reintegro, monto, comentario, eliminado)" & "VALUES (@nro_comprobante, @proveedor, @cat_gasto, @persona, @fecha, @t_comprobante, " & - "@seccional, @reintegro, @monto, @comentario)" + "@seccional, @reintegro, @monto, @comentario, 0)" Principal.command.Parameters.Clear() Principal.command.Parameters.AddWithValue("@nro_comprobante", compro) Principal.command.Parameters.AddWithValue("@proveedor", proveedor) @@ -52,8 +52,16 @@ Module Egreso End If End Sub - Public Sub eliminar_egreso() + Public Sub eliminar_egreso(ByVal id As Integer) + Principal.query = "UPDATE Egresos SET eliminado = 1 WHERE id = @id" + Principal.command.Parameters.Clear() + Principal.command.Parameters.AddWithValue("@id", id) + If consultarNQ(Principal.query, Principal.command) > 0 Then + MsgBox("Egreso eliminado exitosamente", MsgBoxStyle.OkOnly, "Eliminar Egreso") + Else + MsgBox("Ocurrio un error al eliminar el egreso", MsgBoxStyle.Exclamation, "Eliminar Egreso") + End If End Sub Public Sub CargardDGV(ByRef dgv As DataGridView) @@ -87,7 +95,8 @@ Module Egreso LEFT JOIN Proveedores AS Pro ON E.proveedor_id = Pro.id LEFT JOIN CategoriasGastos AS Gastos ON E.categoria_gasto_id = Gastos.id LEFT JOIN Personas AS Per ON E.persona_id = Per.id - LEFT JOIN Seccionales AS Secc ON E.seccional_id = Secc.id" + LEFT JOIN Seccionales AS Secc ON E.seccional_id = Secc.id + WHERE E.eliminado = 0" 'Creamos el TableAdapter si no existe If Not Principal.tableadapters.ContainsKey("Egresos_Modificar") Then diff --git a/SireCu/DBSireCu.sdf b/SireCu/DBSireCu.sdf index 9e1d0e1e918e45ce08493b6b4aab138db9dad423..87012aee574bfa6f286151b871fd68dafa37296d 100644 GIT binary patch delta 769 zcmYjPO-NKx6#nkd^qg_#%^NkR@dwRJT_`<`tkA(39h-6yFRT`|NKq5RoN{PWN{tw~b$k7P2KWs{q=G$e!4<~S6WOJ|Xnl>C%f!-^&T%i?v z3xEj`#~IKcZ>C;bw31;l84D&|mz0D;6#Mv>Ctn#?F`2Y0QDPqxpNiz+ z8h1>qB%xBxeq{dWHxCcsqG=D1I448qoe&u)OkAU?_r~#iA9jg5(UAql0SSjqug=2U zh)gkCeHF6VJrH>dbf6H0|H|`8xIvAp-K5fAq?cgh>K+~+ibkRs8XY-3GS)vBfzT>Y zCrr;~AEyB!)&d>m+8!^i$2J>C_XvN>$sDmZ1kY0M+<>j@2Z!*>bnfpMMZ;dm)BbvBof$YBN1cWX&C0Dws~OM2au` E0eLH@nE(I) delta 688 zcmYjOJ!lhQ7=FH=#Je^zxnk2^TGNXP(bCY1gHo(*VvU7bOQfZUi*XPaK{Gft!>QQ8 z3QY)dOR-%%s4lIco+8*Rx>ZiPiI6xrxQMt3Lj3LyN}l2Sp6`91=Y8*e&oE+!5lfeM z7y#w5%f$rXf$D#a%7-d9IrMc;y-E|%34iN z&Wecr^Z{?NdZDt`wX73Mrv>@X?%mBXUc~e2cK=~#3i(o4B?8DBrqN_a>RRJnglPnJ zdzBJh9^QX@Ye49a3%#AJkY>bkM46Snuc1*9rd~KpMObIW$wagF-vrM>4B|oM;!_=e zIqtkIcUdleSwJ-9b8XJQ_4{?D@gcI{Q2KIx?=gjj?t{H%Il{m>w193Pi3T8Q2VoE- zfD@eSHOy((aaVNvSQ0YRu?ItDfFPN3fq{lwX_&g(ddnL$! zQfbx~ggXSAGXFuzoV^<2B__Z4yK^Qk$}ZY+f%h>oX(#8o!lX;SG0|bXy~rIVP5X&s X9f>>F`D;#Q%%L0n`?A9 True + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + \ No newline at end of file diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index af78e3b..0a77443 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -91,6 +91,7 @@ Public Class ABMEgresos limpiarForm(TabPageAgregar) dtpReintegro.Checked = False + CargardDGV(DGVModificar) ActualizarSaldo() End If @@ -205,6 +206,19 @@ Public Class ABMEgresos End Sub + Private Sub ButtonEliminar_Click(sender As Object, e As EventArgs) Handles ButtonEliminar.Click + If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Eliminar?") = MsgBoxResult.Ok) Then + + eliminar_egreso(idModificando) + + idModificando = 0 + limpiarForm(SplitContainerModificar.Panel2) + activarModificar(False) + CargardDGV(DGVModificar) + ActualizarSaldo() + End If + End Sub + #End Region #Region "Eventos" @@ -300,6 +314,7 @@ Public Class ABMEgresos End If Next ButtonGuardar.Enabled = True + ButtonEliminar.Enabled = True Else For Each control As Control In SplitContainerModificar.Panel2.Controls If TypeOf control Is TextBox Or TypeOf control Is ComboBox Or TypeOf control Is DateTimePicker Then @@ -307,6 +322,7 @@ Public Class ABMEgresos End If Next ButtonGuardar.Enabled = False + ButtonEliminar.Enabled = False End If End Sub @@ -585,8 +601,6 @@ Public Class ABMEgresos End If End Sub - - #End Region End Class \ No newline at end of file diff --git a/SireCu/SireCu.vbproj b/SireCu/SireCu.vbproj index 79a5f5d..d8aa3d2 100644 --- a/SireCu/SireCu.vbproj +++ b/SireCu/SireCu.vbproj @@ -226,7 +226,7 @@ - Always + PreserveNewest From c383b502c0e8938cf2390d99c77779751903ad5e Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Thu, 27 Apr 2017 15:59:16 -0300 Subject: [PATCH 12/27] Restaurar Egresos de Papelera --- SireCu/Clases/Egreso.vb | 62 +-- SireCu/Paneles/ABMEgresos.Designer.vb | 533 +++++++++++++++++++++++++- SireCu/Paneles/ABMEgresos.resx | 96 +++++ SireCu/Paneles/ABMEgresos.vb | 59 +++ SireCu/Principal.Designer.vb | 27 +- 5 files changed, 733 insertions(+), 44 deletions(-) diff --git a/SireCu/Clases/Egreso.vb b/SireCu/Clases/Egreso.vb index 4ccb4c6..db26aeb 100644 --- a/SireCu/Clases/Egreso.vb +++ b/SireCu/Clases/Egreso.vb @@ -64,14 +64,26 @@ Module Egreso End If End Sub - Public Sub CargardDGV(ByRef dgv As DataGridView) + Public Sub restaurar_egreso(ByVal id As Integer) + Principal.query = "UPDATE Egresos SET eliminado = 0 WHERE id = @id" + Principal.command.Parameters.Clear() + Principal.command.Parameters.AddWithValue("@id", id) + + If consultarNQ(Principal.query, Principal.command) > 0 Then + MsgBox("Egreso restaurado exitosamente", MsgBoxStyle.OkOnly, "Restaurar Egreso") + Else + MsgBox("Ocurrio un error al restaurar el egreso", MsgBoxStyle.Exclamation, "Restaurar Egreso") + End If + End Sub + + Public Sub CargardDGV(ByRef dgv As DataGridView, Optional ByVal eliminado As Integer = 0, Optional ByVal nombreDataSet As String = "Egresos_Modificar") 'Creamos la tabla si no existe - If Not Principal.dataset.Tables.Contains("Egresos_Modificar") Then - Principal.dataset.Tables.Add("Egresos_Modificar") + If Not Principal.dataset.Tables.Contains(nombreDataSet) Then + Principal.dataset.Tables.Add(nombreDataSet) End If 'Limpiamos la tabla - Principal.dataset.Tables("Egresos_Modificar").Clear() + Principal.dataset.Tables(nombreDataSet).Clear() 'Creamos el query Principal.command.CommandText = "SELECT E.id AS id, @@ -96,37 +108,37 @@ Module Egreso LEFT JOIN CategoriasGastos AS Gastos ON E.categoria_gasto_id = Gastos.id LEFT JOIN Personas AS Per ON E.persona_id = Per.id LEFT JOIN Seccionales AS Secc ON E.seccional_id = Secc.id - WHERE E.eliminado = 0" + WHERE E.eliminado = " & eliminado 'Creamos el TableAdapter si no existe - If Not Principal.tableadapters.ContainsKey("Egresos_Modificar") Then - Principal.tableadapters.Add("Egresos_Modificar", New SqlCeDataAdapter(Principal.command)) + If Not Principal.tableadapters.ContainsKey(nombreDataSet) Then + Principal.tableadapters.Add(nombreDataSet, New SqlCeDataAdapter(Principal.command)) End If 'Actualizamos el contenido de la tabla - Principal.tableadapters("Egresos_Modificar").Fill(Principal.dataset.Tables.Item("Egresos_Modificar")) + Principal.tableadapters(nombreDataSet).Fill(Principal.dataset.Tables.Item(nombreDataSet)) 'Asignamos el Bind - Dim mybinding = New BindingSource(Principal.dataset, "Egresos_Modificar") + Dim mybinding = New BindingSource(Principal.dataset, nombreDataSet) dgv.AutoGenerateColumns = False - dgv.Columns.Item("id").DataPropertyName = "id" - dgv.Columns.Item("nro_comprobante").DataPropertyName = "nro_comprobante" - dgv.Columns.Item("tipo_comprobante_id").DataPropertyName = "tipo_comprobante_id" - dgv.Columns.Item("tipo_comprobante_nombre").DataPropertyName = "tipo_comprobante_nombre" - dgv.Columns.Item("proveedor_id").DataPropertyName = "proveedor_id" - dgv.Columns.Item("proveedor_nombre").DataPropertyName = "proveedor_nombre" - dgv.Columns.Item("categoria_gasto_id").DataPropertyName = "categoria_gasto_id" - dgv.Columns.Item("categoria_nombre").DataPropertyName = "categoria_nombre" - dgv.Columns.Item("persona_id").DataPropertyName = "persona_id" - dgv.Columns.Item("persona_nombre").DataPropertyName = "persona_nombre" - dgv.Columns.Item("fecha").DataPropertyName = "fecha" - dgv.Columns.Item("seccional_id").DataPropertyName = "seccional_id" - dgv.Columns.Item("seccional_nombre").DataPropertyName = "seccional_nombre" - dgv.Columns.Item("mes_reintegro").DataPropertyName = "mes_reintegro" - dgv.Columns.Item("monto").DataPropertyName = "monto" - dgv.Columns.Item("comentario").DataPropertyName = "comentario" + dgv.Columns.Item(0).DataPropertyName = "id" + dgv.Columns.Item(1).DataPropertyName = "nro_comprobante" + dgv.Columns.Item(2).DataPropertyName = "tipo_comprobante_id" + dgv.Columns.Item(3).DataPropertyName = "tipo_comprobante_nombre" + dgv.Columns.Item(4).DataPropertyName = "proveedor_id" + dgv.Columns.Item(5).DataPropertyName = "proveedor_nombre" + dgv.Columns.Item(6).DataPropertyName = "categoria_gasto_id" + dgv.Columns.Item(7).DataPropertyName = "categoria_nombre" + dgv.Columns.Item(8).DataPropertyName = "persona_id" + dgv.Columns.Item(9).DataPropertyName = "persona_nombre" + dgv.Columns.Item(10).DataPropertyName = "fecha" + dgv.Columns.Item(11).DataPropertyName = "seccional_id" + dgv.Columns.Item(12).DataPropertyName = "seccional_nombre" + dgv.Columns.Item(13).DataPropertyName = "mes_reintegro" + dgv.Columns.Item(14).DataPropertyName = "monto" + dgv.Columns.Item(15).DataPropertyName = "comentario" dgv.DataSource = mybinding End Sub diff --git a/SireCu/Paneles/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb index b8e51bc..a959083 100644 --- a/SireCu/Paneles/ABMEgresos.Designer.vb +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -68,6 +68,7 @@ Partial Class ABMEgresos Me.mes_reintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.monto = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.comentario = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.ButtonEliminar = New System.Windows.Forms.Button() Me.LabelSeccional = New System.Windows.Forms.Label() Me.ComboBoxSeccional = New System.Windows.Forms.ComboBox() Me.DateTimePickerMesReintegro = New System.Windows.Forms.DateTimePicker() @@ -91,7 +92,49 @@ Partial Class ABMEgresos Me.Label12 = New System.Windows.Forms.Label() Me.TextBoxComentario = New System.Windows.Forms.TextBox() Me.TextBoxProveedor = New System.Windows.Forms.TextBox() - Me.ButtonEliminar = New System.Windows.Forms.Button() + Me.TabPagePapelera = New System.Windows.Forms.TabPage() + Me.SplitContainerPapelera = New System.Windows.Forms.SplitContainer() + Me.ToolStripContainerPapelera = New System.Windows.Forms.ToolStripContainer() + Me.DGVPapelera = New System.Windows.Forms.DataGridView() + Me.bPapeleraRestaurar = New System.Windows.Forms.Button() + Me.Label2 = New System.Windows.Forms.Label() + Me.dtpPapeleraReintegro = New System.Windows.Forms.DateTimePicker() + Me.Label3 = New System.Windows.Forms.Label() + Me.dtpPapeleraFecha = New System.Windows.Forms.DateTimePicker() + Me.tbPapeleraNComprobante = New System.Windows.Forms.TextBox() + Me.tbPapeleraPVenta = New System.Windows.Forms.TextBox() + Me.Label13 = New System.Windows.Forms.Label() + Me.Label14 = New System.Windows.Forms.Label() + Me.tbPapeleraMonto = New System.Windows.Forms.TextBox() + Me.Label15 = New System.Windows.Forms.Label() + Me.tbPapeleraNombre = New System.Windows.Forms.TextBox() + Me.Label16 = New System.Windows.Forms.Label() + Me.Label17 = New System.Windows.Forms.Label() + Me.Label18 = New System.Windows.Forms.Label() + Me.Label19 = New System.Windows.Forms.Label() + Me.Label20 = New System.Windows.Forms.Label() + Me.Label21 = New System.Windows.Forms.Label() + Me.tbPapeleraComentario = New System.Windows.Forms.TextBox() + Me.tbPapeleraProveedor = New System.Windows.Forms.TextBox() + Me.tbPapeleraTipoGasto = New System.Windows.Forms.TextBox() + Me.tbPapeleraSeccional = New System.Windows.Forms.TextBox() + Me.tbPapeleraTipoComprobante = New System.Windows.Forms.TextBox() + Me.PapeleraId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraNroComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraTComprobanteId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraTipoComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraProveedorId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraProveedor = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraCategoriaGastoId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraCategoriaGasto = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraPersonaId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraPersona = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraFecha = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraSeccionalId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraSeccional = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraReintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraMonto = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraComentario = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.TabControl.SuspendLayout() Me.TabPageAgregar.SuspendLayout() Me.TabPageModificar.SuspendLayout() @@ -102,12 +145,21 @@ Partial Class ABMEgresos Me.ToolStripContainerModificar.ContentPanel.SuspendLayout() Me.ToolStripContainerModificar.SuspendLayout() CType(Me.DGVModificar, System.ComponentModel.ISupportInitialize).BeginInit() + Me.TabPagePapelera.SuspendLayout() + CType(Me.SplitContainerPapelera, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerPapelera.Panel1.SuspendLayout() + Me.SplitContainerPapelera.Panel2.SuspendLayout() + Me.SplitContainerPapelera.SuspendLayout() + Me.ToolStripContainerPapelera.ContentPanel.SuspendLayout() + Me.ToolStripContainerPapelera.SuspendLayout() + CType(Me.DGVPapelera, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'TabControl ' Me.TabControl.Controls.Add(Me.TabPageAgregar) Me.TabControl.Controls.Add(Me.TabPageModificar) + Me.TabControl.Controls.Add(Me.TabPagePapelera) Me.TabControl.Dock = System.Windows.Forms.DockStyle.Fill Me.TabControl.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TabControl.Location = New System.Drawing.Point(0, 0) @@ -115,6 +167,7 @@ Partial Class ABMEgresos Me.TabControl.SelectedIndex = 0 Me.TabControl.Size = New System.Drawing.Size(755, 456) Me.TabControl.TabIndex = 0 + Me.TabControl.TabStop = False ' 'TabPageAgregar ' @@ -558,6 +611,17 @@ Partial Class ABMEgresos Me.comentario.Name = "comentario" Me.comentario.ReadOnly = True ' + 'ButtonEliminar + ' + Me.ButtonEliminar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.ButtonEliminar.ForeColor = System.Drawing.Color.Red + Me.ButtonEliminar.Location = New System.Drawing.Point(529, 182) + Me.ButtonEliminar.Name = "ButtonEliminar" + Me.ButtonEliminar.Size = New System.Drawing.Size(163, 31) + Me.ButtonEliminar.TabIndex = 103 + Me.ButtonEliminar.Text = "Eliminar" + Me.ButtonEliminar.UseVisualStyleBackColor = True + ' 'LabelSeccional ' Me.LabelSeccional.AutoSize = True @@ -770,16 +834,412 @@ Partial Class ABMEgresos Me.TextBoxProveedor.Size = New System.Drawing.Size(197, 22) Me.TextBoxProveedor.TabIndex = 93 ' - 'ButtonEliminar + 'TabPagePapelera + ' + Me.TabPagePapelera.Controls.Add(Me.SplitContainerPapelera) + Me.TabPagePapelera.Location = New System.Drawing.Point(4, 25) + Me.TabPagePapelera.Name = "TabPagePapelera" + Me.TabPagePapelera.Padding = New System.Windows.Forms.Padding(3) + Me.TabPagePapelera.Size = New System.Drawing.Size(747, 427) + Me.TabPagePapelera.TabIndex = 2 + Me.TabPagePapelera.Text = "Papelera" + Me.TabPagePapelera.UseVisualStyleBackColor = True + ' + 'SplitContainerPapelera + ' + Me.SplitContainerPapelera.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainerPapelera.Location = New System.Drawing.Point(3, 3) + Me.SplitContainerPapelera.Name = "SplitContainerPapelera" + Me.SplitContainerPapelera.Orientation = System.Windows.Forms.Orientation.Horizontal + ' + 'SplitContainerPapelera.Panel1 + ' + Me.SplitContainerPapelera.Panel1.Controls.Add(Me.ToolStripContainerPapelera) + ' + 'SplitContainerPapelera.Panel2 + ' + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraTipoComprobante) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraSeccional) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraTipoGasto) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraRestaurar) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label2) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.dtpPapeleraReintegro) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label3) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.dtpPapeleraFecha) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraNComprobante) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraPVenta) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label13) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label14) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraMonto) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label15) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraNombre) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label16) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label17) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label18) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label19) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label20) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label21) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraComentario) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraProveedor) + Me.SplitContainerPapelera.Size = New System.Drawing.Size(741, 421) + Me.SplitContainerPapelera.SplitterDistance = 201 + Me.SplitContainerPapelera.TabIndex = 1 + ' + 'ToolStripContainerPapelera + ' + ' + 'ToolStripContainerPapelera.ContentPanel + ' + Me.ToolStripContainerPapelera.ContentPanel.Controls.Add(Me.DGVPapelera) + Me.ToolStripContainerPapelera.ContentPanel.Size = New System.Drawing.Size(741, 176) + Me.ToolStripContainerPapelera.Dock = System.Windows.Forms.DockStyle.Fill + Me.ToolStripContainerPapelera.Location = New System.Drawing.Point(0, 0) + Me.ToolStripContainerPapelera.Name = "ToolStripContainerPapelera" + Me.ToolStripContainerPapelera.Size = New System.Drawing.Size(741, 201) + Me.ToolStripContainerPapelera.TabIndex = 0 + Me.ToolStripContainerPapelera.Text = "ToolStripContainer1" + ' + 'DGVPapelera + ' + Me.DGVPapelera.AllowUserToAddRows = False + Me.DGVPapelera.AllowUserToDeleteRows = False + Me.DGVPapelera.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DGVPapelera.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.PapeleraId, Me.PapeleraNroComprobante, Me.PapeleraTComprobanteId, Me.PapeleraTipoComprobante, Me.PapeleraProveedorId, Me.PapeleraProveedor, Me.PapeleraCategoriaGastoId, Me.PapeleraCategoriaGasto, Me.PapeleraPersonaId, Me.PapeleraPersona, Me.PapeleraFecha, Me.PapeleraSeccionalId, Me.PapeleraSeccional, Me.PapeleraReintegro, Me.PapeleraMonto, Me.PapeleraComentario}) + Me.DGVPapelera.Dock = System.Windows.Forms.DockStyle.Fill + Me.DGVPapelera.Location = New System.Drawing.Point(0, 0) + Me.DGVPapelera.Name = "DGVPapelera" + Me.DGVPapelera.ReadOnly = True + Me.DGVPapelera.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DGVPapelera.Size = New System.Drawing.Size(741, 176) + Me.DGVPapelera.TabIndex = 0 + ' + 'bPapeleraRestaurar + ' + Me.bPapeleraRestaurar.Enabled = False + Me.bPapeleraRestaurar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.bPapeleraRestaurar.ForeColor = System.Drawing.Color.Red + Me.bPapeleraRestaurar.Location = New System.Drawing.Point(529, 157) + Me.bPapeleraRestaurar.Name = "bPapeleraRestaurar" + Me.bPapeleraRestaurar.Size = New System.Drawing.Size(163, 56) + Me.bPapeleraRestaurar.TabIndex = 103 + Me.bPapeleraRestaurar.Text = "Restaurar" + Me.bPapeleraRestaurar.UseVisualStyleBackColor = True + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(22, 130) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(68, 16) + Me.Label2.TabIndex = 119 + Me.Label2.Text = "Seccional" + ' + 'dtpPapeleraReintegro + ' + Me.dtpPapeleraReintegro.Checked = False + Me.dtpPapeleraReintegro.CustomFormat = "MM/yyyy" + Me.dtpPapeleraReintegro.Enabled = False + Me.dtpPapeleraReintegro.Format = System.Windows.Forms.DateTimePickerFormat.Custom + Me.dtpPapeleraReintegro.Location = New System.Drawing.Point(145, 99) + Me.dtpPapeleraReintegro.Name = "dtpPapeleraReintegro" + Me.dtpPapeleraReintegro.ShowCheckBox = True + Me.dtpPapeleraReintegro.ShowUpDown = True + Me.dtpPapeleraReintegro.Size = New System.Drawing.Size(197, 22) + Me.dtpPapeleraReintegro.TabIndex = 94 + Me.dtpPapeleraReintegro.Value = New Date(2017, 3, 4, 19, 31, 9, 0) + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(383, 16) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(49, 16) + Me.Label3.TabIndex = 116 + Me.Label3.Text = "Fecha:" + ' + 'dtpPapeleraFecha + ' + Me.dtpPapeleraFecha.CustomFormat = "" + Me.dtpPapeleraFecha.Enabled = False + Me.dtpPapeleraFecha.Format = System.Windows.Forms.DateTimePickerFormat.[Short] + Me.dtpPapeleraFecha.Location = New System.Drawing.Point(529, 13) + Me.dtpPapeleraFecha.Name = "dtpPapeleraFecha" + Me.dtpPapeleraFecha.Size = New System.Drawing.Size(163, 22) + Me.dtpPapeleraFecha.TabIndex = 96 + Me.dtpPapeleraFecha.Value = New Date(2017, 3, 4, 19, 31, 9, 0) + ' + 'tbPapeleraNComprobante + ' + Me.tbPapeleraNComprobante.Enabled = False + Me.tbPapeleraNComprobante.Location = New System.Drawing.Point(595, 71) + Me.tbPapeleraNComprobante.Name = "tbPapeleraNComprobante" + Me.tbPapeleraNComprobante.Size = New System.Drawing.Size(97, 22) + Me.tbPapeleraNComprobante.TabIndex = 99 + ' + 'tbPapeleraPVenta + ' + Me.tbPapeleraPVenta.Enabled = False + Me.tbPapeleraPVenta.Location = New System.Drawing.Point(529, 71) + Me.tbPapeleraPVenta.Name = "tbPapeleraPVenta" + Me.tbPapeleraPVenta.Size = New System.Drawing.Size(56, 22) + Me.tbPapeleraPVenta.TabIndex = 98 + ' + 'Label13 + ' + Me.Label13.AutoSize = True + Me.Label13.Location = New System.Drawing.Point(508, 102) + Me.Label13.Name = "Label13" + Me.Label13.Size = New System.Drawing.Size(15, 16) + Me.Label13.TabIndex = 114 + Me.Label13.Text = "$" + ' + 'Label14 + ' + Me.Label14.AutoSize = True + Me.Label14.Location = New System.Drawing.Point(383, 44) + Me.Label14.Name = "Label14" + Me.Label14.Size = New System.Drawing.Size(140, 16) + Me.Label14.TabIndex = 113 + Me.Label14.Text = "Tipo de Comprobante" + ' + 'tbPapeleraMonto + ' + Me.tbPapeleraMonto.Enabled = False + Me.tbPapeleraMonto.Location = New System.Drawing.Point(529, 99) + Me.tbPapeleraMonto.Name = "tbPapeleraMonto" + Me.tbPapeleraMonto.Size = New System.Drawing.Size(163, 22) + Me.tbPapeleraMonto.TabIndex = 100 + Me.tbPapeleraMonto.Tag = "" + ' + 'Label15 + ' + Me.Label15.AutoSize = True + Me.Label15.Location = New System.Drawing.Point(22, 44) + Me.Label15.Name = "Label15" + Me.Label15.Size = New System.Drawing.Size(63, 16) + Me.Label15.TabIndex = 112 + Me.Label15.Text = "Gasto de" + ' + 'tbPapeleraNombre + ' + Me.tbPapeleraNombre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.tbPapeleraNombre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.tbPapeleraNombre.BackColor = System.Drawing.SystemColors.Window + Me.tbPapeleraNombre.Enabled = False + Me.tbPapeleraNombre.Location = New System.Drawing.Point(145, 13) + Me.tbPapeleraNombre.Name = "tbPapeleraNombre" + Me.tbPapeleraNombre.Size = New System.Drawing.Size(197, 22) + Me.tbPapeleraNombre.TabIndex = 91 + ' + 'Label16 + ' + Me.Label16.AutoSize = True + Me.Label16.Location = New System.Drawing.Point(22, 101) + Me.Label16.Name = "Label16" + Me.Label16.Size = New System.Drawing.Size(115, 16) + Me.Label16.TabIndex = 111 + Me.Label16.Text = "Mes de Reintegro" + ' + 'Label17 + ' + Me.Label17.AutoSize = True + Me.Label17.Location = New System.Drawing.Point(22, 161) + Me.Label17.Name = "Label17" + Me.Label17.Size = New System.Drawing.Size(77, 16) + Me.Label17.TabIndex = 110 + Me.Label17.Text = "Comentario" + ' + 'Label18 + ' + Me.Label18.AutoSize = True + Me.Label18.Location = New System.Drawing.Point(383, 102) + Me.Label18.Name = "Label18" + Me.Label18.Size = New System.Drawing.Size(45, 16) + Me.Label18.TabIndex = 109 + Me.Label18.Text = "Monto" + ' + 'Label19 + ' + Me.Label19.AutoSize = True + Me.Label19.Location = New System.Drawing.Point(22, 74) + Me.Label19.Name = "Label19" + Me.Label19.Size = New System.Drawing.Size(72, 16) + Me.Label19.TabIndex = 108 + Me.Label19.Text = "Proveedor" + ' + 'Label20 + ' + Me.Label20.AutoSize = True + Me.Label20.Location = New System.Drawing.Point(22, 16) + Me.Label20.Name = "Label20" + Me.Label20.Size = New System.Drawing.Size(120, 16) + Me.Label20.TabIndex = 107 + Me.Label20.Text = "Nombre y Apellido" + ' + 'Label21 + ' + Me.Label21.AutoSize = True + Me.Label21.Location = New System.Drawing.Point(383, 74) + Me.Label21.Name = "Label21" + Me.Label21.Size = New System.Drawing.Size(107, 16) + Me.Label21.TabIndex = 106 + Me.Label21.Text = "N° Comprobante" + ' + 'tbPapeleraComentario + ' + Me.tbPapeleraComentario.Enabled = False + Me.tbPapeleraComentario.Location = New System.Drawing.Point(145, 157) + Me.tbPapeleraComentario.Multiline = True + Me.tbPapeleraComentario.Name = "tbPapeleraComentario" + Me.tbPapeleraComentario.Size = New System.Drawing.Size(378, 56) + Me.tbPapeleraComentario.TabIndex = 101 + ' + 'tbPapeleraProveedor + ' + Me.tbPapeleraProveedor.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.tbPapeleraProveedor.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.tbPapeleraProveedor.Enabled = False + Me.tbPapeleraProveedor.Location = New System.Drawing.Point(145, 71) + Me.tbPapeleraProveedor.Name = "tbPapeleraProveedor" + Me.tbPapeleraProveedor.Size = New System.Drawing.Size(197, 22) + Me.tbPapeleraProveedor.TabIndex = 93 + ' + 'tbPapeleraTipoGasto + ' + Me.tbPapeleraTipoGasto.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.tbPapeleraTipoGasto.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.tbPapeleraTipoGasto.BackColor = System.Drawing.SystemColors.Window + Me.tbPapeleraTipoGasto.Enabled = False + Me.tbPapeleraTipoGasto.Location = New System.Drawing.Point(145, 41) + Me.tbPapeleraTipoGasto.Name = "tbPapeleraTipoGasto" + Me.tbPapeleraTipoGasto.Size = New System.Drawing.Size(197, 22) + Me.tbPapeleraTipoGasto.TabIndex = 120 + ' + 'tbPapeleraSeccional + ' + Me.tbPapeleraSeccional.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.tbPapeleraSeccional.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.tbPapeleraSeccional.BackColor = System.Drawing.SystemColors.Window + Me.tbPapeleraSeccional.Enabled = False + Me.tbPapeleraSeccional.Location = New System.Drawing.Point(145, 127) + Me.tbPapeleraSeccional.Name = "tbPapeleraSeccional" + Me.tbPapeleraSeccional.Size = New System.Drawing.Size(197, 22) + Me.tbPapeleraSeccional.TabIndex = 121 ' - Me.ButtonEliminar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.ButtonEliminar.ForeColor = System.Drawing.Color.Red - Me.ButtonEliminar.Location = New System.Drawing.Point(529, 182) - Me.ButtonEliminar.Name = "ButtonEliminar" - Me.ButtonEliminar.Size = New System.Drawing.Size(163, 31) - Me.ButtonEliminar.TabIndex = 103 - Me.ButtonEliminar.Text = "Eliminar" - Me.ButtonEliminar.UseVisualStyleBackColor = True + 'tbPapeleraTipoComprobante + ' + Me.tbPapeleraTipoComprobante.Enabled = False + Me.tbPapeleraTipoComprobante.Location = New System.Drawing.Point(529, 41) + Me.tbPapeleraTipoComprobante.Name = "tbPapeleraTipoComprobante" + Me.tbPapeleraTipoComprobante.Size = New System.Drawing.Size(163, 22) + Me.tbPapeleraTipoComprobante.TabIndex = 122 + Me.tbPapeleraTipoComprobante.Tag = "" + ' + 'PapeleraId + ' + Me.PapeleraId.HeaderText = "Id" + Me.PapeleraId.Name = "PapeleraId" + Me.PapeleraId.ReadOnly = True + ' + 'PapeleraNroComprobante + ' + Me.PapeleraNroComprobante.HeaderText = "Nro Comprobante" + Me.PapeleraNroComprobante.Name = "PapeleraNroComprobante" + Me.PapeleraNroComprobante.ReadOnly = True + ' + 'PapeleraTComprobanteId + ' + Me.PapeleraTComprobanteId.HeaderText = "tipo_comprobante_id" + Me.PapeleraTComprobanteId.Name = "PapeleraTComprobanteId" + Me.PapeleraTComprobanteId.ReadOnly = True + Me.PapeleraTComprobanteId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraTComprobanteId.Visible = False + ' + 'PapeleraTipoComprobante + ' + Me.PapeleraTipoComprobante.HeaderText = "Tipo Comprobante" + Me.PapeleraTipoComprobante.Name = "PapeleraTipoComprobante" + Me.PapeleraTipoComprobante.ReadOnly = True + ' + 'PapeleraProveedorId + ' + Me.PapeleraProveedorId.HeaderText = "proveedor_id" + Me.PapeleraProveedorId.Name = "PapeleraProveedorId" + Me.PapeleraProveedorId.ReadOnly = True + Me.PapeleraProveedorId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraProveedorId.Visible = False + ' + 'PapeleraProveedor + ' + Me.PapeleraProveedor.HeaderText = "Proveedor" + Me.PapeleraProveedor.Name = "PapeleraProveedor" + Me.PapeleraProveedor.ReadOnly = True + ' + 'PapeleraCategoriaGastoId + ' + Me.PapeleraCategoriaGastoId.HeaderText = "categoria_gasto_id" + Me.PapeleraCategoriaGastoId.Name = "PapeleraCategoriaGastoId" + Me.PapeleraCategoriaGastoId.ReadOnly = True + Me.PapeleraCategoriaGastoId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraCategoriaGastoId.Visible = False + ' + 'PapeleraCategoriaGasto + ' + Me.PapeleraCategoriaGasto.HeaderText = "Categoria Gasto" + Me.PapeleraCategoriaGasto.Name = "PapeleraCategoriaGasto" + Me.PapeleraCategoriaGasto.ReadOnly = True + ' + 'PapeleraPersonaId + ' + Me.PapeleraPersonaId.HeaderText = "persona_id" + Me.PapeleraPersonaId.Name = "PapeleraPersonaId" + Me.PapeleraPersonaId.ReadOnly = True + Me.PapeleraPersonaId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraPersonaId.Visible = False + ' + 'PapeleraPersona + ' + Me.PapeleraPersona.HeaderText = "Persona" + Me.PapeleraPersona.Name = "PapeleraPersona" + Me.PapeleraPersona.ReadOnly = True + ' + 'PapeleraFecha + ' + Me.PapeleraFecha.HeaderText = "Fecha" + Me.PapeleraFecha.Name = "PapeleraFecha" + Me.PapeleraFecha.ReadOnly = True + ' + 'PapeleraSeccionalId + ' + Me.PapeleraSeccionalId.HeaderText = "seccional_id" + Me.PapeleraSeccionalId.Name = "PapeleraSeccionalId" + Me.PapeleraSeccionalId.ReadOnly = True + Me.PapeleraSeccionalId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraSeccionalId.Visible = False + ' + 'PapeleraSeccional + ' + Me.PapeleraSeccional.HeaderText = "Seccional" + Me.PapeleraSeccional.Name = "PapeleraSeccional" + Me.PapeleraSeccional.ReadOnly = True + ' + 'PapeleraReintegro + ' + Me.PapeleraReintegro.HeaderText = "Mes Reintegro" + Me.PapeleraReintegro.Name = "PapeleraReintegro" + Me.PapeleraReintegro.ReadOnly = True + ' + 'PapeleraMonto + ' + Me.PapeleraMonto.HeaderText = "Monto" + Me.PapeleraMonto.Name = "PapeleraMonto" + Me.PapeleraMonto.ReadOnly = True + ' + 'PapeleraComentario + ' + Me.PapeleraComentario.HeaderText = "Comentario" + Me.PapeleraComentario.Name = "PapeleraComentario" + Me.PapeleraComentario.ReadOnly = True ' 'ABMEgresos ' @@ -802,6 +1262,16 @@ Partial Class ABMEgresos Me.ToolStripContainerModificar.ResumeLayout(False) Me.ToolStripContainerModificar.PerformLayout() CType(Me.DGVModificar, System.ComponentModel.ISupportInitialize).EndInit() + Me.TabPagePapelera.ResumeLayout(False) + Me.SplitContainerPapelera.Panel1.ResumeLayout(False) + Me.SplitContainerPapelera.Panel2.ResumeLayout(False) + Me.SplitContainerPapelera.Panel2.PerformLayout() + CType(Me.SplitContainerPapelera, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerPapelera.ResumeLayout(False) + Me.ToolStripContainerPapelera.ContentPanel.ResumeLayout(False) + Me.ToolStripContainerPapelera.ResumeLayout(False) + Me.ToolStripContainerPapelera.PerformLayout() + CType(Me.DGVPapelera, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub @@ -876,4 +1346,47 @@ Partial Class ABMEgresos Friend WithEvents dtpFecha As DateTimePicker Friend WithEvents dtpReintegro As DateTimePicker Friend WithEvents ButtonEliminar As Button + Friend WithEvents TabPagePapelera As TabPage + Friend WithEvents SplitContainerPapelera As SplitContainer + Friend WithEvents ToolStripContainerPapelera As ToolStripContainer + Friend WithEvents DGVPapelera As DataGridView + Friend WithEvents bPapeleraRestaurar As Button + Friend WithEvents Label2 As Label + Friend WithEvents dtpPapeleraReintegro As DateTimePicker + Friend WithEvents Label3 As Label + Friend WithEvents dtpPapeleraFecha As DateTimePicker + Friend WithEvents tbPapeleraNComprobante As TextBox + Friend WithEvents tbPapeleraPVenta As TextBox + Friend WithEvents Label13 As Label + Friend WithEvents Label14 As Label + Friend WithEvents tbPapeleraMonto As TextBox + Friend WithEvents Label15 As Label + Friend WithEvents tbPapeleraNombre As TextBox + Friend WithEvents Label16 As Label + Friend WithEvents Label17 As Label + Friend WithEvents Label18 As Label + Friend WithEvents Label19 As Label + Friend WithEvents Label20 As Label + Friend WithEvents Label21 As Label + Friend WithEvents tbPapeleraComentario As TextBox + Friend WithEvents tbPapeleraProveedor As TextBox + Friend WithEvents tbPapeleraTipoComprobante As TextBox + Friend WithEvents tbPapeleraSeccional As TextBox + Friend WithEvents tbPapeleraTipoGasto As TextBox + Friend WithEvents PapeleraId As DataGridViewTextBoxColumn + Friend WithEvents PapeleraNroComprobante As DataGridViewTextBoxColumn + Friend WithEvents PapeleraTComprobanteId As DataGridViewTextBoxColumn + Friend WithEvents PapeleraTipoComprobante As DataGridViewTextBoxColumn + Friend WithEvents PapeleraProveedorId As DataGridViewTextBoxColumn + Friend WithEvents PapeleraProveedor As DataGridViewTextBoxColumn + Friend WithEvents PapeleraCategoriaGastoId As DataGridViewTextBoxColumn + Friend WithEvents PapeleraCategoriaGasto As DataGridViewTextBoxColumn + Friend WithEvents PapeleraPersonaId As DataGridViewTextBoxColumn + Friend WithEvents PapeleraPersona As DataGridViewTextBoxColumn + Friend WithEvents PapeleraFecha As DataGridViewTextBoxColumn + Friend WithEvents PapeleraSeccionalId As DataGridViewTextBoxColumn + Friend WithEvents PapeleraSeccional As DataGridViewTextBoxColumn + Friend WithEvents PapeleraReintegro As DataGridViewTextBoxColumn + Friend WithEvents PapeleraMonto As DataGridViewTextBoxColumn + Friend WithEvents PapeleraComentario As DataGridViewTextBoxColumn End Class diff --git a/SireCu/Paneles/ABMEgresos.resx b/SireCu/Paneles/ABMEgresos.resx index 0d9d1cc..62bb086 100644 --- a/SireCu/Paneles/ABMEgresos.resx +++ b/SireCu/Paneles/ABMEgresos.resx @@ -117,6 +117,54 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + True @@ -213,4 +261,52 @@ True + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + \ No newline at end of file diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index 0a77443..baeb51c 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -7,6 +7,7 @@ Public Class ABMEgresos Dim ControlesConErroresModificar As List(Of Control) = New List(Of Control) Dim idModificando As Integer = 0 + Dim idPapelera As Integer = 0 #Region "TAB Agregar - Eventos" @@ -221,6 +222,62 @@ Public Class ABMEgresos #End Region +#Region "TAB Papelera - Eventos" + Private Sub DGVPapelera_CellMouseDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DGVPapelera.CellMouseDoubleClick + ' Cargar el formulario con los datos para restaurar + Try + idPapelera = CInt(DGVPapelera.Rows(e.RowIndex).Cells("PapeleraId").Value) + + tbPapeleraNombre.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraPersona").Value + tbPapeleraTipoGasto.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraCategoriaGasto").Value + tbPapeleraProveedor.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraProveedor").Value + If DGVPapelera.Rows(e.RowIndex).Cells("PapeleraReintegro").Value Is DBNull.Value Then + dtpPapeleraReintegro.Value = CDate(DGVPapelera.Rows(e.RowIndex).Cells("PapeleraFecha").Value) + dtpPapeleraReintegro.Checked = False + Else + If DGVPapelera.Rows(e.RowIndex).Cells("PapeleraReintegro").Value = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraFecha").Value Then + dtpPapeleraReintegro.Value = CDate(DGVPapelera.Rows(e.RowIndex).Cells("PapeleraReintegro").Value) + dtpPapeleraReintegro.Checked = False + Else + dtpPapeleraReintegro.Value = CDate(DGVPapelera.Rows(e.RowIndex).Cells("PapeleraReintegro").Value) + dtpPapeleraReintegro.Checked = True + End If + End If + tbPapeleraSeccional.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraSeccional").Value + tbPapeleraComentario.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraComentario").Value.ToString + dtpPapeleraFecha.Value = CDate(DGVPapelera.Rows(e.RowIndex).Cells("PapeleraFecha").Value) + tbPapeleraTipoComprobante.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraTipoComprobante").Value + If DGVPapelera.Rows(e.RowIndex).Cells("PapeleraNroComprobante").Value.ToString.Contains("-") Then + tbPapeleraPVenta.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraNroComprobante").Value.ToString.Split("-")(0) + tbPapeleraNComprobante.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraNroComprobante").Value.ToString.Split("-")(1) + Else + tbPapeleraPVenta.Text = "0" + tbPapeleraNComprobante.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraNroComprobante").Value + End If + tbPapeleraMonto.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraMonto").Value + Catch ex As Exception + MessageBox.Show(ex.Message, "Error al cargar el formulario", MessageBoxButtons.OK, MessageBoxIcon.Error) + End Try + + bPapeleraRestaurar.Enabled = True + + End Sub + + Private Sub bPapeleraRestaurar_Click(sender As Object, e As EventArgs) Handles bPapeleraRestaurar.Click + If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Restaurar?") = MsgBoxResult.Ok) Then + + restaurar_egreso(idPapelera) + + idPapelera = 0 + limpiarForm(SplitContainerPapelera.Panel2) + CargardDGV(DGVPapelera, 1, "Egresos_Papelera") + ActualizarSaldo() + bPapeleraRestaurar.Enabled = False + End If + End Sub + +#End Region + #Region "Eventos" Private Sub ABMEgresos_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -283,6 +340,8 @@ Public Class ABMEgresos DateTimePickerFecha.Value = Now + ' ######################################## TAB Papelera + CargardDGV(DGVPapelera, 1, "Egresos_Papelera") End Sub diff --git a/SireCu/Principal.Designer.vb b/SireCu/Principal.Designer.vb index 16ad389..c2efd0c 100644 --- a/SireCu/Principal.Designer.vb +++ b/SireCu/Principal.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class Principal Inherits System.Windows.Forms.Form 'Form reemplaza a Dispose para limpiar la lista de componentes. - _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then @@ -20,7 +20,7 @@ Partial Class Principal 'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento 'Se puede modificar usando el Diseñador de Windows Forms. 'No lo modifique con el editor de código. - _ + Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Principal)) @@ -28,6 +28,7 @@ Partial Class Principal Me.StatusStripPrincipal = New System.Windows.Forms.StatusStrip() Me.stat_Label = New System.Windows.Forms.ToolStripStatusLabel() Me.stat_Bar = New System.Windows.Forms.ToolStripProgressBar() + Me.TStripLabelSaldo = New System.Windows.Forms.ToolStripStatusLabel() Me.SplitContainerPrincipal = New System.Windows.Forms.SplitContainer() Me.RadioButtonEgresos = New System.Windows.Forms.RadioButton() Me.RadioButtonIngresos = New System.Windows.Forms.RadioButton() @@ -41,7 +42,7 @@ Partial Class Principal Me.PersonasToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.SeccionalesToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ErrorProvider = New System.Windows.Forms.ErrorProvider(Me.components) - Me.TStripLabelSaldo = New System.Windows.Forms.ToolStripStatusLabel() + Me.ToolStripStatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel() Me.ToolStripContainerPrincipal.BottomToolStripPanel.SuspendLayout() Me.ToolStripContainerPrincipal.ContentPanel.SuspendLayout() Me.ToolStripContainerPrincipal.TopToolStripPanel.SuspendLayout() @@ -81,7 +82,7 @@ Partial Class Principal 'StatusStripPrincipal ' Me.StatusStripPrincipal.Dock = System.Windows.Forms.DockStyle.None - Me.StatusStripPrincipal.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.stat_Label, Me.stat_Bar, Me.TStripLabelSaldo}) + Me.StatusStripPrincipal.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.stat_Label, Me.stat_Bar, Me.TStripLabelSaldo, Me.ToolStripStatusLabel1}) Me.StatusStripPrincipal.Location = New System.Drawing.Point(0, 0) Me.StatusStripPrincipal.Name = "StatusStripPrincipal" Me.StatusStripPrincipal.Size = New System.Drawing.Size(982, 22) @@ -101,6 +102,12 @@ Partial Class Principal Me.stat_Bar.Size = New System.Drawing.Size(100, 16) Me.stat_Bar.Visible = False ' + 'TStripLabelSaldo + ' + Me.TStripLabelSaldo.Name = "TStripLabelSaldo" + Me.TStripLabelSaldo.Size = New System.Drawing.Size(39, 17) + Me.TStripLabelSaldo.Text = "Saldo:" + ' 'SplitContainerPrincipal ' Me.SplitContainerPrincipal.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D @@ -215,11 +222,12 @@ Partial Class Principal ' Me.ErrorProvider.ContainerControl = Me ' - 'TStripLabelSaldo + 'ToolStripStatusLabel1 ' - Me.TStripLabelSaldo.Name = "TStripLabelSaldo" - Me.TStripLabelSaldo.Size = New System.Drawing.Size(39, 17) - Me.TStripLabelSaldo.Text = "Saldo:" + Me.ToolStripStatusLabel1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripStatusLabel1.Name = "ToolStripStatusLabel1" + Me.ToolStripStatusLabel1.Size = New System.Drawing.Size(0, 17) + Me.ToolStripStatusLabel1.Text = "ToolStripStatusLabel1" ' 'Principal ' @@ -269,4 +277,5 @@ Partial Class Principal Friend WithEvents PersonasToolStripMenuItem As ToolStripMenuItem Friend WithEvents SeccionalesToolStripMenuItem As ToolStripMenuItem Friend WithEvents TStripLabelSaldo As ToolStripStatusLabel + Friend WithEvents ToolStripStatusLabel1 As ToolStripStatusLabel End Class From 6da128f6b62937ffafc0817144e9608a7d25a7d7 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Thu, 27 Apr 2017 18:50:02 -0300 Subject: [PATCH 13/27] Filtro Multiple DGV Modificar --- SireCu/Clases/Egreso.vb | 49 +++- SireCu/Paneles/ABMEgresos.Designer.vb | 378 ++++++++++++++++---------- SireCu/Paneles/ABMEgresos.resx | 115 ++------ SireCu/Paneles/ABMEgresos.vb | 104 ++++++- 4 files changed, 407 insertions(+), 239 deletions(-) diff --git a/SireCu/Clases/Egreso.vb b/SireCu/Clases/Egreso.vb index db26aeb..7a8b9ce 100644 --- a/SireCu/Clases/Egreso.vb +++ b/SireCu/Clases/Egreso.vb @@ -86,7 +86,7 @@ Module Egreso Principal.dataset.Tables(nombreDataSet).Clear() 'Creamos el query - Principal.command.CommandText = "SELECT E.id AS id, + Principal.command.CommandText = "SELECT TOP (500) E.id AS id, E.nro_comprobante AS nro_comprobante, E.tipo_comprobante_id AS tipo_comprobante_id, Comp.nombre AS tipo_comprobante_nombre, @@ -108,7 +108,52 @@ Module Egreso LEFT JOIN CategoriasGastos AS Gastos ON E.categoria_gasto_id = Gastos.id LEFT JOIN Personas AS Per ON E.persona_id = Per.id LEFT JOIN Seccionales AS Secc ON E.seccional_id = Secc.id - WHERE E.eliminado = " & eliminado + WHERE E.eliminado = " & eliminado & " ORDER BY E.id DESC" + + 'Creamos el TableAdapter si no existe + If Not Principal.tableadapters.ContainsKey(nombreDataSet) Then + Principal.tableadapters.Add(nombreDataSet, New SqlCeDataAdapter(Principal.command)) + End If + + 'Actualizamos el contenido de la tabla + Principal.tableadapters(nombreDataSet).Fill(Principal.dataset.Tables.Item(nombreDataSet)) + + 'Asignamos el Bind + Dim mybinding = New BindingSource(Principal.dataset, nombreDataSet) + + dgv.AutoGenerateColumns = False + + dgv.Columns.Item(0).DataPropertyName = "id" + dgv.Columns.Item(1).DataPropertyName = "nro_comprobante" + dgv.Columns.Item(2).DataPropertyName = "tipo_comprobante_id" + dgv.Columns.Item(3).DataPropertyName = "tipo_comprobante_nombre" + dgv.Columns.Item(4).DataPropertyName = "proveedor_id" + dgv.Columns.Item(5).DataPropertyName = "proveedor_nombre" + dgv.Columns.Item(6).DataPropertyName = "categoria_gasto_id" + dgv.Columns.Item(7).DataPropertyName = "categoria_nombre" + dgv.Columns.Item(8).DataPropertyName = "persona_id" + dgv.Columns.Item(9).DataPropertyName = "persona_nombre" + dgv.Columns.Item(10).DataPropertyName = "fecha" + dgv.Columns.Item(11).DataPropertyName = "seccional_id" + dgv.Columns.Item(12).DataPropertyName = "seccional_nombre" + dgv.Columns.Item(13).DataPropertyName = "mes_reintegro" + dgv.Columns.Item(14).DataPropertyName = "monto" + dgv.Columns.Item(15).DataPropertyName = "comentario" + dgv.DataSource = mybinding + + End Sub + + Public Sub FiltrarDGV(ByRef dgv As DataGridView, ByVal sql As String, Optional ByVal eliminado As Integer = 0, Optional ByVal nombreDataSet As String = "Egresos_Modificar") + + 'Creamos la tabla si no existe + If Not Principal.dataset.Tables.Contains(nombreDataSet) Then + Principal.dataset.Tables.Add(nombreDataSet) + End If + 'Limpiamos la tabla + Principal.dataset.Tables(nombreDataSet).Clear() + + 'Creamos el query + Principal.command.CommandText = sql 'Creamos el TableAdapter si no existe If Not Principal.tableadapters.ContainsKey(nombreDataSet) Then diff --git a/SireCu/Paneles/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb index a959083..09674ed 100644 --- a/SireCu/Paneles/ABMEgresos.Designer.vb +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -22,6 +22,7 @@ Partial Class ABMEgresos 'No lo modifique con el editor de código. _ Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ABMEgresos)) Me.TabControl = New System.Windows.Forms.TabControl() Me.TabPageAgregar = New System.Windows.Forms.TabPage() Me.lbFecha = New System.Windows.Forms.Label() @@ -68,6 +69,7 @@ Partial Class ABMEgresos Me.mes_reintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.monto = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.comentario = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.ToolStripModificar = New System.Windows.Forms.ToolStrip() Me.ButtonEliminar = New System.Windows.Forms.Button() Me.LabelSeccional = New System.Windows.Forms.Label() Me.ComboBoxSeccional = New System.Windows.Forms.ComboBox() @@ -96,6 +98,25 @@ Partial Class ABMEgresos Me.SplitContainerPapelera = New System.Windows.Forms.SplitContainer() Me.ToolStripContainerPapelera = New System.Windows.Forms.ToolStripContainer() Me.DGVPapelera = New System.Windows.Forms.DataGridView() + Me.PapeleraId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraNroComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraTComprobanteId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraTipoComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraProveedorId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraProveedor = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraCategoriaGastoId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraCategoriaGasto = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraPersonaId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraPersona = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraFecha = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraSeccionalId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraSeccional = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraReintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraMonto = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraComentario = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.tbPapeleraTipoComprobante = New System.Windows.Forms.TextBox() + Me.tbPapeleraSeccional = New System.Windows.Forms.TextBox() + Me.tbPapeleraTipoGasto = New System.Windows.Forms.TextBox() Me.bPapeleraRestaurar = New System.Windows.Forms.Button() Me.Label2 = New System.Windows.Forms.Label() Me.dtpPapeleraReintegro = New System.Windows.Forms.DateTimePicker() @@ -116,25 +137,14 @@ Partial Class ABMEgresos Me.Label21 = New System.Windows.Forms.Label() Me.tbPapeleraComentario = New System.Windows.Forms.TextBox() Me.tbPapeleraProveedor = New System.Windows.Forms.TextBox() - Me.tbPapeleraTipoGasto = New System.Windows.Forms.TextBox() - Me.tbPapeleraSeccional = New System.Windows.Forms.TextBox() - Me.tbPapeleraTipoComprobante = New System.Windows.Forms.TextBox() - Me.PapeleraId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraNroComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraTComprobanteId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraTipoComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraProveedorId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraProveedor = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraCategoriaGastoId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraCategoriaGasto = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraPersonaId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraPersona = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraFecha = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraSeccionalId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraSeccional = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraReintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraMonto = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraComentario = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.TSLabelTrimestre = New System.Windows.Forms.ToolStripLabel() + Me.TSComboBoxTrimestre = New System.Windows.Forms.ToolStripComboBox() + Me.TSLabelAño = New System.Windows.Forms.ToolStripLabel() + Me.TSTextBoxAño = New System.Windows.Forms.ToolStripTextBox() + Me.TSButtonFiltrar = New System.Windows.Forms.ToolStripButton() + Me.TSLabelFiltro1 = New System.Windows.Forms.ToolStripLabel() + Me.TSComboBoxFiltro1 = New System.Windows.Forms.ToolStripComboBox() + Me.TSTextBoxFiltro1 = New System.Windows.Forms.ToolStripTextBox() Me.TabControl.SuspendLayout() Me.TabPageAgregar.SuspendLayout() Me.TabPageModificar.SuspendLayout() @@ -143,8 +153,10 @@ Partial Class ABMEgresos Me.SplitContainerModificar.Panel2.SuspendLayout() Me.SplitContainerModificar.SuspendLayout() Me.ToolStripContainerModificar.ContentPanel.SuspendLayout() + Me.ToolStripContainerModificar.TopToolStripPanel.SuspendLayout() Me.ToolStripContainerModificar.SuspendLayout() CType(Me.DGVModificar, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ToolStripModificar.SuspendLayout() Me.TabPagePapelera.SuspendLayout() CType(Me.SplitContainerPapelera, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainerPapelera.Panel1.SuspendLayout() @@ -479,18 +491,25 @@ Partial Class ABMEgresos ' 'ToolStripContainerModificar ' + Me.ToolStripContainerModificar.BottomToolStripPanelVisible = False ' 'ToolStripContainerModificar.ContentPanel ' Me.ToolStripContainerModificar.ContentPanel.Controls.Add(Me.DGVModificar) Me.ToolStripContainerModificar.ContentPanel.Size = New System.Drawing.Size(741, 176) Me.ToolStripContainerModificar.Dock = System.Windows.Forms.DockStyle.Fill + Me.ToolStripContainerModificar.LeftToolStripPanelVisible = False Me.ToolStripContainerModificar.Location = New System.Drawing.Point(0, 0) Me.ToolStripContainerModificar.Name = "ToolStripContainerModificar" + Me.ToolStripContainerModificar.RightToolStripPanelVisible = False Me.ToolStripContainerModificar.Size = New System.Drawing.Size(741, 201) Me.ToolStripContainerModificar.TabIndex = 0 Me.ToolStripContainerModificar.Text = "ToolStripContainer1" ' + 'ToolStripContainerModificar.TopToolStripPanel + ' + Me.ToolStripContainerModificar.TopToolStripPanel.Controls.Add(Me.ToolStripModificar) + ' 'DGVModificar ' Me.DGVModificar.AllowUserToAddRows = False @@ -611,6 +630,16 @@ Partial Class ABMEgresos Me.comentario.Name = "comentario" Me.comentario.ReadOnly = True ' + 'ToolStripModificar + ' + Me.ToolStripModificar.Dock = System.Windows.Forms.DockStyle.None + Me.ToolStripModificar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStripModificar.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TSLabelTrimestre, Me.TSComboBoxTrimestre, Me.TSLabelAño, Me.TSTextBoxAño, Me.TSLabelFiltro1, Me.TSComboBoxFiltro1, Me.TSTextBoxFiltro1, Me.TSButtonFiltrar}) + Me.ToolStripModificar.Location = New System.Drawing.Point(3, 0) + Me.ToolStripModificar.Name = "ToolStripModificar" + Me.ToolStripModificar.Size = New System.Drawing.Size(683, 25) + Me.ToolStripModificar.TabIndex = 0 + ' 'ButtonEliminar ' Me.ButtonEliminar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) @@ -913,6 +942,143 @@ Partial Class ABMEgresos Me.DGVPapelera.Size = New System.Drawing.Size(741, 176) Me.DGVPapelera.TabIndex = 0 ' + 'PapeleraId + ' + Me.PapeleraId.HeaderText = "Id" + Me.PapeleraId.Name = "PapeleraId" + Me.PapeleraId.ReadOnly = True + ' + 'PapeleraNroComprobante + ' + Me.PapeleraNroComprobante.HeaderText = "Nro Comprobante" + Me.PapeleraNroComprobante.Name = "PapeleraNroComprobante" + Me.PapeleraNroComprobante.ReadOnly = True + ' + 'PapeleraTComprobanteId + ' + Me.PapeleraTComprobanteId.HeaderText = "tipo_comprobante_id" + Me.PapeleraTComprobanteId.Name = "PapeleraTComprobanteId" + Me.PapeleraTComprobanteId.ReadOnly = True + Me.PapeleraTComprobanteId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraTComprobanteId.Visible = False + ' + 'PapeleraTipoComprobante + ' + Me.PapeleraTipoComprobante.HeaderText = "Tipo Comprobante" + Me.PapeleraTipoComprobante.Name = "PapeleraTipoComprobante" + Me.PapeleraTipoComprobante.ReadOnly = True + ' + 'PapeleraProveedorId + ' + Me.PapeleraProveedorId.HeaderText = "proveedor_id" + Me.PapeleraProveedorId.Name = "PapeleraProveedorId" + Me.PapeleraProveedorId.ReadOnly = True + Me.PapeleraProveedorId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraProveedorId.Visible = False + ' + 'PapeleraProveedor + ' + Me.PapeleraProveedor.HeaderText = "Proveedor" + Me.PapeleraProveedor.Name = "PapeleraProveedor" + Me.PapeleraProveedor.ReadOnly = True + ' + 'PapeleraCategoriaGastoId + ' + Me.PapeleraCategoriaGastoId.HeaderText = "categoria_gasto_id" + Me.PapeleraCategoriaGastoId.Name = "PapeleraCategoriaGastoId" + Me.PapeleraCategoriaGastoId.ReadOnly = True + Me.PapeleraCategoriaGastoId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraCategoriaGastoId.Visible = False + ' + 'PapeleraCategoriaGasto + ' + Me.PapeleraCategoriaGasto.HeaderText = "Categoria Gasto" + Me.PapeleraCategoriaGasto.Name = "PapeleraCategoriaGasto" + Me.PapeleraCategoriaGasto.ReadOnly = True + ' + 'PapeleraPersonaId + ' + Me.PapeleraPersonaId.HeaderText = "persona_id" + Me.PapeleraPersonaId.Name = "PapeleraPersonaId" + Me.PapeleraPersonaId.ReadOnly = True + Me.PapeleraPersonaId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraPersonaId.Visible = False + ' + 'PapeleraPersona + ' + Me.PapeleraPersona.HeaderText = "Persona" + Me.PapeleraPersona.Name = "PapeleraPersona" + Me.PapeleraPersona.ReadOnly = True + ' + 'PapeleraFecha + ' + Me.PapeleraFecha.HeaderText = "Fecha" + Me.PapeleraFecha.Name = "PapeleraFecha" + Me.PapeleraFecha.ReadOnly = True + ' + 'PapeleraSeccionalId + ' + Me.PapeleraSeccionalId.HeaderText = "seccional_id" + Me.PapeleraSeccionalId.Name = "PapeleraSeccionalId" + Me.PapeleraSeccionalId.ReadOnly = True + Me.PapeleraSeccionalId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraSeccionalId.Visible = False + ' + 'PapeleraSeccional + ' + Me.PapeleraSeccional.HeaderText = "Seccional" + Me.PapeleraSeccional.Name = "PapeleraSeccional" + Me.PapeleraSeccional.ReadOnly = True + ' + 'PapeleraReintegro + ' + Me.PapeleraReintegro.HeaderText = "Mes Reintegro" + Me.PapeleraReintegro.Name = "PapeleraReintegro" + Me.PapeleraReintegro.ReadOnly = True + ' + 'PapeleraMonto + ' + Me.PapeleraMonto.HeaderText = "Monto" + Me.PapeleraMonto.Name = "PapeleraMonto" + Me.PapeleraMonto.ReadOnly = True + ' + 'PapeleraComentario + ' + Me.PapeleraComentario.HeaderText = "Comentario" + Me.PapeleraComentario.Name = "PapeleraComentario" + Me.PapeleraComentario.ReadOnly = True + ' + 'tbPapeleraTipoComprobante + ' + Me.tbPapeleraTipoComprobante.Enabled = False + Me.tbPapeleraTipoComprobante.Location = New System.Drawing.Point(529, 41) + Me.tbPapeleraTipoComprobante.Name = "tbPapeleraTipoComprobante" + Me.tbPapeleraTipoComprobante.Size = New System.Drawing.Size(163, 22) + Me.tbPapeleraTipoComprobante.TabIndex = 122 + Me.tbPapeleraTipoComprobante.Tag = "" + ' + 'tbPapeleraSeccional + ' + Me.tbPapeleraSeccional.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.tbPapeleraSeccional.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.tbPapeleraSeccional.BackColor = System.Drawing.SystemColors.Window + Me.tbPapeleraSeccional.Enabled = False + Me.tbPapeleraSeccional.Location = New System.Drawing.Point(145, 127) + Me.tbPapeleraSeccional.Name = "tbPapeleraSeccional" + Me.tbPapeleraSeccional.Size = New System.Drawing.Size(197, 22) + Me.tbPapeleraSeccional.TabIndex = 121 + ' + 'tbPapeleraTipoGasto + ' + Me.tbPapeleraTipoGasto.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.tbPapeleraTipoGasto.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.tbPapeleraTipoGasto.BackColor = System.Drawing.SystemColors.Window + Me.tbPapeleraTipoGasto.Enabled = False + Me.tbPapeleraTipoGasto.Location = New System.Drawing.Point(145, 41) + Me.tbPapeleraTipoGasto.Name = "tbPapeleraTipoGasto" + Me.tbPapeleraTipoGasto.Size = New System.Drawing.Size(197, 22) + Me.tbPapeleraTipoGasto.TabIndex = 120 + ' 'bPapeleraRestaurar ' Me.bPapeleraRestaurar.Enabled = False @@ -1104,142 +1270,61 @@ Partial Class ABMEgresos Me.tbPapeleraProveedor.Size = New System.Drawing.Size(197, 22) Me.tbPapeleraProveedor.TabIndex = 93 ' - 'tbPapeleraTipoGasto - ' - Me.tbPapeleraTipoGasto.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.tbPapeleraTipoGasto.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.tbPapeleraTipoGasto.BackColor = System.Drawing.SystemColors.Window - Me.tbPapeleraTipoGasto.Enabled = False - Me.tbPapeleraTipoGasto.Location = New System.Drawing.Point(145, 41) - Me.tbPapeleraTipoGasto.Name = "tbPapeleraTipoGasto" - Me.tbPapeleraTipoGasto.Size = New System.Drawing.Size(197, 22) - Me.tbPapeleraTipoGasto.TabIndex = 120 - ' - 'tbPapeleraSeccional - ' - Me.tbPapeleraSeccional.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.tbPapeleraSeccional.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.tbPapeleraSeccional.BackColor = System.Drawing.SystemColors.Window - Me.tbPapeleraSeccional.Enabled = False - Me.tbPapeleraSeccional.Location = New System.Drawing.Point(145, 127) - Me.tbPapeleraSeccional.Name = "tbPapeleraSeccional" - Me.tbPapeleraSeccional.Size = New System.Drawing.Size(197, 22) - Me.tbPapeleraSeccional.TabIndex = 121 - ' - 'tbPapeleraTipoComprobante - ' - Me.tbPapeleraTipoComprobante.Enabled = False - Me.tbPapeleraTipoComprobante.Location = New System.Drawing.Point(529, 41) - Me.tbPapeleraTipoComprobante.Name = "tbPapeleraTipoComprobante" - Me.tbPapeleraTipoComprobante.Size = New System.Drawing.Size(163, 22) - Me.tbPapeleraTipoComprobante.TabIndex = 122 - Me.tbPapeleraTipoComprobante.Tag = "" - ' - 'PapeleraId - ' - Me.PapeleraId.HeaderText = "Id" - Me.PapeleraId.Name = "PapeleraId" - Me.PapeleraId.ReadOnly = True - ' - 'PapeleraNroComprobante - ' - Me.PapeleraNroComprobante.HeaderText = "Nro Comprobante" - Me.PapeleraNroComprobante.Name = "PapeleraNroComprobante" - Me.PapeleraNroComprobante.ReadOnly = True - ' - 'PapeleraTComprobanteId - ' - Me.PapeleraTComprobanteId.HeaderText = "tipo_comprobante_id" - Me.PapeleraTComprobanteId.Name = "PapeleraTComprobanteId" - Me.PapeleraTComprobanteId.ReadOnly = True - Me.PapeleraTComprobanteId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraTComprobanteId.Visible = False - ' - 'PapeleraTipoComprobante + 'TSLabelTrimestre ' - Me.PapeleraTipoComprobante.HeaderText = "Tipo Comprobante" - Me.PapeleraTipoComprobante.Name = "PapeleraTipoComprobante" - Me.PapeleraTipoComprobante.ReadOnly = True + Me.TSLabelTrimestre.Name = "TSLabelTrimestre" + Me.TSLabelTrimestre.Size = New System.Drawing.Size(62, 22) + Me.TSLabelTrimestre.Text = "Trimestre: " ' - 'PapeleraProveedorId + 'TSComboBoxTrimestre ' - Me.PapeleraProveedorId.HeaderText = "proveedor_id" - Me.PapeleraProveedorId.Name = "PapeleraProveedorId" - Me.PapeleraProveedorId.ReadOnly = True - Me.PapeleraProveedorId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraProveedorId.Visible = False + Me.TSComboBoxTrimestre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TSComboBoxTrimestre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems + Me.TSComboBoxTrimestre.Items.AddRange(New Object() {"Primero", "Segundo", "Tercero", "Cuarto"}) + Me.TSComboBoxTrimestre.Name = "TSComboBoxTrimestre" + Me.TSComboBoxTrimestre.Size = New System.Drawing.Size(121, 25) ' - 'PapeleraProveedor + 'TSLabelAño ' - Me.PapeleraProveedor.HeaderText = "Proveedor" - Me.PapeleraProveedor.Name = "PapeleraProveedor" - Me.PapeleraProveedor.ReadOnly = True + Me.TSLabelAño.Name = "TSLabelAño" + Me.TSLabelAño.Size = New System.Drawing.Size(35, 22) + Me.TSLabelAño.Text = "Año: " ' - 'PapeleraCategoriaGastoId + 'TSTextBoxAño ' - Me.PapeleraCategoriaGastoId.HeaderText = "categoria_gasto_id" - Me.PapeleraCategoriaGastoId.Name = "PapeleraCategoriaGastoId" - Me.PapeleraCategoriaGastoId.ReadOnly = True - Me.PapeleraCategoriaGastoId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraCategoriaGastoId.Visible = False + Me.TSTextBoxAño.Name = "TSTextBoxAño" + Me.TSTextBoxAño.Size = New System.Drawing.Size(100, 25) ' - 'PapeleraCategoriaGasto + 'TSButtonFiltrar ' - Me.PapeleraCategoriaGasto.HeaderText = "Categoria Gasto" - Me.PapeleraCategoriaGasto.Name = "PapeleraCategoriaGasto" - Me.PapeleraCategoriaGasto.ReadOnly = True + Me.TSButtonFiltrar.BackColor = System.Drawing.Color.LightGreen + Me.TSButtonFiltrar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text + Me.TSButtonFiltrar.Image = CType(resources.GetObject("TSButtonFiltrar.Image"), System.Drawing.Image) + Me.TSButtonFiltrar.ImageTransparentColor = System.Drawing.Color.Magenta + Me.TSButtonFiltrar.Name = "TSButtonFiltrar" + Me.TSButtonFiltrar.Size = New System.Drawing.Size(41, 22) + Me.TSButtonFiltrar.Text = "Filtrar" ' - 'PapeleraPersonaId + 'TSLabelFiltro1 ' - Me.PapeleraPersonaId.HeaderText = "persona_id" - Me.PapeleraPersonaId.Name = "PapeleraPersonaId" - Me.PapeleraPersonaId.ReadOnly = True - Me.PapeleraPersonaId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraPersonaId.Visible = False + Me.TSLabelFiltro1.Name = "TSLabelFiltro1" + Me.TSLabelFiltro1.Size = New System.Drawing.Size(61, 22) + Me.TSLabelFiltro1.Text = "Filtrar Por:" ' - 'PapeleraPersona + 'TSComboBoxFiltro1 ' - Me.PapeleraPersona.HeaderText = "Persona" - Me.PapeleraPersona.Name = "PapeleraPersona" - Me.PapeleraPersona.ReadOnly = True - ' - 'PapeleraFecha - ' - Me.PapeleraFecha.HeaderText = "Fecha" - Me.PapeleraFecha.Name = "PapeleraFecha" - Me.PapeleraFecha.ReadOnly = True + Me.TSComboBoxFiltro1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TSComboBoxFiltro1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems + Me.TSComboBoxFiltro1.Items.AddRange(New Object() {"Id", "Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario"}) + Me.TSComboBoxFiltro1.Name = "TSComboBoxFiltro1" + Me.TSComboBoxFiltro1.Size = New System.Drawing.Size(121, 25) + Me.TSComboBoxFiltro1.ToolTipText = "Seleccione columna por la cual desea filtrar" ' - 'PapeleraSeccionalId + 'TSTextBoxFiltro1 ' - Me.PapeleraSeccionalId.HeaderText = "seccional_id" - Me.PapeleraSeccionalId.Name = "PapeleraSeccionalId" - Me.PapeleraSeccionalId.ReadOnly = True - Me.PapeleraSeccionalId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraSeccionalId.Visible = False - ' - 'PapeleraSeccional - ' - Me.PapeleraSeccional.HeaderText = "Seccional" - Me.PapeleraSeccional.Name = "PapeleraSeccional" - Me.PapeleraSeccional.ReadOnly = True - ' - 'PapeleraReintegro - ' - Me.PapeleraReintegro.HeaderText = "Mes Reintegro" - Me.PapeleraReintegro.Name = "PapeleraReintegro" - Me.PapeleraReintegro.ReadOnly = True - ' - 'PapeleraMonto - ' - Me.PapeleraMonto.HeaderText = "Monto" - Me.PapeleraMonto.Name = "PapeleraMonto" - Me.PapeleraMonto.ReadOnly = True - ' - 'PapeleraComentario - ' - Me.PapeleraComentario.HeaderText = "Comentario" - Me.PapeleraComentario.Name = "PapeleraComentario" - Me.PapeleraComentario.ReadOnly = True + Me.TSTextBoxFiltro1.Name = "TSTextBoxFiltro1" + Me.TSTextBoxFiltro1.Size = New System.Drawing.Size(100, 25) + Me.TSTextBoxFiltro1.ToolTipText = "Ingresar valores por los cuales quiere filtrar la tabla." ' 'ABMEgresos ' @@ -1259,9 +1344,13 @@ Partial Class ABMEgresos CType(Me.SplitContainerModificar, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerModificar.ResumeLayout(False) Me.ToolStripContainerModificar.ContentPanel.ResumeLayout(False) + Me.ToolStripContainerModificar.TopToolStripPanel.ResumeLayout(False) + Me.ToolStripContainerModificar.TopToolStripPanel.PerformLayout() Me.ToolStripContainerModificar.ResumeLayout(False) Me.ToolStripContainerModificar.PerformLayout() CType(Me.DGVModificar, System.ComponentModel.ISupportInitialize).EndInit() + Me.ToolStripModificar.ResumeLayout(False) + Me.ToolStripModificar.PerformLayout() Me.TabPagePapelera.ResumeLayout(False) Me.SplitContainerPapelera.Panel1.ResumeLayout(False) Me.SplitContainerPapelera.Panel2.ResumeLayout(False) @@ -1389,4 +1478,13 @@ Partial Class ABMEgresos Friend WithEvents PapeleraReintegro As DataGridViewTextBoxColumn Friend WithEvents PapeleraMonto As DataGridViewTextBoxColumn Friend WithEvents PapeleraComentario As DataGridViewTextBoxColumn + Friend WithEvents ToolStripModificar As ToolStrip + Friend WithEvents TSLabelTrimestre As ToolStripLabel + Friend WithEvents TSComboBoxTrimestre As ToolStripComboBox + Friend WithEvents TSLabelAño As ToolStripLabel + Friend WithEvents TSTextBoxAño As ToolStripTextBox + Friend WithEvents TSButtonFiltrar As ToolStripButton + Friend WithEvents TSLabelFiltro1 As ToolStripLabel + Friend WithEvents TSComboBoxFiltro1 As ToolStripComboBox + Friend WithEvents TSTextBoxFiltro1 As ToolStripTextBox End Class diff --git a/SireCu/Paneles/ABMEgresos.resx b/SireCu/Paneles/ABMEgresos.resx index 62bb086..96504de 100644 --- a/SireCu/Paneles/ABMEgresos.resx +++ b/SireCu/Paneles/ABMEgresos.resx @@ -117,102 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - True @@ -261,6 +165,25 @@ True + + 17, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + True diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index baeb51c..a0d6bea 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -220,6 +220,109 @@ Public Class ABMEgresos End If End Sub + Private Sub TSButtonFiltrar_Click(sender As Object, e As EventArgs) Handles TSButtonFiltrar.Click + Dim filtros As List(Of KeyValuePair(Of String, String)) = New List(Of KeyValuePair(Of String, String)) + Dim sql As String = "" + + ' Se guardan todos los filtros activos para crear el SQL + If Not TSComboBoxTrimestre.SelectedItem = "" Then + filtros.Add(New KeyValuePair(Of String, String)("trimestre", TSComboBoxTrimestre.SelectedItem)) + End If + + If Not TSTextBoxAño.Text = "" Then + filtros.Add(New KeyValuePair(Of String, String)("año", TSTextBoxAño.Text)) + End If + + If Not (TSComboBoxFiltro1.SelectedItem = "" Or TSTextBoxFiltro1.Text = "") Then + filtros.Add(New KeyValuePair(Of String, String)(TSComboBoxFiltro1.SelectedItem, TSTextBoxFiltro1.Text)) + End If + + ' SQL Basico + sql = "SELECT TOP (500) E.id AS id, + E.nro_comprobante AS nro_comprobante, + E.tipo_comprobante_id AS tipo_comprobante_id, + Comp.nombre AS tipo_comprobante_nombre, + E.proveedor_id AS proveedor_id, + Pro.nombre AS proveedor_nombre, + E.categoria_gasto_id AS categoria_gasto_id, + Gastos.nombre AS categoria_nombre, + E.persona_id AS persona_id, + Per.nombre AS persona_nombre, + E.fecha AS fecha, + E.seccional_id AS seccional_id, + Secc.nombre AS seccional_nombre, + E.mes_reintegro AS mes_reintegro, + E.monto AS monto, + E.comentario AS comentario + FROM Egresos AS E + LEFT JOIN TiposComprobantes AS Comp ON E.tipo_comprobante_id = Comp.id + LEFT JOIN Proveedores AS Pro ON E.proveedor_id = Pro.id + LEFT JOIN CategoriasGastos AS Gastos ON E.categoria_gasto_id = Gastos.id + LEFT JOIN Personas AS Per ON E.persona_id = Per.id + LEFT JOIN Seccionales AS Secc ON E.seccional_id = Secc.id + WHERE E.eliminado = 0" + + ' Aplicar Filtros al SQL + For Each keyv As KeyValuePair(Of String, String) In filtros + + ' Filtrar por trimestre + If keyv.Key = "trimestre" Then + Select Case keyv.Value + Case "Primero" + sql += " AND DATEPART(month, [fecha]) BETWEEN 1 AND 3" + Case "Segundo" + sql += " AND DATEPART(month, [fecha]) BETWEEN 4 AND 6" + Case "Tercero" + sql += " AND DATEPART(month, [fecha]) BETWEEN 7 AND 9" + Case "Cuarto" + sql += " AND DATEPART(month, [fecha]) BETWEEN 10 AND 12" + Case Else + Exit Select + End Select + + ElseIf keyv.Key = "año" Then + + ' Filtrar por año + sql += " AND DATEPART(year, [fecha]) = " & keyv.Value + + Else + + ' Filtros adicionales + Select Case keyv.Key + Case "Id" + sql += " AND E.id = " & keyv.Value + Case "Nro Comprobante" + sql += " AND E.nro_comprobante = '" & keyv.Value & "'" + Case "Tipo Comprobante" + sql += " AND Comp.nombre = '" & keyv.Value & "'" + Case "Proveedor" + sql += " AND Pro.nombre = '" & keyv.Value & "'" + Case "Categoria Gasto" + sql += " AND Gastos.nombre = '" & keyv.Value & "'" + Case "Persona" + sql += " AND Per.nombre = '" & keyv.Value & "'" + Case "Fecha" + sql += " AND E.fecha = " & keyv.Value + Case "Seccional" + sql += " AND Secc.nombre = '" & keyv.Value & "'" + Case "Mes Reintegro" + sql += " AND E.mes_reintegro = " & keyv.Value + Case "Monto" + sql += " AND E.monto = " & keyv.Value + Case "Comentario" + sql += " AND E.comentario = '" & keyv.Value & "'" + Case Else + Exit Select + End Select + End If + Next + + sql += " ORDER BY E.id DESC" + + FiltrarDGV(DGVModificar, sql) + + End Sub + #End Region #Region "TAB Papelera - Eventos" @@ -659,7 +762,6 @@ Public Class ABMEgresos ControlesConErroresModificar.Remove(sender) End If End Sub - #End Region End Class \ No newline at end of file From 7cd0992ecb315765794c9481d08c15861e8ad233 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Thu, 27 Apr 2017 21:01:11 -0300 Subject: [PATCH 14/27] Vaciar toda la papelera de Egresos --- SireCu/Clases/Egreso.vb | 10 + SireCu/Paneles/ABMEgresos.Designer.vb | 303 ++------------------------ SireCu/Paneles/ABMEgresos.resx | 128 +++++++++-- SireCu/Paneles/ABMEgresos.vb | 53 ++--- 4 files changed, 159 insertions(+), 335 deletions(-) diff --git a/SireCu/Clases/Egreso.vb b/SireCu/Clases/Egreso.vb index 7a8b9ce..60a315b 100644 --- a/SireCu/Clases/Egreso.vb +++ b/SireCu/Clases/Egreso.vb @@ -76,6 +76,16 @@ Module Egreso End If End Sub + Public Sub vaciar_papelera() + Principal.query = "DELETE FROM Egresos WHERE eliminado = 1" + + If consultarNQ(Principal.query, Principal.command) > 0 Then + MsgBox("Papelera vaciada exitosamente", MsgBoxStyle.OkOnly, "Vaciar Papelera") + Else + MsgBox("Ocurrio un error al vaciar la papelera", MsgBoxStyle.Exclamation, "Vaciar Papelera") + End If + End Sub + Public Sub CargardDGV(ByRef dgv As DataGridView, Optional ByVal eliminado As Integer = 0, Optional ByVal nombreDataSet As String = "Egresos_Modificar") 'Creamos la tabla si no existe diff --git a/SireCu/Paneles/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb index 09674ed..3239dbe 100644 --- a/SireCu/Paneles/ABMEgresos.Designer.vb +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -114,29 +114,7 @@ Partial Class ABMEgresos Me.PapeleraReintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.PapeleraMonto = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.PapeleraComentario = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.tbPapeleraTipoComprobante = New System.Windows.Forms.TextBox() - Me.tbPapeleraSeccional = New System.Windows.Forms.TextBox() - Me.tbPapeleraTipoGasto = New System.Windows.Forms.TextBox() Me.bPapeleraRestaurar = New System.Windows.Forms.Button() - Me.Label2 = New System.Windows.Forms.Label() - Me.dtpPapeleraReintegro = New System.Windows.Forms.DateTimePicker() - Me.Label3 = New System.Windows.Forms.Label() - Me.dtpPapeleraFecha = New System.Windows.Forms.DateTimePicker() - Me.tbPapeleraNComprobante = New System.Windows.Forms.TextBox() - Me.tbPapeleraPVenta = New System.Windows.Forms.TextBox() - Me.Label13 = New System.Windows.Forms.Label() - Me.Label14 = New System.Windows.Forms.Label() - Me.tbPapeleraMonto = New System.Windows.Forms.TextBox() - Me.Label15 = New System.Windows.Forms.Label() - Me.tbPapeleraNombre = New System.Windows.Forms.TextBox() - Me.Label16 = New System.Windows.Forms.Label() - Me.Label17 = New System.Windows.Forms.Label() - Me.Label18 = New System.Windows.Forms.Label() - Me.Label19 = New System.Windows.Forms.Label() - Me.Label20 = New System.Windows.Forms.Label() - Me.Label21 = New System.Windows.Forms.Label() - Me.tbPapeleraComentario = New System.Windows.Forms.TextBox() - Me.tbPapeleraProveedor = New System.Windows.Forms.TextBox() Me.TSLabelTrimestre = New System.Windows.Forms.ToolStripLabel() Me.TSComboBoxTrimestre = New System.Windows.Forms.ToolStripComboBox() Me.TSLabelAño = New System.Windows.Forms.ToolStripLabel() @@ -145,6 +123,7 @@ Partial Class ABMEgresos Me.TSLabelFiltro1 = New System.Windows.Forms.ToolStripLabel() Me.TSComboBoxFiltro1 = New System.Windows.Forms.ToolStripComboBox() Me.TSTextBoxFiltro1 = New System.Windows.Forms.ToolStripTextBox() + Me.bPapeleraVaciarPapelera = New System.Windows.Forms.Button() Me.TabControl.SuspendLayout() Me.TabPageAgregar.SuspendLayout() Me.TabPageModificar.SuspendLayout() @@ -637,7 +616,7 @@ Partial Class ABMEgresos Me.ToolStripModificar.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TSLabelTrimestre, Me.TSComboBoxTrimestre, Me.TSLabelAño, Me.TSTextBoxAño, Me.TSLabelFiltro1, Me.TSComboBoxFiltro1, Me.TSTextBoxFiltro1, Me.TSButtonFiltrar}) Me.ToolStripModificar.Location = New System.Drawing.Point(3, 0) Me.ToolStripModificar.Name = "ToolStripModificar" - Me.ToolStripModificar.Size = New System.Drawing.Size(683, 25) + Me.ToolStripModificar.Size = New System.Drawing.Size(652, 25) Me.ToolStripModificar.TabIndex = 0 ' 'ButtonEliminar @@ -887,31 +866,10 @@ Partial Class ABMEgresos ' 'SplitContainerPapelera.Panel2 ' - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraTipoComprobante) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraSeccional) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraTipoGasto) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraVaciarPapelera) Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraRestaurar) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label2) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.dtpPapeleraReintegro) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label3) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.dtpPapeleraFecha) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraNComprobante) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraPVenta) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label13) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label14) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraMonto) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label15) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraNombre) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label16) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label17) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label18) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label19) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label20) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.Label21) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraComentario) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.tbPapeleraProveedor) Me.SplitContainerPapelera.Size = New System.Drawing.Size(741, 421) - Me.SplitContainerPapelera.SplitterDistance = 201 + Me.SplitContainerPapelera.SplitterDistance = 350 Me.SplitContainerPapelera.TabIndex = 1 ' 'ToolStripContainerPapelera @@ -920,11 +878,11 @@ Partial Class ABMEgresos 'ToolStripContainerPapelera.ContentPanel ' Me.ToolStripContainerPapelera.ContentPanel.Controls.Add(Me.DGVPapelera) - Me.ToolStripContainerPapelera.ContentPanel.Size = New System.Drawing.Size(741, 176) + Me.ToolStripContainerPapelera.ContentPanel.Size = New System.Drawing.Size(741, 325) Me.ToolStripContainerPapelera.Dock = System.Windows.Forms.DockStyle.Fill Me.ToolStripContainerPapelera.Location = New System.Drawing.Point(0, 0) Me.ToolStripContainerPapelera.Name = "ToolStripContainerPapelera" - Me.ToolStripContainerPapelera.Size = New System.Drawing.Size(741, 201) + Me.ToolStripContainerPapelera.Size = New System.Drawing.Size(741, 350) Me.ToolStripContainerPapelera.TabIndex = 0 Me.ToolStripContainerPapelera.Text = "ToolStripContainer1" ' @@ -939,7 +897,7 @@ Partial Class ABMEgresos Me.DGVPapelera.Name = "DGVPapelera" Me.DGVPapelera.ReadOnly = True Me.DGVPapelera.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DGVPapelera.Size = New System.Drawing.Size(741, 176) + Me.DGVPapelera.Size = New System.Drawing.Size(741, 325) Me.DGVPapelera.TabIndex = 0 ' 'PapeleraId @@ -1048,228 +1006,18 @@ Partial Class ABMEgresos Me.PapeleraComentario.Name = "PapeleraComentario" Me.PapeleraComentario.ReadOnly = True ' - 'tbPapeleraTipoComprobante - ' - Me.tbPapeleraTipoComprobante.Enabled = False - Me.tbPapeleraTipoComprobante.Location = New System.Drawing.Point(529, 41) - Me.tbPapeleraTipoComprobante.Name = "tbPapeleraTipoComprobante" - Me.tbPapeleraTipoComprobante.Size = New System.Drawing.Size(163, 22) - Me.tbPapeleraTipoComprobante.TabIndex = 122 - Me.tbPapeleraTipoComprobante.Tag = "" - ' - 'tbPapeleraSeccional - ' - Me.tbPapeleraSeccional.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.tbPapeleraSeccional.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.tbPapeleraSeccional.BackColor = System.Drawing.SystemColors.Window - Me.tbPapeleraSeccional.Enabled = False - Me.tbPapeleraSeccional.Location = New System.Drawing.Point(145, 127) - Me.tbPapeleraSeccional.Name = "tbPapeleraSeccional" - Me.tbPapeleraSeccional.Size = New System.Drawing.Size(197, 22) - Me.tbPapeleraSeccional.TabIndex = 121 - ' - 'tbPapeleraTipoGasto - ' - Me.tbPapeleraTipoGasto.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.tbPapeleraTipoGasto.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.tbPapeleraTipoGasto.BackColor = System.Drawing.SystemColors.Window - Me.tbPapeleraTipoGasto.Enabled = False - Me.tbPapeleraTipoGasto.Location = New System.Drawing.Point(145, 41) - Me.tbPapeleraTipoGasto.Name = "tbPapeleraTipoGasto" - Me.tbPapeleraTipoGasto.Size = New System.Drawing.Size(197, 22) - Me.tbPapeleraTipoGasto.TabIndex = 120 - ' 'bPapeleraRestaurar ' Me.bPapeleraRestaurar.Enabled = False Me.bPapeleraRestaurar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.bPapeleraRestaurar.ForeColor = System.Drawing.Color.Red - Me.bPapeleraRestaurar.Location = New System.Drawing.Point(529, 157) + Me.bPapeleraRestaurar.Location = New System.Drawing.Point(91, 5) Me.bPapeleraRestaurar.Name = "bPapeleraRestaurar" Me.bPapeleraRestaurar.Size = New System.Drawing.Size(163, 56) Me.bPapeleraRestaurar.TabIndex = 103 Me.bPapeleraRestaurar.Text = "Restaurar" Me.bPapeleraRestaurar.UseVisualStyleBackColor = True ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(22, 130) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(68, 16) - Me.Label2.TabIndex = 119 - Me.Label2.Text = "Seccional" - ' - 'dtpPapeleraReintegro - ' - Me.dtpPapeleraReintegro.Checked = False - Me.dtpPapeleraReintegro.CustomFormat = "MM/yyyy" - Me.dtpPapeleraReintegro.Enabled = False - Me.dtpPapeleraReintegro.Format = System.Windows.Forms.DateTimePickerFormat.Custom - Me.dtpPapeleraReintegro.Location = New System.Drawing.Point(145, 99) - Me.dtpPapeleraReintegro.Name = "dtpPapeleraReintegro" - Me.dtpPapeleraReintegro.ShowCheckBox = True - Me.dtpPapeleraReintegro.ShowUpDown = True - Me.dtpPapeleraReintegro.Size = New System.Drawing.Size(197, 22) - Me.dtpPapeleraReintegro.TabIndex = 94 - Me.dtpPapeleraReintegro.Value = New Date(2017, 3, 4, 19, 31, 9, 0) - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(383, 16) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(49, 16) - Me.Label3.TabIndex = 116 - Me.Label3.Text = "Fecha:" - ' - 'dtpPapeleraFecha - ' - Me.dtpPapeleraFecha.CustomFormat = "" - Me.dtpPapeleraFecha.Enabled = False - Me.dtpPapeleraFecha.Format = System.Windows.Forms.DateTimePickerFormat.[Short] - Me.dtpPapeleraFecha.Location = New System.Drawing.Point(529, 13) - Me.dtpPapeleraFecha.Name = "dtpPapeleraFecha" - Me.dtpPapeleraFecha.Size = New System.Drawing.Size(163, 22) - Me.dtpPapeleraFecha.TabIndex = 96 - Me.dtpPapeleraFecha.Value = New Date(2017, 3, 4, 19, 31, 9, 0) - ' - 'tbPapeleraNComprobante - ' - Me.tbPapeleraNComprobante.Enabled = False - Me.tbPapeleraNComprobante.Location = New System.Drawing.Point(595, 71) - Me.tbPapeleraNComprobante.Name = "tbPapeleraNComprobante" - Me.tbPapeleraNComprobante.Size = New System.Drawing.Size(97, 22) - Me.tbPapeleraNComprobante.TabIndex = 99 - ' - 'tbPapeleraPVenta - ' - Me.tbPapeleraPVenta.Enabled = False - Me.tbPapeleraPVenta.Location = New System.Drawing.Point(529, 71) - Me.tbPapeleraPVenta.Name = "tbPapeleraPVenta" - Me.tbPapeleraPVenta.Size = New System.Drawing.Size(56, 22) - Me.tbPapeleraPVenta.TabIndex = 98 - ' - 'Label13 - ' - Me.Label13.AutoSize = True - Me.Label13.Location = New System.Drawing.Point(508, 102) - Me.Label13.Name = "Label13" - Me.Label13.Size = New System.Drawing.Size(15, 16) - Me.Label13.TabIndex = 114 - Me.Label13.Text = "$" - ' - 'Label14 - ' - Me.Label14.AutoSize = True - Me.Label14.Location = New System.Drawing.Point(383, 44) - Me.Label14.Name = "Label14" - Me.Label14.Size = New System.Drawing.Size(140, 16) - Me.Label14.TabIndex = 113 - Me.Label14.Text = "Tipo de Comprobante" - ' - 'tbPapeleraMonto - ' - Me.tbPapeleraMonto.Enabled = False - Me.tbPapeleraMonto.Location = New System.Drawing.Point(529, 99) - Me.tbPapeleraMonto.Name = "tbPapeleraMonto" - Me.tbPapeleraMonto.Size = New System.Drawing.Size(163, 22) - Me.tbPapeleraMonto.TabIndex = 100 - Me.tbPapeleraMonto.Tag = "" - ' - 'Label15 - ' - Me.Label15.AutoSize = True - Me.Label15.Location = New System.Drawing.Point(22, 44) - Me.Label15.Name = "Label15" - Me.Label15.Size = New System.Drawing.Size(63, 16) - Me.Label15.TabIndex = 112 - Me.Label15.Text = "Gasto de" - ' - 'tbPapeleraNombre - ' - Me.tbPapeleraNombre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.tbPapeleraNombre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.tbPapeleraNombre.BackColor = System.Drawing.SystemColors.Window - Me.tbPapeleraNombre.Enabled = False - Me.tbPapeleraNombre.Location = New System.Drawing.Point(145, 13) - Me.tbPapeleraNombre.Name = "tbPapeleraNombre" - Me.tbPapeleraNombre.Size = New System.Drawing.Size(197, 22) - Me.tbPapeleraNombre.TabIndex = 91 - ' - 'Label16 - ' - Me.Label16.AutoSize = True - Me.Label16.Location = New System.Drawing.Point(22, 101) - Me.Label16.Name = "Label16" - Me.Label16.Size = New System.Drawing.Size(115, 16) - Me.Label16.TabIndex = 111 - Me.Label16.Text = "Mes de Reintegro" - ' - 'Label17 - ' - Me.Label17.AutoSize = True - Me.Label17.Location = New System.Drawing.Point(22, 161) - Me.Label17.Name = "Label17" - Me.Label17.Size = New System.Drawing.Size(77, 16) - Me.Label17.TabIndex = 110 - Me.Label17.Text = "Comentario" - ' - 'Label18 - ' - Me.Label18.AutoSize = True - Me.Label18.Location = New System.Drawing.Point(383, 102) - Me.Label18.Name = "Label18" - Me.Label18.Size = New System.Drawing.Size(45, 16) - Me.Label18.TabIndex = 109 - Me.Label18.Text = "Monto" - ' - 'Label19 - ' - Me.Label19.AutoSize = True - Me.Label19.Location = New System.Drawing.Point(22, 74) - Me.Label19.Name = "Label19" - Me.Label19.Size = New System.Drawing.Size(72, 16) - Me.Label19.TabIndex = 108 - Me.Label19.Text = "Proveedor" - ' - 'Label20 - ' - Me.Label20.AutoSize = True - Me.Label20.Location = New System.Drawing.Point(22, 16) - Me.Label20.Name = "Label20" - Me.Label20.Size = New System.Drawing.Size(120, 16) - Me.Label20.TabIndex = 107 - Me.Label20.Text = "Nombre y Apellido" - ' - 'Label21 - ' - Me.Label21.AutoSize = True - Me.Label21.Location = New System.Drawing.Point(383, 74) - Me.Label21.Name = "Label21" - Me.Label21.Size = New System.Drawing.Size(107, 16) - Me.Label21.TabIndex = 106 - Me.Label21.Text = "N° Comprobante" - ' - 'tbPapeleraComentario - ' - Me.tbPapeleraComentario.Enabled = False - Me.tbPapeleraComentario.Location = New System.Drawing.Point(145, 157) - Me.tbPapeleraComentario.Multiline = True - Me.tbPapeleraComentario.Name = "tbPapeleraComentario" - Me.tbPapeleraComentario.Size = New System.Drawing.Size(378, 56) - Me.tbPapeleraComentario.TabIndex = 101 - ' - 'tbPapeleraProveedor - ' - Me.tbPapeleraProveedor.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.tbPapeleraProveedor.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.tbPapeleraProveedor.Enabled = False - Me.tbPapeleraProveedor.Location = New System.Drawing.Point(145, 71) - Me.tbPapeleraProveedor.Name = "tbPapeleraProveedor" - Me.tbPapeleraProveedor.Size = New System.Drawing.Size(197, 22) - Me.tbPapeleraProveedor.TabIndex = 93 - ' 'TSLabelTrimestre ' Me.TSLabelTrimestre.Name = "TSLabelTrimestre" @@ -1326,6 +1074,17 @@ Partial Class ABMEgresos Me.TSTextBoxFiltro1.Size = New System.Drawing.Size(100, 25) Me.TSTextBoxFiltro1.ToolTipText = "Ingresar valores por los cuales quiere filtrar la tabla." ' + 'bPapeleraVaciarPapelera + ' + Me.bPapeleraVaciarPapelera.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.bPapeleraVaciarPapelera.ForeColor = System.Drawing.Color.Red + Me.bPapeleraVaciarPapelera.Location = New System.Drawing.Point(486, 5) + Me.bPapeleraVaciarPapelera.Name = "bPapeleraVaciarPapelera" + Me.bPapeleraVaciarPapelera.Size = New System.Drawing.Size(163, 56) + Me.bPapeleraVaciarPapelera.TabIndex = 104 + Me.bPapeleraVaciarPapelera.Text = "Vaciar Papelera" + Me.bPapeleraVaciarPapelera.UseVisualStyleBackColor = True + ' 'ABMEgresos ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -1354,7 +1113,6 @@ Partial Class ABMEgresos Me.TabPagePapelera.ResumeLayout(False) Me.SplitContainerPapelera.Panel1.ResumeLayout(False) Me.SplitContainerPapelera.Panel2.ResumeLayout(False) - Me.SplitContainerPapelera.Panel2.PerformLayout() CType(Me.SplitContainerPapelera, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerPapelera.ResumeLayout(False) Me.ToolStripContainerPapelera.ContentPanel.ResumeLayout(False) @@ -1440,28 +1198,6 @@ Partial Class ABMEgresos Friend WithEvents ToolStripContainerPapelera As ToolStripContainer Friend WithEvents DGVPapelera As DataGridView Friend WithEvents bPapeleraRestaurar As Button - Friend WithEvents Label2 As Label - Friend WithEvents dtpPapeleraReintegro As DateTimePicker - Friend WithEvents Label3 As Label - Friend WithEvents dtpPapeleraFecha As DateTimePicker - Friend WithEvents tbPapeleraNComprobante As TextBox - Friend WithEvents tbPapeleraPVenta As TextBox - Friend WithEvents Label13 As Label - Friend WithEvents Label14 As Label - Friend WithEvents tbPapeleraMonto As TextBox - Friend WithEvents Label15 As Label - Friend WithEvents tbPapeleraNombre As TextBox - Friend WithEvents Label16 As Label - Friend WithEvents Label17 As Label - Friend WithEvents Label18 As Label - Friend WithEvents Label19 As Label - Friend WithEvents Label20 As Label - Friend WithEvents Label21 As Label - Friend WithEvents tbPapeleraComentario As TextBox - Friend WithEvents tbPapeleraProveedor As TextBox - Friend WithEvents tbPapeleraTipoComprobante As TextBox - Friend WithEvents tbPapeleraSeccional As TextBox - Friend WithEvents tbPapeleraTipoGasto As TextBox Friend WithEvents PapeleraId As DataGridViewTextBoxColumn Friend WithEvents PapeleraNroComprobante As DataGridViewTextBoxColumn Friend WithEvents PapeleraTComprobanteId As DataGridViewTextBoxColumn @@ -1487,4 +1223,5 @@ Partial Class ABMEgresos Friend WithEvents TSLabelFiltro1 As ToolStripLabel Friend WithEvents TSComboBoxFiltro1 As ToolStripComboBox Friend WithEvents TSTextBoxFiltro1 As ToolStripTextBox + Friend WithEvents bPapeleraVaciarPapelera As Button End Class diff --git a/SireCu/Paneles/ABMEgresos.resx b/SireCu/Paneles/ABMEgresos.resx index 96504de..569b34a 100644 --- a/SireCu/Paneles/ABMEgresos.resx +++ b/SireCu/Paneles/ABMEgresos.resx @@ -117,6 +117,54 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + True @@ -168,22 +216,54 @@ 17, 17 - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG - YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 - 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw - bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc - VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 - c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 - Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo - mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ - kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D - TgDQASA1MVpwzwAAAABJRU5ErkJggg== - - + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + True @@ -232,4 +312,20 @@ True + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + \ No newline at end of file diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index a0d6bea..ed08d2a 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -216,6 +216,7 @@ Public Class ABMEgresos limpiarForm(SplitContainerModificar.Panel2) activarModificar(False) CargardDGV(DGVModificar) + CargardDGV(DGVPapelera, 1, "Egresos_Papelera") ActualizarSaldo() End If End Sub @@ -327,41 +328,8 @@ Public Class ABMEgresos #Region "TAB Papelera - Eventos" Private Sub DGVPapelera_CellMouseDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DGVPapelera.CellMouseDoubleClick - ' Cargar el formulario con los datos para restaurar - Try - idPapelera = CInt(DGVPapelera.Rows(e.RowIndex).Cells("PapeleraId").Value) - - tbPapeleraNombre.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraPersona").Value - tbPapeleraTipoGasto.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraCategoriaGasto").Value - tbPapeleraProveedor.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraProveedor").Value - If DGVPapelera.Rows(e.RowIndex).Cells("PapeleraReintegro").Value Is DBNull.Value Then - dtpPapeleraReintegro.Value = CDate(DGVPapelera.Rows(e.RowIndex).Cells("PapeleraFecha").Value) - dtpPapeleraReintegro.Checked = False - Else - If DGVPapelera.Rows(e.RowIndex).Cells("PapeleraReintegro").Value = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraFecha").Value Then - dtpPapeleraReintegro.Value = CDate(DGVPapelera.Rows(e.RowIndex).Cells("PapeleraReintegro").Value) - dtpPapeleraReintegro.Checked = False - Else - dtpPapeleraReintegro.Value = CDate(DGVPapelera.Rows(e.RowIndex).Cells("PapeleraReintegro").Value) - dtpPapeleraReintegro.Checked = True - End If - End If - tbPapeleraSeccional.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraSeccional").Value - tbPapeleraComentario.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraComentario").Value.ToString - dtpPapeleraFecha.Value = CDate(DGVPapelera.Rows(e.RowIndex).Cells("PapeleraFecha").Value) - tbPapeleraTipoComprobante.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraTipoComprobante").Value - If DGVPapelera.Rows(e.RowIndex).Cells("PapeleraNroComprobante").Value.ToString.Contains("-") Then - tbPapeleraPVenta.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraNroComprobante").Value.ToString.Split("-")(0) - tbPapeleraNComprobante.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraNroComprobante").Value.ToString.Split("-")(1) - Else - tbPapeleraPVenta.Text = "0" - tbPapeleraNComprobante.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraNroComprobante").Value - End If - tbPapeleraMonto.Text = DGVPapelera.Rows(e.RowIndex).Cells("PapeleraMonto").Value - Catch ex As Exception - MessageBox.Show(ex.Message, "Error al cargar el formulario", MessageBoxButtons.OK, MessageBoxIcon.Error) - End Try - + ' Asignar el id a restaurar + idPapelera = CInt(DGVPapelera.Rows(e.RowIndex).Cells("PapeleraId").Value) bPapeleraRestaurar.Enabled = True End Sub @@ -372,8 +340,21 @@ Public Class ABMEgresos restaurar_egreso(idPapelera) idPapelera = 0 - limpiarForm(SplitContainerPapelera.Panel2) CargardDGV(DGVPapelera, 1, "Egresos_Papelera") + CargardDGV(DGVModificar) + ActualizarSaldo() + bPapeleraRestaurar.Enabled = False + End If + End Sub + + Private Sub bPapeleraVaciarPapelera_Click(sender As Object, e As EventArgs) Handles bPapeleraVaciarPapelera.Click + If (MsgBox("Está seguro? Esta opción no se puede deshacer!", MsgBoxStyle.OkCancel, "Vaciar Papelera?") = MsgBoxResult.Ok) Then + + vaciar_papelera() + + idPapelera = 0 + CargardDGV(DGVPapelera, 1, "Egresos_Papelera") + CargardDGV(DGVModificar) ActualizarSaldo() bPapeleraRestaurar.Enabled = False End If From f5cded81b237755fae6c30538b7a6e98c0767382 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Wed, 3 May 2017 10:31:48 -0300 Subject: [PATCH 15/27] Eliminar Egreso Permanente + Fix +Egresos: Hard / Soft Delete *Fix: SelectedValue ComboBox --- SireCu/Clases/Egreso.vb | 16 +- SireCu/OtrasFunciones.vb | 2 - SireCu/Paneles/ABMEgresos.Designer.vb | 243 ++++++++++++++------------ SireCu/Paneles/ABMEgresos.resx | 128 ++------------ SireCu/Paneles/ABMEgresos.vb | 97 +++++----- 5 files changed, 210 insertions(+), 276 deletions(-) diff --git a/SireCu/Clases/Egreso.vb b/SireCu/Clases/Egreso.vb index 60a315b..7dd4553 100644 --- a/SireCu/Clases/Egreso.vb +++ b/SireCu/Clases/Egreso.vb @@ -52,7 +52,7 @@ Module Egreso End If End Sub - Public Sub eliminar_egreso(ByVal id As Integer) + Public Sub eliminar_egreso_soft(ByVal id As Integer) Principal.query = "UPDATE Egresos SET eliminado = 1 WHERE id = @id" Principal.command.Parameters.Clear() Principal.command.Parameters.AddWithValue("@id", id) @@ -76,6 +76,18 @@ Module Egreso End If End Sub + Public Sub eliminar_egreso_hard(ByVal id As Integer) + Principal.query = "DELETE FROM Egresos WHERE id = @id" + Principal.command.Parameters.Clear() + Principal.command.Parameters.AddWithValue("@id", id) + + If consultarNQ(Principal.query, Principal.command) > 0 Then + MsgBox("Egreso eliminado exitosamente", MsgBoxStyle.OkOnly, "Eliminar Egreso Permanentemente") + Else + MsgBox("Ocurrio un error al eliminar el egreso", MsgBoxStyle.Exclamation, "Eliminar Egreso Permanentemente") + End If + End Sub + Public Sub vaciar_papelera() Principal.query = "DELETE FROM Egresos WHERE eliminado = 1" @@ -200,7 +212,7 @@ Module Egreso Public Function comprobante_repetido(ByVal nComprobante As String, ByVal proveedorID As Integer) - cargarTablaEnDataSet("Egresos") + ' cargarTablaEnDataSet("Egresos") Dim flag As Boolean = False diff --git a/SireCu/OtrasFunciones.vb b/SireCu/OtrasFunciones.vb index cf2277d..8454dbf 100644 --- a/SireCu/OtrasFunciones.vb +++ b/SireCu/OtrasFunciones.vb @@ -127,8 +127,6 @@ Module OtrasFunciones Public Function exist(ByVal tabla As String, ByVal campo As String, ByVal comparar As String) - cargarTablaEnDataSet(tabla) - Dim flag As Boolean = False For i = 0 To Principal.dataset.Tables(tabla).Rows.Count - 1 diff --git a/SireCu/Paneles/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb index 3239dbe..fcac643 100644 --- a/SireCu/Paneles/ABMEgresos.Designer.vb +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -25,19 +25,19 @@ Partial Class ABMEgresos Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ABMEgresos)) Me.TabControl = New System.Windows.Forms.TabControl() Me.TabPageAgregar = New System.Windows.Forms.TabPage() + Me.cbTComprobante = New System.Windows.Forms.ComboBox() + Me.cbSeccional = New System.Windows.Forms.ComboBox() + Me.cbTGasto = New System.Windows.Forms.ComboBox() Me.lbFecha = New System.Windows.Forms.Label() Me.dtpFecha = New System.Windows.Forms.DateTimePicker() Me.dtpReintegro = New System.Windows.Forms.DateTimePicker() Me.lbSeccional = New System.Windows.Forms.Label() - Me.tbSeccional = New System.Windows.Forms.ComboBox() Me.tbNComprobante = New System.Windows.Forms.TextBox() Me.lb_Titulo = New System.Windows.Forms.Label() - Me.tbTComprobante = New System.Windows.Forms.ComboBox() Me.tbPVenta = New System.Windows.Forms.TextBox() Me.lbSmonto = New System.Windows.Forms.Label() Me.lbTComprobante = New System.Windows.Forms.Label() Me.tbMonto = New System.Windows.Forms.TextBox() - Me.tbTGasto = New System.Windows.Forms.ComboBox() Me.btnGuardar = New System.Windows.Forms.Button() Me.lbGasto = New System.Windows.Forms.Label() Me.tbNombre = New System.Windows.Forms.TextBox() @@ -70,6 +70,14 @@ Partial Class ABMEgresos Me.monto = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.comentario = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.ToolStripModificar = New System.Windows.Forms.ToolStrip() + Me.TSLabelTrimestre = New System.Windows.Forms.ToolStripLabel() + Me.TSComboBoxTrimestre = New System.Windows.Forms.ToolStripComboBox() + Me.TSLabelAño = New System.Windows.Forms.ToolStripLabel() + Me.TSTextBoxAño = New System.Windows.Forms.ToolStripTextBox() + Me.TSLabelFiltro1 = New System.Windows.Forms.ToolStripLabel() + Me.TSComboBoxFiltro1 = New System.Windows.Forms.ToolStripComboBox() + Me.TSTextBoxFiltro1 = New System.Windows.Forms.ToolStripTextBox() + Me.TSButtonFiltrar = New System.Windows.Forms.ToolStripButton() Me.ButtonEliminar = New System.Windows.Forms.Button() Me.LabelSeccional = New System.Windows.Forms.Label() Me.ComboBoxSeccional = New System.Windows.Forms.ComboBox() @@ -114,16 +122,9 @@ Partial Class ABMEgresos Me.PapeleraReintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.PapeleraMonto = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.PapeleraComentario = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.bPapeleraRestaurar = New System.Windows.Forms.Button() - Me.TSLabelTrimestre = New System.Windows.Forms.ToolStripLabel() - Me.TSComboBoxTrimestre = New System.Windows.Forms.ToolStripComboBox() - Me.TSLabelAño = New System.Windows.Forms.ToolStripLabel() - Me.TSTextBoxAño = New System.Windows.Forms.ToolStripTextBox() - Me.TSButtonFiltrar = New System.Windows.Forms.ToolStripButton() - Me.TSLabelFiltro1 = New System.Windows.Forms.ToolStripLabel() - Me.TSComboBoxFiltro1 = New System.Windows.Forms.ToolStripComboBox() - Me.TSTextBoxFiltro1 = New System.Windows.Forms.ToolStripTextBox() + Me.bPapeleraEliminar = New System.Windows.Forms.Button() Me.bPapeleraVaciarPapelera = New System.Windows.Forms.Button() + Me.bPapeleraRestaurar = New System.Windows.Forms.Button() Me.TabControl.SuspendLayout() Me.TabPageAgregar.SuspendLayout() Me.TabPageModificar.SuspendLayout() @@ -162,19 +163,19 @@ Partial Class ABMEgresos ' 'TabPageAgregar ' + Me.TabPageAgregar.Controls.Add(Me.cbTComprobante) + Me.TabPageAgregar.Controls.Add(Me.cbSeccional) + Me.TabPageAgregar.Controls.Add(Me.cbTGasto) Me.TabPageAgregar.Controls.Add(Me.lbFecha) Me.TabPageAgregar.Controls.Add(Me.dtpFecha) Me.TabPageAgregar.Controls.Add(Me.dtpReintegro) Me.TabPageAgregar.Controls.Add(Me.lbSeccional) - Me.TabPageAgregar.Controls.Add(Me.tbSeccional) Me.TabPageAgregar.Controls.Add(Me.tbNComprobante) Me.TabPageAgregar.Controls.Add(Me.lb_Titulo) - Me.TabPageAgregar.Controls.Add(Me.tbTComprobante) Me.TabPageAgregar.Controls.Add(Me.tbPVenta) Me.TabPageAgregar.Controls.Add(Me.lbSmonto) Me.TabPageAgregar.Controls.Add(Me.lbTComprobante) Me.TabPageAgregar.Controls.Add(Me.tbMonto) - Me.TabPageAgregar.Controls.Add(Me.tbTGasto) Me.TabPageAgregar.Controls.Add(Me.btnGuardar) Me.TabPageAgregar.Controls.Add(Me.lbGasto) Me.TabPageAgregar.Controls.Add(Me.tbNombre) @@ -194,6 +195,36 @@ Partial Class ABMEgresos Me.TabPageAgregar.Text = "Agregar" Me.TabPageAgregar.UseVisualStyleBackColor = True ' + 'cbTComprobante + ' + Me.cbTComprobante.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.cbTComprobante.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.cbTComprobante.FormattingEnabled = True + Me.cbTComprobante.Location = New System.Drawing.Point(537, 126) + Me.cbTComprobante.Name = "cbTComprobante" + Me.cbTComprobante.Size = New System.Drawing.Size(163, 24) + Me.cbTComprobante.TabIndex = 9 + ' + 'cbSeccional + ' + Me.cbSeccional.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.cbSeccional.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.cbSeccional.FormattingEnabled = True + Me.cbSeccional.Location = New System.Drawing.Point(151, 261) + Me.cbSeccional.Name = "cbSeccional" + Me.cbSeccional.Size = New System.Drawing.Size(156, 24) + Me.cbSeccional.TabIndex = 7 + ' + 'cbTGasto + ' + Me.cbTGasto.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.cbTGasto.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.cbTGasto.FormattingEnabled = True + Me.cbTGasto.Location = New System.Drawing.Point(151, 126) + Me.cbTGasto.Name = "cbTGasto" + Me.cbTGasto.Size = New System.Drawing.Size(156, 24) + Me.cbTGasto.TabIndex = 2 + ' 'lbFecha ' Me.lbFecha.AutoSize = True @@ -235,16 +266,6 @@ Partial Class ABMEgresos Me.lbSeccional.TabIndex = 93 Me.lbSeccional.Text = "Seccional" ' - 'tbSeccional - ' - Me.tbSeccional.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.tbSeccional.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.tbSeccional.FormattingEnabled = True - Me.tbSeccional.Location = New System.Drawing.Point(151, 261) - Me.tbSeccional.Name = "tbSeccional" - Me.tbSeccional.Size = New System.Drawing.Size(156, 24) - Me.tbSeccional.TabIndex = 7 - ' 'tbNComprobante ' Me.tbNComprobante.Location = New System.Drawing.Point(603, 171) @@ -262,16 +283,6 @@ Partial Class ABMEgresos Me.lb_Titulo.TabIndex = 91 Me.lb_Titulo.Text = "Nuevo Egreso" ' - 'tbTComprobante - ' - Me.tbTComprobante.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.tbTComprobante.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.tbTComprobante.FormattingEnabled = True - Me.tbTComprobante.Location = New System.Drawing.Point(537, 126) - Me.tbTComprobante.Name = "tbTComprobante" - Me.tbTComprobante.Size = New System.Drawing.Size(163, 24) - Me.tbTComprobante.TabIndex = 9 - ' 'tbPVenta ' Me.tbPVenta.Location = New System.Drawing.Point(537, 171) @@ -305,16 +316,6 @@ Partial Class ABMEgresos Me.tbMonto.TabIndex = 12 Me.tbMonto.Tag = "" ' - 'tbTGasto - ' - Me.tbTGasto.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.tbTGasto.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.tbTGasto.FormattingEnabled = True - Me.tbTGasto.Location = New System.Drawing.Point(151, 126) - Me.tbTGasto.Name = "tbTGasto" - Me.tbTGasto.Size = New System.Drawing.Size(156, 24) - Me.tbTGasto.TabIndex = 4 - ' 'btnGuardar ' Me.btnGuardar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) @@ -619,6 +620,62 @@ Partial Class ABMEgresos Me.ToolStripModificar.Size = New System.Drawing.Size(652, 25) Me.ToolStripModificar.TabIndex = 0 ' + 'TSLabelTrimestre + ' + Me.TSLabelTrimestre.Name = "TSLabelTrimestre" + Me.TSLabelTrimestre.Size = New System.Drawing.Size(62, 22) + Me.TSLabelTrimestre.Text = "Trimestre: " + ' + 'TSComboBoxTrimestre + ' + Me.TSComboBoxTrimestre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TSComboBoxTrimestre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems + Me.TSComboBoxTrimestre.Items.AddRange(New Object() {"Primero", "Segundo", "Tercero", "Cuarto"}) + Me.TSComboBoxTrimestre.Name = "TSComboBoxTrimestre" + Me.TSComboBoxTrimestre.Size = New System.Drawing.Size(121, 25) + ' + 'TSLabelAño + ' + Me.TSLabelAño.Name = "TSLabelAño" + Me.TSLabelAño.Size = New System.Drawing.Size(35, 22) + Me.TSLabelAño.Text = "Año: " + ' + 'TSTextBoxAño + ' + Me.TSTextBoxAño.Name = "TSTextBoxAño" + Me.TSTextBoxAño.Size = New System.Drawing.Size(100, 25) + ' + 'TSLabelFiltro1 + ' + Me.TSLabelFiltro1.Name = "TSLabelFiltro1" + Me.TSLabelFiltro1.Size = New System.Drawing.Size(61, 22) + Me.TSLabelFiltro1.Text = "Filtrar Por:" + ' + 'TSComboBoxFiltro1 + ' + Me.TSComboBoxFiltro1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TSComboBoxFiltro1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems + Me.TSComboBoxFiltro1.Items.AddRange(New Object() {"Id", "Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario"}) + Me.TSComboBoxFiltro1.Name = "TSComboBoxFiltro1" + Me.TSComboBoxFiltro1.Size = New System.Drawing.Size(121, 25) + Me.TSComboBoxFiltro1.ToolTipText = "Seleccione columna por la cual desea filtrar" + ' + 'TSTextBoxFiltro1 + ' + Me.TSTextBoxFiltro1.Name = "TSTextBoxFiltro1" + Me.TSTextBoxFiltro1.Size = New System.Drawing.Size(100, 25) + Me.TSTextBoxFiltro1.ToolTipText = "Ingresar valores por los cuales quiere filtrar la tabla." + ' + 'TSButtonFiltrar + ' + Me.TSButtonFiltrar.BackColor = System.Drawing.Color.LightGreen + Me.TSButtonFiltrar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text + Me.TSButtonFiltrar.Image = CType(resources.GetObject("TSButtonFiltrar.Image"), System.Drawing.Image) + Me.TSButtonFiltrar.ImageTransparentColor = System.Drawing.Color.Magenta + Me.TSButtonFiltrar.Name = "TSButtonFiltrar" + Me.TSButtonFiltrar.Size = New System.Drawing.Size(41, 22) + Me.TSButtonFiltrar.Text = "Filtrar" + ' 'ButtonEliminar ' Me.ButtonEliminar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) @@ -866,6 +923,7 @@ Partial Class ABMEgresos ' 'SplitContainerPapelera.Panel2 ' + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraEliminar) Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraVaciarPapelera) Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraRestaurar) Me.SplitContainerPapelera.Size = New System.Drawing.Size(741, 421) @@ -1006,73 +1064,17 @@ Partial Class ABMEgresos Me.PapeleraComentario.Name = "PapeleraComentario" Me.PapeleraComentario.ReadOnly = True ' - 'bPapeleraRestaurar - ' - Me.bPapeleraRestaurar.Enabled = False - Me.bPapeleraRestaurar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.bPapeleraRestaurar.ForeColor = System.Drawing.Color.Red - Me.bPapeleraRestaurar.Location = New System.Drawing.Point(91, 5) - Me.bPapeleraRestaurar.Name = "bPapeleraRestaurar" - Me.bPapeleraRestaurar.Size = New System.Drawing.Size(163, 56) - Me.bPapeleraRestaurar.TabIndex = 103 - Me.bPapeleraRestaurar.Text = "Restaurar" - Me.bPapeleraRestaurar.UseVisualStyleBackColor = True - ' - 'TSLabelTrimestre - ' - Me.TSLabelTrimestre.Name = "TSLabelTrimestre" - Me.TSLabelTrimestre.Size = New System.Drawing.Size(62, 22) - Me.TSLabelTrimestre.Text = "Trimestre: " - ' - 'TSComboBoxTrimestre - ' - Me.TSComboBoxTrimestre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.TSComboBoxTrimestre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems - Me.TSComboBoxTrimestre.Items.AddRange(New Object() {"Primero", "Segundo", "Tercero", "Cuarto"}) - Me.TSComboBoxTrimestre.Name = "TSComboBoxTrimestre" - Me.TSComboBoxTrimestre.Size = New System.Drawing.Size(121, 25) - ' - 'TSLabelAño - ' - Me.TSLabelAño.Name = "TSLabelAño" - Me.TSLabelAño.Size = New System.Drawing.Size(35, 22) - Me.TSLabelAño.Text = "Año: " - ' - 'TSTextBoxAño - ' - Me.TSTextBoxAño.Name = "TSTextBoxAño" - Me.TSTextBoxAño.Size = New System.Drawing.Size(100, 25) - ' - 'TSButtonFiltrar + 'bPapeleraEliminar ' - Me.TSButtonFiltrar.BackColor = System.Drawing.Color.LightGreen - Me.TSButtonFiltrar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text - Me.TSButtonFiltrar.Image = CType(resources.GetObject("TSButtonFiltrar.Image"), System.Drawing.Image) - Me.TSButtonFiltrar.ImageTransparentColor = System.Drawing.Color.Magenta - Me.TSButtonFiltrar.Name = "TSButtonFiltrar" - Me.TSButtonFiltrar.Size = New System.Drawing.Size(41, 22) - Me.TSButtonFiltrar.Text = "Filtrar" - ' - 'TSLabelFiltro1 - ' - Me.TSLabelFiltro1.Name = "TSLabelFiltro1" - Me.TSLabelFiltro1.Size = New System.Drawing.Size(61, 22) - Me.TSLabelFiltro1.Text = "Filtrar Por:" - ' - 'TSComboBoxFiltro1 - ' - Me.TSComboBoxFiltro1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.TSComboBoxFiltro1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems - Me.TSComboBoxFiltro1.Items.AddRange(New Object() {"Id", "Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario"}) - Me.TSComboBoxFiltro1.Name = "TSComboBoxFiltro1" - Me.TSComboBoxFiltro1.Size = New System.Drawing.Size(121, 25) - Me.TSComboBoxFiltro1.ToolTipText = "Seleccione columna por la cual desea filtrar" - ' - 'TSTextBoxFiltro1 - ' - Me.TSTextBoxFiltro1.Name = "TSTextBoxFiltro1" - Me.TSTextBoxFiltro1.Size = New System.Drawing.Size(100, 25) - Me.TSTextBoxFiltro1.ToolTipText = "Ingresar valores por los cuales quiere filtrar la tabla." + Me.bPapeleraEliminar.Enabled = False + Me.bPapeleraEliminar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.bPapeleraEliminar.ForeColor = System.Drawing.Color.Red + Me.bPapeleraEliminar.Location = New System.Drawing.Point(289, 5) + Me.bPapeleraEliminar.Name = "bPapeleraEliminar" + Me.bPapeleraEliminar.Size = New System.Drawing.Size(163, 56) + Me.bPapeleraEliminar.TabIndex = 105 + Me.bPapeleraEliminar.Text = "Eliminar Permanetemente" + Me.bPapeleraEliminar.UseVisualStyleBackColor = True ' 'bPapeleraVaciarPapelera ' @@ -1085,6 +1087,18 @@ Partial Class ABMEgresos Me.bPapeleraVaciarPapelera.Text = "Vaciar Papelera" Me.bPapeleraVaciarPapelera.UseVisualStyleBackColor = True ' + 'bPapeleraRestaurar + ' + Me.bPapeleraRestaurar.Enabled = False + Me.bPapeleraRestaurar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.bPapeleraRestaurar.ForeColor = System.Drawing.Color.Red + Me.bPapeleraRestaurar.Location = New System.Drawing.Point(91, 5) + Me.bPapeleraRestaurar.Name = "bPapeleraRestaurar" + Me.bPapeleraRestaurar.Size = New System.Drawing.Size(163, 56) + Me.bPapeleraRestaurar.TabIndex = 103 + Me.bPapeleraRestaurar.Text = "Restaurar" + Me.bPapeleraRestaurar.UseVisualStyleBackColor = True + ' 'ABMEgresos ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -1127,12 +1141,10 @@ Partial Class ABMEgresos Friend WithEvents TabPageAgregar As TabPage Friend WithEvents tbNComprobante As TextBox Friend WithEvents lb_Titulo As Label - Friend WithEvents tbTComprobante As ComboBox Friend WithEvents tbPVenta As TextBox Friend WithEvents lbSmonto As Label Friend WithEvents lbTComprobante As Label Friend WithEvents tbMonto As TextBox - Friend WithEvents tbTGasto As ComboBox Friend WithEvents btnGuardar As Button Friend WithEvents lbGasto As Label Friend WithEvents tbNombre As TextBox @@ -1188,7 +1200,6 @@ Partial Class ABMEgresos Friend WithEvents ComboBoxSeccional As ComboBox Friend WithEvents DateTimePickerMesReintegro As DateTimePicker Friend WithEvents lbSeccional As Label - Friend WithEvents tbSeccional As ComboBox Friend WithEvents lbFecha As Label Friend WithEvents dtpFecha As DateTimePicker Friend WithEvents dtpReintegro As DateTimePicker @@ -1224,4 +1235,8 @@ Partial Class ABMEgresos Friend WithEvents TSComboBoxFiltro1 As ToolStripComboBox Friend WithEvents TSTextBoxFiltro1 As ToolStripTextBox Friend WithEvents bPapeleraVaciarPapelera As Button + Friend WithEvents bPapeleraEliminar As Button + Friend WithEvents cbTGasto As ComboBox + Friend WithEvents cbSeccional As ComboBox + Friend WithEvents cbTComprobante As ComboBox End Class diff --git a/SireCu/Paneles/ABMEgresos.resx b/SireCu/Paneles/ABMEgresos.resx index 569b34a..96504de 100644 --- a/SireCu/Paneles/ABMEgresos.resx +++ b/SireCu/Paneles/ABMEgresos.resx @@ -117,54 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - True @@ -216,54 +168,22 @@ 17, 17 - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + True @@ -312,20 +232,4 @@ True - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG - YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 - 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw - bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc - VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 - c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 - Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo - mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ - kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D - TgDQASA1MVpwzwAAAABJRU5ErkJggg== - - \ No newline at end of file diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index ed08d2a..273b90a 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -80,11 +80,11 @@ Public Class ABMEgresos nuevo_egreso( comprobante, obtenerID(tbProveedor.Text, "Proveedores"), - obtenerID(tbTGasto.Text, "CategoriasGastos"), + cbTGasto.SelectedValue, obtenerID(tbNombre.Text, "Personas"), dtpFecha.Value.Date, - obtenerID(tbTComprobante.Text, "TiposComprobantes"), - obtenerID(tbSeccional.Text, "Seccionales"), + cbTComprobante.SelectedValue, + cbSeccional.SelectedValue, reintegro, CDbl(tbMonto.Text), tbComentario.Text @@ -108,7 +108,7 @@ Public Class ABMEgresos idModificando = CInt(DGVModificar.Rows(e.RowIndex).Cells("id").Value) TextBoxNombre.Text = DGVModificar.Rows(e.RowIndex).Cells("persona_nombre").Value - ComboBoxCategGasto.SelectedItem = DGVModificar.Rows(e.RowIndex).Cells("categoria_nombre").Value + ComboBoxCategGasto.SelectedValue = DGVModificar.Rows(e.RowIndex).Cells("categoria_gasto_id").Value TextBoxProveedor.Text = DGVModificar.Rows(e.RowIndex).Cells("proveedor_nombre").Value If DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value Is DBNull.Value Then DateTimePickerMesReintegro.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("fecha").Value) @@ -122,10 +122,10 @@ Public Class ABMEgresos DateTimePickerMesReintegro.Checked = True End If End If - ComboBoxSeccional.SelectedItem = DGVModificar.Rows(e.RowIndex).Cells("seccional_nombre").Value + ComboBoxSeccional.SelectedValue = DGVModificar.Rows(e.RowIndex).Cells("seccional_id").Value TextBoxComentario.Text = DGVModificar.Rows(e.RowIndex).Cells("comentario").Value.ToString DateTimePickerFecha.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("fecha").Value) - ComboBoxTipoComprobante.SelectedItem = DGVModificar.Rows(e.RowIndex).Cells("tipo_comprobante_nombre").Value + ComboBoxTipoComprobante.SelectedValue = DGVModificar.Rows(e.RowIndex).Cells("tipo_comprobante_id").Value If DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Contains("-") Then TextBoxPVenta.Text = DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Split("-")(0) TextBoxNroComprobante.Text = DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Split("-")(1) @@ -210,7 +210,7 @@ Public Class ABMEgresos Private Sub ButtonEliminar_Click(sender As Object, e As EventArgs) Handles ButtonEliminar.Click If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Eliminar?") = MsgBoxResult.Ok) Then - eliminar_egreso(idModificando) + eliminar_egreso_soft(idModificando) idModificando = 0 limpiarForm(SplitContainerModificar.Panel2) @@ -331,6 +331,7 @@ Public Class ABMEgresos ' Asignar el id a restaurar idPapelera = CInt(DGVPapelera.Rows(e.RowIndex).Cells("PapeleraId").Value) bPapeleraRestaurar.Enabled = True + bPapeleraEliminar.Enabled = True End Sub @@ -344,6 +345,21 @@ Public Class ABMEgresos CargardDGV(DGVModificar) ActualizarSaldo() bPapeleraRestaurar.Enabled = False + bPapeleraEliminar.Enabled = False + End If + End Sub + + Private Sub bPapeleraEliminar_Click(sender As Object, e As EventArgs) Handles bPapeleraEliminar.Click + If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Eliminar Permanentemente?") = MsgBoxResult.Ok) Then + + eliminar_egreso_hard(idPapelera) + + idPapelera = 0 + CargardDGV(DGVPapelera, 1, "Egresos_Papelera") + CargardDGV(DGVModificar) + ActualizarSaldo() + bPapeleraRestaurar.Enabled = False + bPapeleraEliminar.Enabled = False End If End Sub @@ -357,6 +373,7 @@ Public Class ABMEgresos CargardDGV(DGVModificar) ActualizarSaldo() bPapeleraRestaurar.Enabled = False + bPapeleraEliminar.Enabled = False End If End Sub @@ -370,12 +387,12 @@ Public Class ABMEgresos ' Campos Obligatorios CamposObligatios.AddRange({tbNombre, - tbTGasto, - tbTComprobante, + cbTGasto, + cbTComprobante, tbProveedor, tbNComprobante, tbMonto, - tbSeccional}) + cbSeccional}) dtpFecha.Value = Now dtpReintegro.Value = Now @@ -383,19 +400,19 @@ Public Class ABMEgresos ' Autocomplete al escribir tbProveedor.AutoCompleteCustomSource = autocomplete("Proveedores", "nombre") tbNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") - tbTGasto.AutoCompleteCustomSource = autocomplete("CategoriasGastos", "nombre") - tbTComprobante.AutoCompleteCustomSource = autocomplete("TiposComprobantes", "nombre") - tbSeccional.AutoCompleteCustomSource = autocomplete("Seccionales", "nombre") + cbTGasto.AutoCompleteCustomSource = autocomplete("CategoriasGastos", "nombre") + cbTComprobante.AutoCompleteCustomSource = autocomplete("TiposComprobantes", "nombre") + cbSeccional.AutoCompleteCustomSource = autocomplete("Seccionales", "nombre") ' Colección de Items - tbTGasto.DataSource = Principal.dataset.Tables("CategoriasGastos") - tbTComprobante.DataSource = Principal.dataset.Tables("TiposComprobantes") - tbSeccional.DataSource = Principal.dataset.Tables("Seccionales") - tbTGasto.ValueMember = "id" - tbTGasto.DisplayMember = "nombre" - tbTComprobante.ValueMember = "id" - tbTComprobante.DisplayMember = "nombre" - tbSeccional.ValueMember = "id" - tbSeccional.DisplayMember = "nombre" + cbTGasto.DataSource = Principal.dataset.Tables("CategoriasGastos") + cbTComprobante.DataSource = Principal.dataset.Tables("TiposComprobantes") + cbSeccional.DataSource = Principal.dataset.Tables("Seccionales") + cbTGasto.ValueMember = "id" + cbTGasto.DisplayMember = "nombre" + cbTComprobante.ValueMember = "id" + cbTComprobante.DisplayMember = "nombre" + cbSeccional.ValueMember = "id" + cbSeccional.DisplayMember = "nombre" ' ######################################## TAB Modificar @@ -436,8 +453,6 @@ Public Class ABMEgresos Private Function obtenerID(ByVal Campo_a_comparar As String, ByVal tabla As String) As Integer Dim id As Integer = -1 - cargarTablaEnDataSet(tabla) - For Each row As DataRow In Principal.dataset.Tables(tabla).Rows If (LCase(row.Item("nombre")) = LCase(Campo_a_comparar)) Then id = row.Item("id") @@ -498,7 +513,7 @@ Public Class ABMEgresos Private Sub tbDay_KeyPress(sender As Object, e As KeyPressEventArgs) keyverify(e, numeros:=True) End Sub - Private Sub tbTGasto_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbTGasto.KeyPress + Private Sub tbTGasto_KeyPress(sender As Object, e As KeyPressEventArgs) keyverify(e, letras:=True) End Sub Private Sub tbMonth_KeyPress(sender As Object, e As KeyPressEventArgs) @@ -522,10 +537,10 @@ Public Class ABMEgresos Private Sub tbReintegro_KeyPress(sender As Object, e As KeyPressEventArgs) keyverify(e, numeros:=True) End Sub - Private Sub tbTComprobante_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbTComprobante.KeyPress + Private Sub tbTComprobante_KeyPress(sender As Object, e As KeyPressEventArgs) keyverify(e, letras:=True, espacios:=True) End Sub - Private Sub tbSeccional_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbSeccional.KeyPress + Private Sub tbSeccional_KeyPress(sender As Object, e As KeyPressEventArgs) keyverify(e, letras:=True, numeros:=True, espacios:=True) End Sub @@ -540,8 +555,10 @@ Public Class ABMEgresos ControlesConErroresAgregar.Remove(sender) End If End Sub - Private Sub tbTGasto_Validating(sender As Object, e As CancelEventArgs) Handles tbTGasto.Validating - If (sender.Text = "") Or (exist("CategoriasGastos", "nombre", sender.text) = False) Then + Private Sub cbTGasto_Validating(sender As Object, e As CancelEventArgs) Handles cbTGasto.Validating + ' TODO Revisar + If (sender.Text = "") Or (exist("CategoriasGastos", "nombre", sender.Text) = False) Then + Dim var As String = cbTGasto.SelectedText Principal.ErrorProvider.SetError(sender, "Debe ingresar una Categoría correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") ControlesConErroresAgregar.Add(sender) @@ -550,6 +567,7 @@ Public Class ABMEgresos ControlesConErroresAgregar.Remove(sender) End If End Sub + Private Sub tbProveedor_Validating(sender As Object, e As CancelEventArgs) Handles tbProveedor.Validating If (sender.Text = "") Or (exist("Proveedores", "nombre", sender.text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Proveedor correcto." & vbCrLf & @@ -560,7 +578,8 @@ Public Class ABMEgresos ControlesConErroresAgregar.Remove(sender) End If End Sub - Private Sub tbTComprobante_Validating(sender As Object, e As CancelEventArgs) Handles tbTComprobante.Validating + Private Sub cbTComprobante_Validating(sender As Object, e As CancelEventArgs) Handles cbTComprobante.Validating + ' TODO revisar If (sender.Text = "") Or (exist("TiposComprobantes", "nombre", sender.text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Tipo de Comprobante correcto." & vbCrLf & "Puede agregar uno nuevo en el menú Editar") @@ -579,22 +598,8 @@ Public Class ABMEgresos ControlesConErroresAgregar.Remove(sender) End If End Sub - Private Sub tbReintegro_Validating(sender As Object, e As CancelEventArgs) - If sender.text = "" Then - Principal.ErrorProvider.SetError(sender, "") - ControlesConErroresAgregar.Remove(sender) - Exit Sub - End If - - If (CDbl(sender.Text) < 1) Or (CDbl(sender.Text) > 12) Then - Principal.ErrorProvider.SetError(sender, "Debe ingresar un mes de reintegro válido") - ControlesConErroresAgregar.Add(sender) - Else - Principal.ErrorProvider.SetError(sender, "") - ControlesConErroresAgregar.Remove(sender) - End If - End Sub - Private Sub tbSeccional_Validating(sender As Object, e As CancelEventArgs) Handles tbSeccional.Validating + Private Sub cbSeccional_Validating(sender As Object, e As CancelEventArgs) Handles cbSeccional.Validating + ' TODO Revisar If (sender.Text = "") Or (exist("Seccionales", "nombre", sender.text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Seccional correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") From d93581dfd3850a4011da03f216ee2dbe5b572565 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 5 May 2017 16:47:09 -0300 Subject: [PATCH 16/27] Fix y Optimizacion de funciones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Optimizacion de función ultimoaño Fix función ActualizarSaldo --- SireCu/OtrasFunciones.vb | 31 ++++++++++++------------------- SireCu/Paneles/ABMEgresos.vb | 4 ++-- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/SireCu/OtrasFunciones.vb b/SireCu/OtrasFunciones.vb index 8454dbf..fec164a 100644 --- a/SireCu/OtrasFunciones.vb +++ b/SireCu/OtrasFunciones.vb @@ -16,36 +16,35 @@ Module OtrasFunciones Dim ingresos As Double = 0 Dim egresos As Double = 0 - 'TODO En gresos hay que obtener no solo lo del trimestre actual sino tambièn lo que entre por mes de reintegro a ese trimestre Select Case trimestre Case "Primero" trimAnterior = "Cuarto" queryIngresos = "SELECT SUM( [ingresos_prov] + [ingresos_central] + [ingresos_otros] ) AS Ingresos FROM [Ingresos]" & - " WHERE DATEPART(month, [fecha]) BETWEEN 1 AND 3 AND DATEPART(year, [fecha]) = " & añoAnterior + " WHERE DATEPART(month, [fecha]) BETWEEN 1 AND 3 AND DATEPART(year, [fecha]) = " & año - queryEgresos = "SELECT SUM( [monto] ) AS Egresos FROM [Egresos] WHERE DATEPART(month, [fecha]) BETWEEN 1 AND 3" & - " AND DATEPART(year, [fecha]) = " & año & " AND [eliminado] = 0" + queryEgresos = "SELECT SUM( [monto] ) AS Egresos FROM [Egresos] WHERE DATEPART(month, [mes_reintegro]) BETWEEN 1 AND 3" & + " AND DATEPART(year, [mes_reintegro]) = " & año & " AND [eliminado] = 0" Case "Segundo" trimAnterior = "Primero" queryIngresos = "SELECT SUM( [ingresos_prov] + [ingresos_central] + [ingresos_otros] ) AS Ingresos FROM [Ingresos]" & " WHERE DATEPART(month, [fecha]) BETWEEN 4 AND 6 AND DATEPART(year, [fecha]) = " & año - queryEgresos = "SELECT SUM( [monto] ) AS Egresos FROM [Egresos] WHERE DATEPART(month, [fecha]) BETWEEN 4 AND 6" & - " AND DATEPART(year, [fecha]) = " & año & " AND [eliminado] = 0" + queryEgresos = "SELECT SUM( [monto] ) AS Egresos FROM [Egresos] WHERE DATEPART(month, [mes_reintegro]) BETWEEN 4 AND 6" & + " AND DATEPART(year, [mes_reintegro]) = " & año & " AND [eliminado] = 0" Case "Tercero" trimAnterior = "Segundo" queryIngresos = "SELECT SUM( [ingresos_prov] + [ingresos_central] + [ingresos_otros] ) AS Ingresos FROM [Ingresos]" & " WHERE DATEPART(month, [fecha]) BETWEEN 7 AND 9 AND DATEPART(year, [fecha]) = " & año - queryEgresos = "SELECT SUM( [monto] ) AS Egresos FROM [Egresos] WHERE DATEPART(month, [fecha]) BETWEEN 7 AND 9" & - " AND DATEPART(year, [fecha]) = " & año & " AND [eliminado] = 0" + queryEgresos = "SELECT SUM( [monto] ) AS Egresos FROM [Egresos] WHERE DATEPART(month, [mes_reintegro]) BETWEEN 7 AND 9" & + " AND DATEPART(year, [mes_reintegro]) = " & año & " AND [eliminado] = 0" Case "Cuarto" trimAnterior = "Tercero" queryIngresos = "SELECT SUM( [ingresos_prov] + [ingresos_central] + [ingresos_otros] ) AS Ingresos FROM [Ingresos]" & "WHERE DATEPART(month, [fecha]) BETWEEN 10 AND 12 AND DATEPART(year, [fecha]) = " & año - queryEgresos = "SELECT SUM( [monto] ) AS Egresos FROM [Egresos] WHERE DATEPART(month, [fecha]) BETWEEN 10 AND 12" & - " AND DATEPART(year, [fecha]) = " & año & " AND [eliminado] = 0" + queryEgresos = "SELECT SUM( [monto] ) AS Egresos FROM [Egresos] WHERE DATEPART(month, [mes_reintegro]) BETWEEN 10 AND 12" & + " AND DATEPART(year, [mes_reintegro]) = " & año & " AND [eliminado] = 0" End Select ' 1) @@ -108,19 +107,13 @@ Module OtrasFunciones Public Function ultimoaño(ByVal tabla As String) - ' TODO reemplazar fill dataset por command.ExecuteReader - Principal.query = "SELECT fecha FROM " & tabla & " ORDER BY fecha DESC" - consultarNQ(Principal.query, Principal.command) - - Principal.dataset.Tables(tabla).Clear() - Principal.tableadapters(tabla) = New SqlCeDataAdapter(Principal.command) - Principal.tableadapters(tabla).Fill(Principal.dataset.Tables(tabla)) + Dim data As DataTable = consultarReader(Principal.query) - If (Principal.dataset.Tables(tabla).Rows.Count() = 0) Then + If (data.Rows.Count() = 0) Then Return (Now.Date.Year.ToString) - Else : Return (DatePart(DateInterval.Year, Principal.dataset.Tables(tabla).Rows.Item(0).Item("fecha"))) + Else : Return (DatePart(DateInterval.Year, data.Rows.Item(0).Item("fecha"))) End If End Function diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index 273b90a..8196a65 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -39,7 +39,7 @@ Public Class ABMEgresos Exit Sub End If - 'Verificar Saldo Disponible 'OPTIMIZAR TODO + 'Verificar Saldo Disponible Dim saldo As Double Select Case DatePart(DateInterval.Month, dtpFecha.Value) Case 1 To 3 @@ -149,7 +149,7 @@ Public Class ABMEgresos Exit Sub End If - 'Verificar Saldo Disponible 'OPTIMIZAR TODO + 'Verificar Saldo Disponible Dim saldo As Double Select Case DatePart(DateInterval.Month, DateTimePickerFecha.Value) Case 1 To 3 From 680168e6d6f1a747bfc4b3e00bafa50f1e69a744 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Sun, 7 May 2017 11:50:20 -0300 Subject: [PATCH 17/27] TODO's pendientes --- SireCu/Clases/Ingreso.vb | 24 ++++-------------------- SireCu/Paneles/ABMEgresos.vb | 26 +++++++++++++------------- SireCu/Paneles/ABMIngresos.vb | 35 ++++++++++++++++++----------------- 3 files changed, 35 insertions(+), 50 deletions(-) diff --git a/SireCu/Clases/Ingreso.vb b/SireCu/Clases/Ingreso.vb index 3f26d18..3f4e877 100644 --- a/SireCu/Clases/Ingreso.vb +++ b/SireCu/Clases/Ingreso.vb @@ -17,30 +17,14 @@ Module Ingreso End Sub - Public Function mostrar_ingreso(ByVal mes As Integer, ByVal año As Integer) - - ' TODO reemplazar fill dataset por command.ExecuteReader + Public Function mostrar_ingreso(ByVal mes As Integer, ByVal año As Integer) As DataTable Principal.query = "SELECT * from ingresos where DATEPART(month, fecha) = '" & mes & "'" & " And DatePart(Year, fecha) = '" & año & "'" - consultarNQ(Principal.query, Principal.command) - Principal.tableadapters("Ingresos") = New SqlCeDataAdapter(Principal.command) - Principal.dataset.Tables("Ingresos").Clear() - Principal.tableadapters("Ingresos").Fill(Principal.dataset.Tables("ingresos")) - - Dim array() As String - If (Principal.dataset.Tables("ingresos").Rows.Count = 0) Then - array = {0} - Return (array) - Else - array = { - Principal.dataset.Tables("ingresos").Rows.Item(0).Item("ingresos_prov"), - Principal.dataset.Tables("ingresos").Rows.Item(0).Item("ingresos_central"), - Principal.dataset.Tables("ingresos").Rows.Item(0).Item("ingresos_otros") - } - Return array - End If + Dim dt As DataTable = consultarReader(Principal.query) + + Return dt End Function diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index 8196a65..b8a7433 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -546,7 +546,7 @@ Public Class ABMEgresos 'Validating Private Sub tbNombre_Validating(sender As Object, e As CancelEventArgs) Handles tbNombre.Validating - If (sender.Text = "") Or (exist("Personas", "nombre", sender.text) = False) Then + If (sender.Text = "") Or (tbNombre.AutoCompleteCustomSource.Contains(sender.text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Persona correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") ControlesConErroresAgregar.Add(sender) @@ -556,8 +556,8 @@ Public Class ABMEgresos End If End Sub Private Sub cbTGasto_Validating(sender As Object, e As CancelEventArgs) Handles cbTGasto.Validating - ' TODO Revisar - If (sender.Text = "") Or (exist("CategoriasGastos", "nombre", sender.Text) = False) Then + ' Verifica que haya un item seleccionado y corresponda a la colección de opciones + If (sender.Text = "") Or (cbTGasto.AutoCompleteCustomSource.Contains(sender.Text) = False) Then Dim var As String = cbTGasto.SelectedText Principal.ErrorProvider.SetError(sender, "Debe ingresar una Categoría correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") @@ -569,7 +569,7 @@ Public Class ABMEgresos End Sub Private Sub tbProveedor_Validating(sender As Object, e As CancelEventArgs) Handles tbProveedor.Validating - If (sender.Text = "") Or (exist("Proveedores", "nombre", sender.text) = False) Then + If (sender.Text = "") Or (tbProveedor.AutoCompleteCustomSource.Contains(sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Proveedor correcto." & vbCrLf & "Puede agregar uno nuevo en el menú Editar") ControlesConErroresAgregar.Add(sender) @@ -579,8 +579,8 @@ Public Class ABMEgresos End If End Sub Private Sub cbTComprobante_Validating(sender As Object, e As CancelEventArgs) Handles cbTComprobante.Validating - ' TODO revisar - If (sender.Text = "") Or (exist("TiposComprobantes", "nombre", sender.text) = False) Then + ' Verifica que haya un item seleccionado y corresponda a la colección de opciones + If (sender.Text = "") Or (cbTGasto.AutoCompleteCustomSource.Contains(sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Tipo de Comprobante correcto." & vbCrLf & "Puede agregar uno nuevo en el menú Editar") ControlesConErroresAgregar.Add(sender) @@ -599,8 +599,8 @@ Public Class ABMEgresos End If End Sub Private Sub cbSeccional_Validating(sender As Object, e As CancelEventArgs) Handles cbSeccional.Validating - ' TODO Revisar - If (sender.Text = "") Or (exist("Seccionales", "nombre", sender.text) = False) Then + ' Verifica que haya un item seleccionado y corresponda a la colección de opciones + If (sender.Text = "") Or (cbSeccional.AutoCompleteCustomSource.Contains(sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Seccional correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") ControlesConErroresAgregar.Add(sender) @@ -666,7 +666,7 @@ Public Class ABMEgresos 'Validating Private Sub TextBoxNombre_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBoxNombre.Validating - If (sender.Text = "") Or (exist("Personas", "nombre", sender.text) = False) Then + If (sender.Text = "") Or (TextBoxNombre.AutoCompleteCustomSource.Contains(sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Persona correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") ControlesConErroresModificar.Add(sender) @@ -676,7 +676,7 @@ Public Class ABMEgresos End If End Sub Private Sub TextBoxProveedor_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBoxProveedor.Validating - If (sender.Text = "") Or (exist("Proveedores", "nombre", sender.text) = False) Then + If (sender.Text = "") Or (TextBoxProveedor.AutoCompleteCustomSource.Contains(sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Proveedor correcto." & vbCrLf & "Puede agregar uno nuevo en el menú Editar") ControlesConErroresModificar.Add(sender) @@ -719,7 +719,7 @@ Public Class ABMEgresos End If End Sub Private Sub ComboBoxSeccional_Validating(sender As Object, e As CancelEventArgs) Handles ComboBoxSeccional.Validating - If (sender.Text = "") Or (exist("Seccionales", "nombre", sender.text) = False) Then + If (sender.Text = "") Or (ComboBoxSeccional.AutoCompleteCustomSource.Contains(sender.text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Seccional correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") ControlesConErroresModificar.Add(sender) @@ -729,7 +729,7 @@ Public Class ABMEgresos End If End Sub Private Sub ComboBoxTipoComprobante_Validating(sender As Object, e As CancelEventArgs) Handles ComboBoxTipoComprobante.Validating - If (sender.Text = "") Or (exist("TiposComprobantes", "nombre", sender.text) = False) Then + If (sender.Text = "") Or (ComboBoxTipoComprobante.AutoCompleteCustomSource.Contains(sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Tipo de Comprobante correcto." & vbCrLf & "Puede agregar uno nuevo en el menú Editar") ControlesConErroresModificar.Add(sender) @@ -739,7 +739,7 @@ Public Class ABMEgresos End If End Sub Private Sub ComboBoxCategGasto_Validating(sender As Object, e As CancelEventArgs) Handles ComboBoxCategGasto.Validating - If (sender.Text = "") Or (exist("CategoriasGastos", "nombre", sender.text) = False) Then + If (sender.Text = "") Or (ComboBoxCategGasto.AutoCompleteCustomSource.Contains(sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Categoría correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") ControlesConErroresModificar.Add(sender) diff --git a/SireCu/Paneles/ABMIngresos.vb b/SireCu/Paneles/ABMIngresos.vb index 4d843dd..5d95c6f 100644 --- a/SireCu/Paneles/ABMIngresos.vb +++ b/SireCu/Paneles/ABMIngresos.vb @@ -96,8 +96,24 @@ Public Class ABMIngresos #Region "Helpers" Private Sub cargar(ByVal mes As Integer, ByVal fila As Integer) - Dim array = mostrar_ingreso(mes, tb_Año.Text) - If (array.Length = 1) Then + Dim dt As DataTable = mostrar_ingreso(mes, tb_Año.Text) + + If dt.Rows.Count > 0 Then + Select Case fila + Case 1 + tb_IngresosC1.Text = dt.Rows(0).Item("ingresos_central") + tb_IngresosO1.Text = dt.Rows(0).Item("ingresos_otros") + tb_IngresosP1.Text = dt.Rows(0).Item("ingresos_prov") + Case 2 + tb_IngresosC2.Text = dt.Rows(0).Item("ingresos_central") + tb_IngresosO2.Text = dt.Rows(0).Item("ingresos_otros") + tb_IngresosP2.Text = dt.Rows(0).Item("ingresos_prov") + Case 3 + tb_IngresosC3.Text = dt.Rows(0).Item("ingresos_central") + tb_IngresosO3.Text = dt.Rows(0).Item("ingresos_otros") + tb_IngresosP3.Text = dt.Rows(0).Item("ingresos_prov") + End Select + Else Select Case fila Case 1 tb_IngresosC1.Text = "0.0" @@ -112,21 +128,6 @@ Public Class ABMIngresos tb_IngresosO3.Text = "0.0" tb_IngresosP3.Text = "0.0" End Select - Else - Select Case fila - Case 1 - tb_IngresosC1.Text = array(1) - tb_IngresosO1.Text = array(2) - tb_IngresosP1.Text = array(0) - Case 2 - tb_IngresosC2.Text = array(1) - tb_IngresosO2.Text = array(2) - tb_IngresosP2.Text = array(0) - Case 3 - tb_IngresosC3.Text = array(1) - tb_IngresosO3.Text = array(2) - tb_IngresosP3.Text = array(0) - End Select End If End Sub From a5ef7191adfd823c07754c5e60c6bc7493f158d4 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Sun, 7 May 2017 13:34:59 -0300 Subject: [PATCH 18/27] Campo Seleccionado en BD y DGV de modificar --- SireCu/Clases/Egreso.vb | 11 +- SireCu/DBSireCu.sdf | Bin 360448 -> 360448 bytes SireCu/Paneles/ABMEgresos.Designer.vb | 392 ++++++++++++++------------ SireCu/Paneles/ABMEgresos.resx | 108 +++++++ SireCu/Paneles/ABMEgresos.vb | 41 ++- 5 files changed, 352 insertions(+), 200 deletions(-) diff --git a/SireCu/Clases/Egreso.vb b/SireCu/Clases/Egreso.vb index 7dd4553..88aea03 100644 --- a/SireCu/Clases/Egreso.vb +++ b/SireCu/Clases/Egreso.vb @@ -6,9 +6,9 @@ Module Egreso ByVal fecha As Date, ByVal tipo_comp As String, ByVal secc As String, ByVal reintegro As Date, ByVal monto As Double, ByVal comentario As String) Principal.query = "INSERT INTO egresos (nro_comprobante, proveedor_id, categoria_gasto_id, persona_id, " & - "fecha, tipo_comprobante_id, seccional_id, mes_reintegro, monto, comentario, eliminado)" & + "fecha, tipo_comprobante_id, seccional_id, mes_reintegro, monto, comentario, eliminado, seleccionado)" & "VALUES (@nro_comprobante, @proveedor, @cat_gasto, @persona, @fecha, @t_comprobante, " & - "@seccional, @reintegro, @monto, @comentario, 0)" + "@seccional, @reintegro, @monto, @comentario, 0, 0)" Principal.command.Parameters.Clear() Principal.command.Parameters.AddWithValue("@nro_comprobante", compro) Principal.command.Parameters.AddWithValue("@proveedor", proveedor) @@ -123,7 +123,8 @@ Module Egreso Secc.nombre AS seccional_nombre, E.mes_reintegro AS mes_reintegro, E.monto AS monto, - E.comentario AS comentario + E.comentario AS comentario, + E.seleccionado AS seleccionado FROM Egresos AS E LEFT JOIN TiposComprobantes AS Comp ON E.tipo_comprobante_id = Comp.id LEFT JOIN Proveedores AS Pro ON E.proveedor_id = Pro.id @@ -161,6 +162,7 @@ Module Egreso dgv.Columns.Item(13).DataPropertyName = "mes_reintegro" dgv.Columns.Item(14).DataPropertyName = "monto" dgv.Columns.Item(15).DataPropertyName = "comentario" + dgv.Columns.Item(16).DataPropertyName = "seleccionado" dgv.DataSource = mybinding End Sub @@ -206,14 +208,13 @@ Module Egreso dgv.Columns.Item(13).DataPropertyName = "mes_reintegro" dgv.Columns.Item(14).DataPropertyName = "monto" dgv.Columns.Item(15).DataPropertyName = "comentario" + dgv.Columns.Item(16).DataPropertyName = "seleccionado" dgv.DataSource = mybinding End Sub Public Function comprobante_repetido(ByVal nComprobante As String, ByVal proveedorID As Integer) - ' cargarTablaEnDataSet("Egresos") - Dim flag As Boolean = False For i = 0 To Principal.dataset.Tables("Egresos").Rows.Count - 1 diff --git a/SireCu/DBSireCu.sdf b/SireCu/DBSireCu.sdf index 87012aee574bfa6f286151b871fd68dafa37296d..3da8fabb9733b8601ae1a9c66875d2dfedc50ab4 100644 GIT binary patch delta 1048 zcmZuwT}TvB6h8Of*`2v-JG%?3>n7oDqy}k?_M>5otFDw1G$!@XOPX3%rdvxyWHb{Z z1r@9NFcD-v$SNuQFu~A+x(^iI9MymNSiG~0%)`u<4l1<4`4p95BVgXey76D8;0Uof^%WU7Qw!@|>fKxWR z>1fH#0)WEgX##LQQHg!FFMA2h==E{kNl(_kUM8Fbs!rW8M57F@kL@eE8eAf1h&d%3 zmjkr0t7;;|g~6`T0NKwoM1ar8I1(VEuB3$AboNlvo6q9p>BF8fq)95bH!%=&>%Apu zGMo~OYbuu}x*VUj56Otuj=VWgz_ml&aBHCv97Bt)WIJ}#g>UUE9)_YCG>j4)I%V9B zpw2w{edXNU2If9$xyL!?9>)@$sj;2L5P)qOm2tVN3?Luc5wL4|LB?7{#;v97EpoIQ z<`EPFc(MmuKq1fqun{Ef!&$PPWmn|lcm1&%nKu{({H@aa&2m_H$1XY9B$&V{!YLRULLpo6!D1>5nq4n#P@zUF{B-kl!)vXVrpfWJ>y_Dvc=pH zs4@IwWSmEW)-gd2+Dj25(9|iiPMb>*!Kj-g`*=KdNsHenQTpQ3GppW`Rc}cKjm#R t+pfY)<63D+)`_vd9Tv4F_P_W-4nLVDZjaRV%7VI>jS|X14RYf)F|82{d%VfU@ByA$SQOEiV1kqcv?X0)WTV0sAA>QD#Ame#Nk%{*9Hi!N?Z zqPE3ERut$$pknRe6%j>Ic+0R(UDiW{6zxKE@DSU3vrBd82Q%OIzWKf1`@L_zNTehZ zDe=!5%f~=qSiU4!0FVe_Y_IHGX09rL{g3=BsCs%cK)MiMPE_Tt2V8+e20%wlkwiP! zoB$U^9wz`@@oKCo16v3@OIDjnH^Xc=V-lxBB^6Jnqz#0l1jI^#A|> diff --git a/SireCu/Paneles/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb index fcac643..854fd89 100644 --- a/SireCu/Paneles/ABMEgresos.Designer.vb +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -53,22 +53,6 @@ Partial Class ABMEgresos Me.SplitContainerModificar = New System.Windows.Forms.SplitContainer() Me.ToolStripContainerModificar = New System.Windows.Forms.ToolStripContainer() Me.DGVModificar = New System.Windows.Forms.DataGridView() - Me.id = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.nro_comprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.tipo_comprobante_id = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.tipo_comprobante_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.proveedor_id = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.proveedor_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.categoria_gasto_id = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.categoria_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.persona_id = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.persona_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.fecha = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.seccional_id = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.seccional_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.mes_reintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.monto = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.comentario = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.ToolStripModificar = New System.Windows.Forms.ToolStrip() Me.TSLabelTrimestre = New System.Windows.Forms.ToolStripLabel() Me.TSComboBoxTrimestre = New System.Windows.Forms.ToolStripComboBox() @@ -106,6 +90,9 @@ Partial Class ABMEgresos Me.SplitContainerPapelera = New System.Windows.Forms.SplitContainer() Me.ToolStripContainerPapelera = New System.Windows.Forms.ToolStripContainer() Me.DGVPapelera = New System.Windows.Forms.DataGridView() + Me.bPapeleraEliminar = New System.Windows.Forms.Button() + Me.bPapeleraVaciarPapelera = New System.Windows.Forms.Button() + Me.bPapeleraRestaurar = New System.Windows.Forms.Button() Me.PapeleraId = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.PapeleraNroComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.PapeleraTComprobanteId = New System.Windows.Forms.DataGridViewTextBoxColumn() @@ -122,9 +109,24 @@ Partial Class ABMEgresos Me.PapeleraReintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.PapeleraMonto = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.PapeleraComentario = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.bPapeleraEliminar = New System.Windows.Forms.Button() - Me.bPapeleraVaciarPapelera = New System.Windows.Forms.Button() - Me.bPapeleraRestaurar = New System.Windows.Forms.Button() + Me.PapeleraSeleccionado = New System.Windows.Forms.DataGridViewCheckBoxColumn() + Me.id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.nro_comprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.tipo_comprobante_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.tipo_comprobante_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.proveedor_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.proveedor_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.categoria_gasto_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.categoria_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.persona_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.persona_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.fecha = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.seccional_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.seccional_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.mes_reintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.monto = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.comentario = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.seleccionado = New System.Windows.Forms.DataGridViewCheckBoxColumn() Me.TabControl.SuspendLayout() Me.TabPageAgregar.SuspendLayout() Me.TabPageModificar.SuspendLayout() @@ -495,7 +497,7 @@ Partial Class ABMEgresos Me.DGVModificar.AllowUserToAddRows = False Me.DGVModificar.AllowUserToDeleteRows = False Me.DGVModificar.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DGVModificar.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.id, Me.nro_comprobante, Me.tipo_comprobante_id, Me.tipo_comprobante_nombre, Me.proveedor_id, Me.proveedor_nombre, Me.categoria_gasto_id, Me.categoria_nombre, Me.persona_id, Me.persona_nombre, Me.fecha, Me.seccional_id, Me.seccional_nombre, Me.mes_reintegro, Me.monto, Me.comentario}) + Me.DGVModificar.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.id, Me.nro_comprobante, Me.tipo_comprobante_id, Me.tipo_comprobante_nombre, Me.proveedor_id, Me.proveedor_nombre, Me.categoria_gasto_id, Me.categoria_nombre, Me.persona_id, Me.persona_nombre, Me.fecha, Me.seccional_id, Me.seccional_nombre, Me.mes_reintegro, Me.monto, Me.comentario, Me.seleccionado}) Me.DGVModificar.Dock = System.Windows.Forms.DockStyle.Fill Me.DGVModificar.Location = New System.Drawing.Point(0, 0) Me.DGVModificar.Name = "DGVModificar" @@ -504,112 +506,6 @@ Partial Class ABMEgresos Me.DGVModificar.Size = New System.Drawing.Size(741, 176) Me.DGVModificar.TabIndex = 0 ' - 'id - ' - Me.id.HeaderText = "Id" - Me.id.Name = "id" - Me.id.ReadOnly = True - ' - 'nro_comprobante - ' - Me.nro_comprobante.HeaderText = "Nro Comprobante" - Me.nro_comprobante.Name = "nro_comprobante" - Me.nro_comprobante.ReadOnly = True - ' - 'tipo_comprobante_id - ' - Me.tipo_comprobante_id.HeaderText = "tipo_comprobante_id" - Me.tipo_comprobante_id.Name = "tipo_comprobante_id" - Me.tipo_comprobante_id.ReadOnly = True - Me.tipo_comprobante_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.tipo_comprobante_id.Visible = False - ' - 'tipo_comprobante_nombre - ' - Me.tipo_comprobante_nombre.HeaderText = "Tipo Comprobante" - Me.tipo_comprobante_nombre.Name = "tipo_comprobante_nombre" - Me.tipo_comprobante_nombre.ReadOnly = True - ' - 'proveedor_id - ' - Me.proveedor_id.HeaderText = "proveedor_id" - Me.proveedor_id.Name = "proveedor_id" - Me.proveedor_id.ReadOnly = True - Me.proveedor_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.proveedor_id.Visible = False - ' - 'proveedor_nombre - ' - Me.proveedor_nombre.HeaderText = "Proveedor" - Me.proveedor_nombre.Name = "proveedor_nombre" - Me.proveedor_nombre.ReadOnly = True - ' - 'categoria_gasto_id - ' - Me.categoria_gasto_id.HeaderText = "categoria_gasto_id" - Me.categoria_gasto_id.Name = "categoria_gasto_id" - Me.categoria_gasto_id.ReadOnly = True - Me.categoria_gasto_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.categoria_gasto_id.Visible = False - ' - 'categoria_nombre - ' - Me.categoria_nombre.HeaderText = "Categoria Gasto" - Me.categoria_nombre.Name = "categoria_nombre" - Me.categoria_nombre.ReadOnly = True - ' - 'persona_id - ' - Me.persona_id.HeaderText = "persona_id" - Me.persona_id.Name = "persona_id" - Me.persona_id.ReadOnly = True - Me.persona_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.persona_id.Visible = False - ' - 'persona_nombre - ' - Me.persona_nombre.HeaderText = "Persona" - Me.persona_nombre.Name = "persona_nombre" - Me.persona_nombre.ReadOnly = True - ' - 'fecha - ' - Me.fecha.HeaderText = "Fecha" - Me.fecha.Name = "fecha" - Me.fecha.ReadOnly = True - ' - 'seccional_id - ' - Me.seccional_id.HeaderText = "seccional_id" - Me.seccional_id.Name = "seccional_id" - Me.seccional_id.ReadOnly = True - Me.seccional_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.seccional_id.Visible = False - ' - 'seccional_nombre - ' - Me.seccional_nombre.HeaderText = "Seccional" - Me.seccional_nombre.Name = "seccional_nombre" - Me.seccional_nombre.ReadOnly = True - ' - 'mes_reintegro - ' - Me.mes_reintegro.HeaderText = "Mes Reintegro" - Me.mes_reintegro.Name = "mes_reintegro" - Me.mes_reintegro.ReadOnly = True - ' - 'monto - ' - Me.monto.HeaderText = "Monto" - Me.monto.Name = "monto" - Me.monto.ReadOnly = True - ' - 'comentario - ' - Me.comentario.HeaderText = "Comentario" - Me.comentario.Name = "comentario" - Me.comentario.ReadOnly = True - ' 'ToolStripModificar ' Me.ToolStripModificar.Dock = System.Windows.Forms.DockStyle.None @@ -617,7 +513,7 @@ Partial Class ABMEgresos Me.ToolStripModificar.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TSLabelTrimestre, Me.TSComboBoxTrimestre, Me.TSLabelAño, Me.TSTextBoxAño, Me.TSLabelFiltro1, Me.TSComboBoxFiltro1, Me.TSTextBoxFiltro1, Me.TSButtonFiltrar}) Me.ToolStripModificar.Location = New System.Drawing.Point(3, 0) Me.ToolStripModificar.Name = "ToolStripModificar" - Me.ToolStripModificar.Size = New System.Drawing.Size(652, 25) + Me.ToolStripModificar.Size = New System.Drawing.Size(683, 25) Me.ToolStripModificar.TabIndex = 0 ' 'TSLabelTrimestre @@ -655,7 +551,7 @@ Partial Class ABMEgresos ' Me.TSComboBoxFiltro1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend Me.TSComboBoxFiltro1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems - Me.TSComboBoxFiltro1.Items.AddRange(New Object() {"Id", "Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario"}) + Me.TSComboBoxFiltro1.Items.AddRange(New Object() {"Id", "Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario", "Seleccionado"}) Me.TSComboBoxFiltro1.Name = "TSComboBoxFiltro1" Me.TSComboBoxFiltro1.Size = New System.Drawing.Size(121, 25) Me.TSComboBoxFiltro1.ToolTipText = "Seleccione columna por la cual desea filtrar" @@ -949,7 +845,7 @@ Partial Class ABMEgresos Me.DGVPapelera.AllowUserToAddRows = False Me.DGVPapelera.AllowUserToDeleteRows = False Me.DGVPapelera.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DGVPapelera.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.PapeleraId, Me.PapeleraNroComprobante, Me.PapeleraTComprobanteId, Me.PapeleraTipoComprobante, Me.PapeleraProveedorId, Me.PapeleraProveedor, Me.PapeleraCategoriaGastoId, Me.PapeleraCategoriaGasto, Me.PapeleraPersonaId, Me.PapeleraPersona, Me.PapeleraFecha, Me.PapeleraSeccionalId, Me.PapeleraSeccional, Me.PapeleraReintegro, Me.PapeleraMonto, Me.PapeleraComentario}) + Me.DGVPapelera.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.PapeleraId, Me.PapeleraNroComprobante, Me.PapeleraTComprobanteId, Me.PapeleraTipoComprobante, Me.PapeleraProveedorId, Me.PapeleraProveedor, Me.PapeleraCategoriaGastoId, Me.PapeleraCategoriaGasto, Me.PapeleraPersonaId, Me.PapeleraPersona, Me.PapeleraFecha, Me.PapeleraSeccionalId, Me.PapeleraSeccional, Me.PapeleraReintegro, Me.PapeleraMonto, Me.PapeleraComentario, Me.PapeleraSeleccionado}) Me.DGVPapelera.Dock = System.Windows.Forms.DockStyle.Fill Me.DGVPapelera.Location = New System.Drawing.Point(0, 0) Me.DGVPapelera.Name = "DGVPapelera" @@ -958,6 +854,41 @@ Partial Class ABMEgresos Me.DGVPapelera.Size = New System.Drawing.Size(741, 325) Me.DGVPapelera.TabIndex = 0 ' + 'bPapeleraEliminar + ' + Me.bPapeleraEliminar.Enabled = False + Me.bPapeleraEliminar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.bPapeleraEliminar.ForeColor = System.Drawing.Color.Red + Me.bPapeleraEliminar.Location = New System.Drawing.Point(289, 5) + Me.bPapeleraEliminar.Name = "bPapeleraEliminar" + Me.bPapeleraEliminar.Size = New System.Drawing.Size(163, 56) + Me.bPapeleraEliminar.TabIndex = 105 + Me.bPapeleraEliminar.Text = "Eliminar Permanetemente" + Me.bPapeleraEliminar.UseVisualStyleBackColor = True + ' + 'bPapeleraVaciarPapelera + ' + Me.bPapeleraVaciarPapelera.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.bPapeleraVaciarPapelera.ForeColor = System.Drawing.Color.Red + Me.bPapeleraVaciarPapelera.Location = New System.Drawing.Point(486, 5) + Me.bPapeleraVaciarPapelera.Name = "bPapeleraVaciarPapelera" + Me.bPapeleraVaciarPapelera.Size = New System.Drawing.Size(163, 56) + Me.bPapeleraVaciarPapelera.TabIndex = 104 + Me.bPapeleraVaciarPapelera.Text = "Vaciar Papelera" + Me.bPapeleraVaciarPapelera.UseVisualStyleBackColor = True + ' + 'bPapeleraRestaurar + ' + Me.bPapeleraRestaurar.Enabled = False + Me.bPapeleraRestaurar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.bPapeleraRestaurar.ForeColor = System.Drawing.Color.Red + Me.bPapeleraRestaurar.Location = New System.Drawing.Point(91, 5) + Me.bPapeleraRestaurar.Name = "bPapeleraRestaurar" + Me.bPapeleraRestaurar.Size = New System.Drawing.Size(163, 56) + Me.bPapeleraRestaurar.TabIndex = 103 + Me.bPapeleraRestaurar.Text = "Restaurar" + Me.bPapeleraRestaurar.UseVisualStyleBackColor = True + ' 'PapeleraId ' Me.PapeleraId.HeaderText = "Id" @@ -1064,40 +995,123 @@ Partial Class ABMEgresos Me.PapeleraComentario.Name = "PapeleraComentario" Me.PapeleraComentario.ReadOnly = True ' - 'bPapeleraEliminar + 'PapeleraSeleccionado ' - Me.bPapeleraEliminar.Enabled = False - Me.bPapeleraEliminar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.bPapeleraEliminar.ForeColor = System.Drawing.Color.Red - Me.bPapeleraEliminar.Location = New System.Drawing.Point(289, 5) - Me.bPapeleraEliminar.Name = "bPapeleraEliminar" - Me.bPapeleraEliminar.Size = New System.Drawing.Size(163, 56) - Me.bPapeleraEliminar.TabIndex = 105 - Me.bPapeleraEliminar.Text = "Eliminar Permanetemente" - Me.bPapeleraEliminar.UseVisualStyleBackColor = True + Me.PapeleraSeleccionado.HeaderText = "Seleccionado" + Me.PapeleraSeleccionado.Name = "PapeleraSeleccionado" + Me.PapeleraSeleccionado.ReadOnly = True ' - 'bPapeleraVaciarPapelera + 'id ' - Me.bPapeleraVaciarPapelera.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.bPapeleraVaciarPapelera.ForeColor = System.Drawing.Color.Red - Me.bPapeleraVaciarPapelera.Location = New System.Drawing.Point(486, 5) - Me.bPapeleraVaciarPapelera.Name = "bPapeleraVaciarPapelera" - Me.bPapeleraVaciarPapelera.Size = New System.Drawing.Size(163, 56) - Me.bPapeleraVaciarPapelera.TabIndex = 104 - Me.bPapeleraVaciarPapelera.Text = "Vaciar Papelera" - Me.bPapeleraVaciarPapelera.UseVisualStyleBackColor = True + Me.id.HeaderText = "Id" + Me.id.Name = "id" + Me.id.ReadOnly = True ' - 'bPapeleraRestaurar + 'nro_comprobante ' - Me.bPapeleraRestaurar.Enabled = False - Me.bPapeleraRestaurar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.bPapeleraRestaurar.ForeColor = System.Drawing.Color.Red - Me.bPapeleraRestaurar.Location = New System.Drawing.Point(91, 5) - Me.bPapeleraRestaurar.Name = "bPapeleraRestaurar" - Me.bPapeleraRestaurar.Size = New System.Drawing.Size(163, 56) - Me.bPapeleraRestaurar.TabIndex = 103 - Me.bPapeleraRestaurar.Text = "Restaurar" - Me.bPapeleraRestaurar.UseVisualStyleBackColor = True + Me.nro_comprobante.HeaderText = "Nro Comprobante" + Me.nro_comprobante.Name = "nro_comprobante" + Me.nro_comprobante.ReadOnly = True + ' + 'tipo_comprobante_id + ' + Me.tipo_comprobante_id.HeaderText = "tipo_comprobante_id" + Me.tipo_comprobante_id.Name = "tipo_comprobante_id" + Me.tipo_comprobante_id.ReadOnly = True + Me.tipo_comprobante_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.tipo_comprobante_id.Visible = False + ' + 'tipo_comprobante_nombre + ' + Me.tipo_comprobante_nombre.HeaderText = "Tipo Comprobante" + Me.tipo_comprobante_nombre.Name = "tipo_comprobante_nombre" + Me.tipo_comprobante_nombre.ReadOnly = True + ' + 'proveedor_id + ' + Me.proveedor_id.HeaderText = "proveedor_id" + Me.proveedor_id.Name = "proveedor_id" + Me.proveedor_id.ReadOnly = True + Me.proveedor_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.proveedor_id.Visible = False + ' + 'proveedor_nombre + ' + Me.proveedor_nombre.HeaderText = "Proveedor" + Me.proveedor_nombre.Name = "proveedor_nombre" + Me.proveedor_nombre.ReadOnly = True + ' + 'categoria_gasto_id + ' + Me.categoria_gasto_id.HeaderText = "categoria_gasto_id" + Me.categoria_gasto_id.Name = "categoria_gasto_id" + Me.categoria_gasto_id.ReadOnly = True + Me.categoria_gasto_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.categoria_gasto_id.Visible = False + ' + 'categoria_nombre + ' + Me.categoria_nombre.HeaderText = "Categoria Gasto" + Me.categoria_nombre.Name = "categoria_nombre" + Me.categoria_nombre.ReadOnly = True + ' + 'persona_id + ' + Me.persona_id.HeaderText = "persona_id" + Me.persona_id.Name = "persona_id" + Me.persona_id.ReadOnly = True + Me.persona_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.persona_id.Visible = False + ' + 'persona_nombre + ' + Me.persona_nombre.HeaderText = "Persona" + Me.persona_nombre.Name = "persona_nombre" + Me.persona_nombre.ReadOnly = True + ' + 'fecha + ' + Me.fecha.HeaderText = "Fecha" + Me.fecha.Name = "fecha" + Me.fecha.ReadOnly = True + ' + 'seccional_id + ' + Me.seccional_id.HeaderText = "seccional_id" + Me.seccional_id.Name = "seccional_id" + Me.seccional_id.ReadOnly = True + Me.seccional_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.seccional_id.Visible = False + ' + 'seccional_nombre + ' + Me.seccional_nombre.HeaderText = "Seccional" + Me.seccional_nombre.Name = "seccional_nombre" + Me.seccional_nombre.ReadOnly = True + ' + 'mes_reintegro + ' + Me.mes_reintegro.HeaderText = "Mes Reintegro" + Me.mes_reintegro.Name = "mes_reintegro" + Me.mes_reintegro.ReadOnly = True + ' + 'monto + ' + Me.monto.HeaderText = "Monto" + Me.monto.Name = "monto" + Me.monto.ReadOnly = True + ' + 'comentario + ' + Me.comentario.HeaderText = "Comentario" + Me.comentario.Name = "comentario" + Me.comentario.ReadOnly = True + ' + 'seleccionado + ' + Me.seleccionado.HeaderText = "Seleccionado" + Me.seleccionado.Name = "seleccionado" + Me.seleccionado.ReadOnly = True ' 'ABMEgresos ' @@ -1160,22 +1174,6 @@ Partial Class ABMEgresos Friend WithEvents SplitContainerModificar As SplitContainer Friend WithEvents ToolStripContainerModificar As ToolStripContainer Friend WithEvents DGVModificar As DataGridView - Friend WithEvents id As DataGridViewTextBoxColumn - Friend WithEvents nro_comprobante As DataGridViewTextBoxColumn - Friend WithEvents tipo_comprobante_id As DataGridViewTextBoxColumn - Friend WithEvents tipo_comprobante_nombre As DataGridViewTextBoxColumn - Friend WithEvents proveedor_id As DataGridViewTextBoxColumn - Friend WithEvents proveedor_nombre As DataGridViewTextBoxColumn - Friend WithEvents categoria_gasto_id As DataGridViewTextBoxColumn - Friend WithEvents categoria_nombre As DataGridViewTextBoxColumn - Friend WithEvents persona_id As DataGridViewTextBoxColumn - Friend WithEvents persona_nombre As DataGridViewTextBoxColumn - Friend WithEvents fecha As DataGridViewTextBoxColumn - Friend WithEvents seccional_id As DataGridViewTextBoxColumn - Friend WithEvents seccional_nombre As DataGridViewTextBoxColumn - Friend WithEvents mes_reintegro As DataGridViewTextBoxColumn - Friend WithEvents monto As DataGridViewTextBoxColumn - Friend WithEvents comentario As DataGridViewTextBoxColumn Friend WithEvents TextBoxNroComprobante As TextBox Friend WithEvents ComboBoxTipoComprobante As ComboBox Friend WithEvents TextBoxPVenta As TextBox @@ -1209,6 +1207,20 @@ Partial Class ABMEgresos Friend WithEvents ToolStripContainerPapelera As ToolStripContainer Friend WithEvents DGVPapelera As DataGridView Friend WithEvents bPapeleraRestaurar As Button + Friend WithEvents ToolStripModificar As ToolStrip + Friend WithEvents TSLabelTrimestre As ToolStripLabel + Friend WithEvents TSComboBoxTrimestre As ToolStripComboBox + Friend WithEvents TSLabelAño As ToolStripLabel + Friend WithEvents TSTextBoxAño As ToolStripTextBox + Friend WithEvents TSButtonFiltrar As ToolStripButton + Friend WithEvents TSLabelFiltro1 As ToolStripLabel + Friend WithEvents TSComboBoxFiltro1 As ToolStripComboBox + Friend WithEvents TSTextBoxFiltro1 As ToolStripTextBox + Friend WithEvents bPapeleraVaciarPapelera As Button + Friend WithEvents bPapeleraEliminar As Button + Friend WithEvents cbTGasto As ComboBox + Friend WithEvents cbSeccional As ComboBox + Friend WithEvents cbTComprobante As ComboBox Friend WithEvents PapeleraId As DataGridViewTextBoxColumn Friend WithEvents PapeleraNroComprobante As DataGridViewTextBoxColumn Friend WithEvents PapeleraTComprobanteId As DataGridViewTextBoxColumn @@ -1225,18 +1237,22 @@ Partial Class ABMEgresos Friend WithEvents PapeleraReintegro As DataGridViewTextBoxColumn Friend WithEvents PapeleraMonto As DataGridViewTextBoxColumn Friend WithEvents PapeleraComentario As DataGridViewTextBoxColumn - Friend WithEvents ToolStripModificar As ToolStrip - Friend WithEvents TSLabelTrimestre As ToolStripLabel - Friend WithEvents TSComboBoxTrimestre As ToolStripComboBox - Friend WithEvents TSLabelAño As ToolStripLabel - Friend WithEvents TSTextBoxAño As ToolStripTextBox - Friend WithEvents TSButtonFiltrar As ToolStripButton - Friend WithEvents TSLabelFiltro1 As ToolStripLabel - Friend WithEvents TSComboBoxFiltro1 As ToolStripComboBox - Friend WithEvents TSTextBoxFiltro1 As ToolStripTextBox - Friend WithEvents bPapeleraVaciarPapelera As Button - Friend WithEvents bPapeleraEliminar As Button - Friend WithEvents cbTGasto As ComboBox - Friend WithEvents cbSeccional As ComboBox - Friend WithEvents cbTComprobante As ComboBox + Friend WithEvents PapeleraSeleccionado As DataGridViewCheckBoxColumn + Friend WithEvents id As DataGridViewTextBoxColumn + Friend WithEvents nro_comprobante As DataGridViewTextBoxColumn + Friend WithEvents tipo_comprobante_id As DataGridViewTextBoxColumn + Friend WithEvents tipo_comprobante_nombre As DataGridViewTextBoxColumn + Friend WithEvents proveedor_id As DataGridViewTextBoxColumn + Friend WithEvents proveedor_nombre As DataGridViewTextBoxColumn + Friend WithEvents categoria_gasto_id As DataGridViewTextBoxColumn + Friend WithEvents categoria_nombre As DataGridViewTextBoxColumn + Friend WithEvents persona_id As DataGridViewTextBoxColumn + Friend WithEvents persona_nombre As DataGridViewTextBoxColumn + Friend WithEvents fecha As DataGridViewTextBoxColumn + Friend WithEvents seccional_id As DataGridViewTextBoxColumn + Friend WithEvents seccional_nombre As DataGridViewTextBoxColumn + Friend WithEvents mes_reintegro As DataGridViewTextBoxColumn + Friend WithEvents monto As DataGridViewTextBoxColumn + Friend WithEvents comentario As DataGridViewTextBoxColumn + Friend WithEvents seleccionado As DataGridViewCheckBoxColumn End Class diff --git a/SireCu/Paneles/ABMEgresos.resx b/SireCu/Paneles/ABMEgresos.resx index 96504de..430c7ee 100644 --- a/SireCu/Paneles/ABMEgresos.resx +++ b/SireCu/Paneles/ABMEgresos.resx @@ -165,6 +165,9 @@ True + + True + 17, 17 @@ -232,4 +235,109 @@ True + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + \ No newline at end of file diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index b8a7433..7afd89a 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -141,6 +141,26 @@ Public Class ABMEgresos activarModificar(True) End Sub + + Private Sub DGVModificar_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DGVModificar.CellContentClick + If e.ColumnIndex = 16 Then + Dim id As Integer = DGVModificar.Rows(e.RowIndex).Cells("id").Value + Dim seleccionado As Integer + If DGVModificar.Rows(e.RowIndex).Cells("seleccionado").Value = 0 Then + seleccionado = 1 + Else + seleccionado = 0 + End If + + Dim sql As String = "UPDATE Egresos SET seleccionado = " & seleccionado & " WHERE id = " & id + If consultarNQ(sql, Principal.command) < 1 Then + MsgBox("Error al actualizar la selección", MsgBoxStyle.Exclamation, "Actualizar selección de egreso") + Else + DGVModificar.Rows(e.RowIndex).Cells("seleccionado").Value = seleccionado + End If + End If + End Sub + Private Sub ButtonGuardar_Click(sender As Object, e As EventArgs) Handles ButtonGuardar.Click 'Verificamos que todos los campos hayan pasado las validaciones @@ -169,7 +189,7 @@ Public Class ABMEgresos End If Dim comprobante As String - If (TextBoxPVenta.Text = 0) Or (tbPVenta.Text = "") Then + If (TextBoxPVenta.Text = 0) Or (TextBoxPVenta.Text = "") Then comprobante = TextBoxNroComprobante.Text Else comprobante = TextBoxPVenta.Text & "-" & TextBoxNroComprobante.Text @@ -254,7 +274,8 @@ Public Class ABMEgresos Secc.nombre AS seccional_nombre, E.mes_reintegro AS mes_reintegro, E.monto AS monto, - E.comentario AS comentario + E.comentario AS comentario, + E.seleccionado AS seleccionado FROM Egresos AS E LEFT JOIN TiposComprobantes AS Comp ON E.tipo_comprobante_id = Comp.id LEFT JOIN Proveedores AS Pro ON E.proveedor_id = Pro.id @@ -312,6 +333,8 @@ Public Class ABMEgresos sql += " AND E.monto = " & keyv.Value Case "Comentario" sql += " AND E.comentario = '" & keyv.Value & "'" + Case "Seleccionado" + sql += " AND E.seleccionado = " & keyv.Value Case Else Exit Select End Select @@ -546,7 +569,7 @@ Public Class ABMEgresos 'Validating Private Sub tbNombre_Validating(sender As Object, e As CancelEventArgs) Handles tbNombre.Validating - If (sender.Text = "") Or (tbNombre.AutoCompleteCustomSource.Contains(sender.text) = False) Then + If (sender.Text = "") Or (exist("Personas", "nombre", sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Persona correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") ControlesConErroresAgregar.Add(sender) @@ -569,7 +592,7 @@ Public Class ABMEgresos End Sub Private Sub tbProveedor_Validating(sender As Object, e As CancelEventArgs) Handles tbProveedor.Validating - If (sender.Text = "") Or (tbProveedor.AutoCompleteCustomSource.Contains(sender.Text) = False) Then + If (sender.Text = "") Or (exist("Proveedores", "nombre", sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Proveedor correcto." & vbCrLf & "Puede agregar uno nuevo en el menú Editar") ControlesConErroresAgregar.Add(sender) @@ -580,7 +603,7 @@ Public Class ABMEgresos End Sub Private Sub cbTComprobante_Validating(sender As Object, e As CancelEventArgs) Handles cbTComprobante.Validating ' Verifica que haya un item seleccionado y corresponda a la colección de opciones - If (sender.Text = "") Or (cbTGasto.AutoCompleteCustomSource.Contains(sender.Text) = False) Then + If (sender.Text = "") Or (cbTComprobante.AutoCompleteCustomSource.Contains(sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Tipo de Comprobante correcto." & vbCrLf & "Puede agregar uno nuevo en el menú Editar") ControlesConErroresAgregar.Add(sender) @@ -666,7 +689,7 @@ Public Class ABMEgresos 'Validating Private Sub TextBoxNombre_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBoxNombre.Validating - If (sender.Text = "") Or (TextBoxNombre.AutoCompleteCustomSource.Contains(sender.Text) = False) Then + If (sender.Text = "") Or (exist("Personas", "nombre", sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Persona correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") ControlesConErroresModificar.Add(sender) @@ -676,7 +699,7 @@ Public Class ABMEgresos End If End Sub Private Sub TextBoxProveedor_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBoxProveedor.Validating - If (sender.Text = "") Or (TextBoxProveedor.AutoCompleteCustomSource.Contains(sender.Text) = False) Then + If (sender.Text = "") Or (exist("Proveedores", "nombre", sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Proveedor correcto." & vbCrLf & "Puede agregar uno nuevo en el menú Editar") ControlesConErroresModificar.Add(sender) @@ -748,6 +771,10 @@ Public Class ABMEgresos ControlesConErroresModificar.Remove(sender) End If End Sub + + Private Sub TSTextBoxFiltro1_Validating(sender As Object, e As CancelEventArgs) Handles TSTextBoxFiltro1.Validating + ' TODO validación segun tipo de campo seleccionado + End Sub #End Region End Class \ No newline at end of file From 020afef94e9a3fabc8bc2eac3ce0e2364fa1d887 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Mon, 8 May 2017 22:27:09 -0300 Subject: [PATCH 19/27] BackColor Filas Datagrid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit + Color de fondo de la fila según este marcado o no el checkbox - Ocultar columna Id * Mover Columna Seleccionado al principio --- SireCu/Clases/Egreso.vb | 66 +++--- SireCu/Paneles/ABMEgresos.Designer.vb | 312 +++++++++++++------------- SireCu/Paneles/ABMEgresos.resx | 67 +----- SireCu/Paneles/ABMEgresos.vb | 14 +- 4 files changed, 212 insertions(+), 247 deletions(-) diff --git a/SireCu/Clases/Egreso.vb b/SireCu/Clases/Egreso.vb index 88aea03..ad6d9ee 100644 --- a/SireCu/Clases/Egreso.vb +++ b/SireCu/Clases/Egreso.vb @@ -147,22 +147,23 @@ Module Egreso dgv.AutoGenerateColumns = False dgv.Columns.Item(0).DataPropertyName = "id" - dgv.Columns.Item(1).DataPropertyName = "nro_comprobante" - dgv.Columns.Item(2).DataPropertyName = "tipo_comprobante_id" - dgv.Columns.Item(3).DataPropertyName = "tipo_comprobante_nombre" - dgv.Columns.Item(4).DataPropertyName = "proveedor_id" - dgv.Columns.Item(5).DataPropertyName = "proveedor_nombre" - dgv.Columns.Item(6).DataPropertyName = "categoria_gasto_id" - dgv.Columns.Item(7).DataPropertyName = "categoria_nombre" - dgv.Columns.Item(8).DataPropertyName = "persona_id" - dgv.Columns.Item(9).DataPropertyName = "persona_nombre" - dgv.Columns.Item(10).DataPropertyName = "fecha" - dgv.Columns.Item(11).DataPropertyName = "seccional_id" - dgv.Columns.Item(12).DataPropertyName = "seccional_nombre" - dgv.Columns.Item(13).DataPropertyName = "mes_reintegro" - dgv.Columns.Item(14).DataPropertyName = "monto" - dgv.Columns.Item(15).DataPropertyName = "comentario" - dgv.Columns.Item(16).DataPropertyName = "seleccionado" + dgv.Columns.Item(1).DataPropertyName = "seleccionado" + dgv.Columns.Item(2).DataPropertyName = "nro_comprobante" + dgv.Columns.Item(3).DataPropertyName = "tipo_comprobante_id" + dgv.Columns.Item(4).DataPropertyName = "tipo_comprobante_nombre" + dgv.Columns.Item(5).DataPropertyName = "proveedor_id" + dgv.Columns.Item(6).DataPropertyName = "proveedor_nombre" + dgv.Columns.Item(7).DataPropertyName = "categoria_gasto_id" + dgv.Columns.Item(8).DataPropertyName = "categoria_nombre" + dgv.Columns.Item(9).DataPropertyName = "persona_id" + dgv.Columns.Item(10).DataPropertyName = "persona_nombre" + dgv.Columns.Item(11).DataPropertyName = "fecha" + dgv.Columns.Item(12).DataPropertyName = "seccional_id" + dgv.Columns.Item(13).DataPropertyName = "seccional_nombre" + dgv.Columns.Item(14).DataPropertyName = "mes_reintegro" + dgv.Columns.Item(15).DataPropertyName = "monto" + dgv.Columns.Item(16).DataPropertyName = "comentario" + dgv.DataSource = mybinding End Sub @@ -193,22 +194,23 @@ Module Egreso dgv.AutoGenerateColumns = False dgv.Columns.Item(0).DataPropertyName = "id" - dgv.Columns.Item(1).DataPropertyName = "nro_comprobante" - dgv.Columns.Item(2).DataPropertyName = "tipo_comprobante_id" - dgv.Columns.Item(3).DataPropertyName = "tipo_comprobante_nombre" - dgv.Columns.Item(4).DataPropertyName = "proveedor_id" - dgv.Columns.Item(5).DataPropertyName = "proveedor_nombre" - dgv.Columns.Item(6).DataPropertyName = "categoria_gasto_id" - dgv.Columns.Item(7).DataPropertyName = "categoria_nombre" - dgv.Columns.Item(8).DataPropertyName = "persona_id" - dgv.Columns.Item(9).DataPropertyName = "persona_nombre" - dgv.Columns.Item(10).DataPropertyName = "fecha" - dgv.Columns.Item(11).DataPropertyName = "seccional_id" - dgv.Columns.Item(12).DataPropertyName = "seccional_nombre" - dgv.Columns.Item(13).DataPropertyName = "mes_reintegro" - dgv.Columns.Item(14).DataPropertyName = "monto" - dgv.Columns.Item(15).DataPropertyName = "comentario" - dgv.Columns.Item(16).DataPropertyName = "seleccionado" + dgv.Columns.Item(1).DataPropertyName = "seleccionado" + dgv.Columns.Item(2).DataPropertyName = "nro_comprobante" + dgv.Columns.Item(3).DataPropertyName = "tipo_comprobante_id" + dgv.Columns.Item(4).DataPropertyName = "tipo_comprobante_nombre" + dgv.Columns.Item(5).DataPropertyName = "proveedor_id" + dgv.Columns.Item(6).DataPropertyName = "proveedor_nombre" + dgv.Columns.Item(7).DataPropertyName = "categoria_gasto_id" + dgv.Columns.Item(8).DataPropertyName = "categoria_nombre" + dgv.Columns.Item(9).DataPropertyName = "persona_id" + dgv.Columns.Item(10).DataPropertyName = "persona_nombre" + dgv.Columns.Item(11).DataPropertyName = "fecha" + dgv.Columns.Item(12).DataPropertyName = "seccional_id" + dgv.Columns.Item(13).DataPropertyName = "seccional_nombre" + dgv.Columns.Item(14).DataPropertyName = "mes_reintegro" + dgv.Columns.Item(15).DataPropertyName = "monto" + dgv.Columns.Item(16).DataPropertyName = "comentario" + dgv.DataSource = mybinding End Sub diff --git a/SireCu/Paneles/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb index 854fd89..f606752 100644 --- a/SireCu/Paneles/ABMEgresos.Designer.vb +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -93,24 +93,8 @@ Partial Class ABMEgresos Me.bPapeleraEliminar = New System.Windows.Forms.Button() Me.bPapeleraVaciarPapelera = New System.Windows.Forms.Button() Me.bPapeleraRestaurar = New System.Windows.Forms.Button() - Me.PapeleraId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraNroComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraTComprobanteId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraTipoComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraProveedorId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraProveedor = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraCategoriaGastoId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraCategoriaGasto = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraPersonaId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraPersona = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraFecha = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraSeccionalId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraSeccional = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraReintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraMonto = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraComentario = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraSeleccionado = New System.Windows.Forms.DataGridViewCheckBoxColumn() Me.id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.seleccionado = New System.Windows.Forms.DataGridViewCheckBoxColumn() Me.nro_comprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.tipo_comprobante_id = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.tipo_comprobante_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() @@ -126,7 +110,23 @@ Partial Class ABMEgresos Me.mes_reintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.monto = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.comentario = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.seleccionado = New System.Windows.Forms.DataGridViewCheckBoxColumn() + Me.PapeleraId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraSeleccionado = New System.Windows.Forms.DataGridViewCheckBoxColumn() + Me.PapeleraNroComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraTComprobanteId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraTipoComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraProveedorId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraProveedor = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraCategoriaGastoId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraCategoriaGasto = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraPersonaId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraPersona = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraFecha = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraSeccionalId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraSeccional = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraReintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraMonto = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraComentario = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.TabControl.SuspendLayout() Me.TabPageAgregar.SuspendLayout() Me.TabPageModificar.SuspendLayout() @@ -497,7 +497,7 @@ Partial Class ABMEgresos Me.DGVModificar.AllowUserToAddRows = False Me.DGVModificar.AllowUserToDeleteRows = False Me.DGVModificar.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DGVModificar.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.id, Me.nro_comprobante, Me.tipo_comprobante_id, Me.tipo_comprobante_nombre, Me.proveedor_id, Me.proveedor_nombre, Me.categoria_gasto_id, Me.categoria_nombre, Me.persona_id, Me.persona_nombre, Me.fecha, Me.seccional_id, Me.seccional_nombre, Me.mes_reintegro, Me.monto, Me.comentario, Me.seleccionado}) + Me.DGVModificar.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.id, Me.seleccionado, Me.nro_comprobante, Me.tipo_comprobante_id, Me.tipo_comprobante_nombre, Me.proveedor_id, Me.proveedor_nombre, Me.categoria_gasto_id, Me.categoria_nombre, Me.persona_id, Me.persona_nombre, Me.fecha, Me.seccional_id, Me.seccional_nombre, Me.mes_reintegro, Me.monto, Me.comentario}) Me.DGVModificar.Dock = System.Windows.Forms.DockStyle.Fill Me.DGVModificar.Location = New System.Drawing.Point(0, 0) Me.DGVModificar.Name = "DGVModificar" @@ -513,7 +513,7 @@ Partial Class ABMEgresos Me.ToolStripModificar.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TSLabelTrimestre, Me.TSComboBoxTrimestre, Me.TSLabelAño, Me.TSTextBoxAño, Me.TSLabelFiltro1, Me.TSComboBoxFiltro1, Me.TSTextBoxFiltro1, Me.TSButtonFiltrar}) Me.ToolStripModificar.Location = New System.Drawing.Point(3, 0) Me.ToolStripModificar.Name = "ToolStripModificar" - Me.ToolStripModificar.Size = New System.Drawing.Size(683, 25) + Me.ToolStripModificar.Size = New System.Drawing.Size(652, 25) Me.ToolStripModificar.TabIndex = 0 ' 'TSLabelTrimestre @@ -845,7 +845,7 @@ Partial Class ABMEgresos Me.DGVPapelera.AllowUserToAddRows = False Me.DGVPapelera.AllowUserToDeleteRows = False Me.DGVPapelera.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DGVPapelera.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.PapeleraId, Me.PapeleraNroComprobante, Me.PapeleraTComprobanteId, Me.PapeleraTipoComprobante, Me.PapeleraProveedorId, Me.PapeleraProveedor, Me.PapeleraCategoriaGastoId, Me.PapeleraCategoriaGasto, Me.PapeleraPersonaId, Me.PapeleraPersona, Me.PapeleraFecha, Me.PapeleraSeccionalId, Me.PapeleraSeccional, Me.PapeleraReintegro, Me.PapeleraMonto, Me.PapeleraComentario, Me.PapeleraSeleccionado}) + Me.DGVPapelera.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.PapeleraId, Me.PapeleraSeleccionado, Me.PapeleraNroComprobante, Me.PapeleraTComprobanteId, Me.PapeleraTipoComprobante, Me.PapeleraProveedorId, Me.PapeleraProveedor, Me.PapeleraCategoriaGastoId, Me.PapeleraCategoriaGasto, Me.PapeleraPersonaId, Me.PapeleraPersona, Me.PapeleraFecha, Me.PapeleraSeccionalId, Me.PapeleraSeccional, Me.PapeleraReintegro, Me.PapeleraMonto, Me.PapeleraComentario}) Me.DGVPapelera.Dock = System.Windows.Forms.DockStyle.Fill Me.DGVPapelera.Location = New System.Drawing.Point(0, 0) Me.DGVPapelera.Name = "DGVPapelera" @@ -889,123 +889,18 @@ Partial Class ABMEgresos Me.bPapeleraRestaurar.Text = "Restaurar" Me.bPapeleraRestaurar.UseVisualStyleBackColor = True ' - 'PapeleraId - ' - Me.PapeleraId.HeaderText = "Id" - Me.PapeleraId.Name = "PapeleraId" - Me.PapeleraId.ReadOnly = True - ' - 'PapeleraNroComprobante - ' - Me.PapeleraNroComprobante.HeaderText = "Nro Comprobante" - Me.PapeleraNroComprobante.Name = "PapeleraNroComprobante" - Me.PapeleraNroComprobante.ReadOnly = True - ' - 'PapeleraTComprobanteId - ' - Me.PapeleraTComprobanteId.HeaderText = "tipo_comprobante_id" - Me.PapeleraTComprobanteId.Name = "PapeleraTComprobanteId" - Me.PapeleraTComprobanteId.ReadOnly = True - Me.PapeleraTComprobanteId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraTComprobanteId.Visible = False - ' - 'PapeleraTipoComprobante - ' - Me.PapeleraTipoComprobante.HeaderText = "Tipo Comprobante" - Me.PapeleraTipoComprobante.Name = "PapeleraTipoComprobante" - Me.PapeleraTipoComprobante.ReadOnly = True - ' - 'PapeleraProveedorId - ' - Me.PapeleraProveedorId.HeaderText = "proveedor_id" - Me.PapeleraProveedorId.Name = "PapeleraProveedorId" - Me.PapeleraProveedorId.ReadOnly = True - Me.PapeleraProveedorId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraProveedorId.Visible = False - ' - 'PapeleraProveedor - ' - Me.PapeleraProveedor.HeaderText = "Proveedor" - Me.PapeleraProveedor.Name = "PapeleraProveedor" - Me.PapeleraProveedor.ReadOnly = True - ' - 'PapeleraCategoriaGastoId - ' - Me.PapeleraCategoriaGastoId.HeaderText = "categoria_gasto_id" - Me.PapeleraCategoriaGastoId.Name = "PapeleraCategoriaGastoId" - Me.PapeleraCategoriaGastoId.ReadOnly = True - Me.PapeleraCategoriaGastoId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraCategoriaGastoId.Visible = False - ' - 'PapeleraCategoriaGasto - ' - Me.PapeleraCategoriaGasto.HeaderText = "Categoria Gasto" - Me.PapeleraCategoriaGasto.Name = "PapeleraCategoriaGasto" - Me.PapeleraCategoriaGasto.ReadOnly = True - ' - 'PapeleraPersonaId - ' - Me.PapeleraPersonaId.HeaderText = "persona_id" - Me.PapeleraPersonaId.Name = "PapeleraPersonaId" - Me.PapeleraPersonaId.ReadOnly = True - Me.PapeleraPersonaId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraPersonaId.Visible = False - ' - 'PapeleraPersona - ' - Me.PapeleraPersona.HeaderText = "Persona" - Me.PapeleraPersona.Name = "PapeleraPersona" - Me.PapeleraPersona.ReadOnly = True - ' - 'PapeleraFecha - ' - Me.PapeleraFecha.HeaderText = "Fecha" - Me.PapeleraFecha.Name = "PapeleraFecha" - Me.PapeleraFecha.ReadOnly = True - ' - 'PapeleraSeccionalId - ' - Me.PapeleraSeccionalId.HeaderText = "seccional_id" - Me.PapeleraSeccionalId.Name = "PapeleraSeccionalId" - Me.PapeleraSeccionalId.ReadOnly = True - Me.PapeleraSeccionalId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraSeccionalId.Visible = False - ' - 'PapeleraSeccional - ' - Me.PapeleraSeccional.HeaderText = "Seccional" - Me.PapeleraSeccional.Name = "PapeleraSeccional" - Me.PapeleraSeccional.ReadOnly = True - ' - 'PapeleraReintegro - ' - Me.PapeleraReintegro.HeaderText = "Mes Reintegro" - Me.PapeleraReintegro.Name = "PapeleraReintegro" - Me.PapeleraReintegro.ReadOnly = True - ' - 'PapeleraMonto - ' - Me.PapeleraMonto.HeaderText = "Monto" - Me.PapeleraMonto.Name = "PapeleraMonto" - Me.PapeleraMonto.ReadOnly = True - ' - 'PapeleraComentario - ' - Me.PapeleraComentario.HeaderText = "Comentario" - Me.PapeleraComentario.Name = "PapeleraComentario" - Me.PapeleraComentario.ReadOnly = True - ' - 'PapeleraSeleccionado - ' - Me.PapeleraSeleccionado.HeaderText = "Seleccionado" - Me.PapeleraSeleccionado.Name = "PapeleraSeleccionado" - Me.PapeleraSeleccionado.ReadOnly = True - ' 'id ' Me.id.HeaderText = "Id" Me.id.Name = "id" Me.id.ReadOnly = True + Me.id.Visible = False + ' + 'seleccionado + ' + Me.seleccionado.HeaderText = "Seleccionado" + Me.seleccionado.Name = "seleccionado" + Me.seleccionado.ReadOnly = True ' 'nro_comprobante ' @@ -1107,11 +1002,118 @@ Partial Class ABMEgresos Me.comentario.Name = "comentario" Me.comentario.ReadOnly = True ' - 'seleccionado + 'PapeleraId ' - Me.seleccionado.HeaderText = "Seleccionado" - Me.seleccionado.Name = "seleccionado" - Me.seleccionado.ReadOnly = True + Me.PapeleraId.HeaderText = "Id" + Me.PapeleraId.Name = "PapeleraId" + Me.PapeleraId.ReadOnly = True + Me.PapeleraId.Visible = False + ' + 'PapeleraSeleccionado + ' + Me.PapeleraSeleccionado.HeaderText = "Seleccionado" + Me.PapeleraSeleccionado.Name = "PapeleraSeleccionado" + Me.PapeleraSeleccionado.ReadOnly = True + ' + 'PapeleraNroComprobante + ' + Me.PapeleraNroComprobante.HeaderText = "Nro Comprobante" + Me.PapeleraNroComprobante.Name = "PapeleraNroComprobante" + Me.PapeleraNroComprobante.ReadOnly = True + ' + 'PapeleraTComprobanteId + ' + Me.PapeleraTComprobanteId.HeaderText = "tipo_comprobante_id" + Me.PapeleraTComprobanteId.Name = "PapeleraTComprobanteId" + Me.PapeleraTComprobanteId.ReadOnly = True + Me.PapeleraTComprobanteId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraTComprobanteId.Visible = False + ' + 'PapeleraTipoComprobante + ' + Me.PapeleraTipoComprobante.HeaderText = "Tipo Comprobante" + Me.PapeleraTipoComprobante.Name = "PapeleraTipoComprobante" + Me.PapeleraTipoComprobante.ReadOnly = True + ' + 'PapeleraProveedorId + ' + Me.PapeleraProveedorId.HeaderText = "proveedor_id" + Me.PapeleraProveedorId.Name = "PapeleraProveedorId" + Me.PapeleraProveedorId.ReadOnly = True + Me.PapeleraProveedorId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraProveedorId.Visible = False + ' + 'PapeleraProveedor + ' + Me.PapeleraProveedor.HeaderText = "Proveedor" + Me.PapeleraProveedor.Name = "PapeleraProveedor" + Me.PapeleraProveedor.ReadOnly = True + ' + 'PapeleraCategoriaGastoId + ' + Me.PapeleraCategoriaGastoId.HeaderText = "categoria_gasto_id" + Me.PapeleraCategoriaGastoId.Name = "PapeleraCategoriaGastoId" + Me.PapeleraCategoriaGastoId.ReadOnly = True + Me.PapeleraCategoriaGastoId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraCategoriaGastoId.Visible = False + ' + 'PapeleraCategoriaGasto + ' + Me.PapeleraCategoriaGasto.HeaderText = "Categoria Gasto" + Me.PapeleraCategoriaGasto.Name = "PapeleraCategoriaGasto" + Me.PapeleraCategoriaGasto.ReadOnly = True + ' + 'PapeleraPersonaId + ' + Me.PapeleraPersonaId.HeaderText = "persona_id" + Me.PapeleraPersonaId.Name = "PapeleraPersonaId" + Me.PapeleraPersonaId.ReadOnly = True + Me.PapeleraPersonaId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraPersonaId.Visible = False + ' + 'PapeleraPersona + ' + Me.PapeleraPersona.HeaderText = "Persona" + Me.PapeleraPersona.Name = "PapeleraPersona" + Me.PapeleraPersona.ReadOnly = True + ' + 'PapeleraFecha + ' + Me.PapeleraFecha.HeaderText = "Fecha" + Me.PapeleraFecha.Name = "PapeleraFecha" + Me.PapeleraFecha.ReadOnly = True + ' + 'PapeleraSeccionalId + ' + Me.PapeleraSeccionalId.HeaderText = "seccional_id" + Me.PapeleraSeccionalId.Name = "PapeleraSeccionalId" + Me.PapeleraSeccionalId.ReadOnly = True + Me.PapeleraSeccionalId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraSeccionalId.Visible = False + ' + 'PapeleraSeccional + ' + Me.PapeleraSeccional.HeaderText = "Seccional" + Me.PapeleraSeccional.Name = "PapeleraSeccional" + Me.PapeleraSeccional.ReadOnly = True + ' + 'PapeleraReintegro + ' + Me.PapeleraReintegro.HeaderText = "Mes Reintegro" + Me.PapeleraReintegro.Name = "PapeleraReintegro" + Me.PapeleraReintegro.ReadOnly = True + ' + 'PapeleraMonto + ' + Me.PapeleraMonto.HeaderText = "Monto" + Me.PapeleraMonto.Name = "PapeleraMonto" + Me.PapeleraMonto.ReadOnly = True + ' + 'PapeleraComentario + ' + Me.PapeleraComentario.HeaderText = "Comentario" + Me.PapeleraComentario.Name = "PapeleraComentario" + Me.PapeleraComentario.ReadOnly = True ' 'ABMEgresos ' @@ -1221,24 +1223,8 @@ Partial Class ABMEgresos Friend WithEvents cbTGasto As ComboBox Friend WithEvents cbSeccional As ComboBox Friend WithEvents cbTComprobante As ComboBox - Friend WithEvents PapeleraId As DataGridViewTextBoxColumn - Friend WithEvents PapeleraNroComprobante As DataGridViewTextBoxColumn - Friend WithEvents PapeleraTComprobanteId As DataGridViewTextBoxColumn - Friend WithEvents PapeleraTipoComprobante As DataGridViewTextBoxColumn - Friend WithEvents PapeleraProveedorId As DataGridViewTextBoxColumn - Friend WithEvents PapeleraProveedor As DataGridViewTextBoxColumn - Friend WithEvents PapeleraCategoriaGastoId As DataGridViewTextBoxColumn - Friend WithEvents PapeleraCategoriaGasto As DataGridViewTextBoxColumn - Friend WithEvents PapeleraPersonaId As DataGridViewTextBoxColumn - Friend WithEvents PapeleraPersona As DataGridViewTextBoxColumn - Friend WithEvents PapeleraFecha As DataGridViewTextBoxColumn - Friend WithEvents PapeleraSeccionalId As DataGridViewTextBoxColumn - Friend WithEvents PapeleraSeccional As DataGridViewTextBoxColumn - Friend WithEvents PapeleraReintegro As DataGridViewTextBoxColumn - Friend WithEvents PapeleraMonto As DataGridViewTextBoxColumn - Friend WithEvents PapeleraComentario As DataGridViewTextBoxColumn - Friend WithEvents PapeleraSeleccionado As DataGridViewCheckBoxColumn Friend WithEvents id As DataGridViewTextBoxColumn + Friend WithEvents seleccionado As DataGridViewCheckBoxColumn Friend WithEvents nro_comprobante As DataGridViewTextBoxColumn Friend WithEvents tipo_comprobante_id As DataGridViewTextBoxColumn Friend WithEvents tipo_comprobante_nombre As DataGridViewTextBoxColumn @@ -1254,5 +1240,21 @@ Partial Class ABMEgresos Friend WithEvents mes_reintegro As DataGridViewTextBoxColumn Friend WithEvents monto As DataGridViewTextBoxColumn Friend WithEvents comentario As DataGridViewTextBoxColumn - Friend WithEvents seleccionado As DataGridViewCheckBoxColumn + Friend WithEvents PapeleraId As DataGridViewTextBoxColumn + Friend WithEvents PapeleraSeleccionado As DataGridViewCheckBoxColumn + Friend WithEvents PapeleraNroComprobante As DataGridViewTextBoxColumn + Friend WithEvents PapeleraTComprobanteId As DataGridViewTextBoxColumn + Friend WithEvents PapeleraTipoComprobante As DataGridViewTextBoxColumn + Friend WithEvents PapeleraProveedorId As DataGridViewTextBoxColumn + Friend WithEvents PapeleraProveedor As DataGridViewTextBoxColumn + Friend WithEvents PapeleraCategoriaGastoId As DataGridViewTextBoxColumn + Friend WithEvents PapeleraCategoriaGasto As DataGridViewTextBoxColumn + Friend WithEvents PapeleraPersonaId As DataGridViewTextBoxColumn + Friend WithEvents PapeleraPersona As DataGridViewTextBoxColumn + Friend WithEvents PapeleraFecha As DataGridViewTextBoxColumn + Friend WithEvents PapeleraSeccionalId As DataGridViewTextBoxColumn + Friend WithEvents PapeleraSeccional As DataGridViewTextBoxColumn + Friend WithEvents PapeleraReintegro As DataGridViewTextBoxColumn + Friend WithEvents PapeleraMonto As DataGridViewTextBoxColumn + Friend WithEvents PapeleraComentario As DataGridViewTextBoxColumn End Class diff --git a/SireCu/Paneles/ABMEgresos.resx b/SireCu/Paneles/ABMEgresos.resx index 430c7ee..72688a5 100644 --- a/SireCu/Paneles/ABMEgresos.resx +++ b/SireCu/Paneles/ABMEgresos.resx @@ -120,6 +120,9 @@ True + + True + True @@ -165,9 +168,6 @@ True - - True - 17, 17 @@ -190,6 +190,9 @@ True + + True + True @@ -235,10 +238,10 @@ True - + True - + True @@ -286,58 +289,4 @@ True - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - \ No newline at end of file diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index 7afd89a..8467ad6 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -143,7 +143,7 @@ Public Class ABMEgresos End Sub Private Sub DGVModificar_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DGVModificar.CellContentClick - If e.ColumnIndex = 16 Then + If e.ColumnIndex = 1 Then Dim id As Integer = DGVModificar.Rows(e.RowIndex).Cells("id").Value Dim seleccionado As Integer If DGVModificar.Rows(e.RowIndex).Cells("seleccionado").Value = 0 Then @@ -161,6 +161,18 @@ Public Class ABMEgresos End If End Sub + Private Sub DGVModificar_RowPostPaint(sender As Object, e As DataGridViewRowPostPaintEventArgs) Handles DGVModificar.RowPostPaint + + Dim dgvRow As DataGridViewRow = DGVModificar.Rows(e.RowIndex) + + If dgvRow.Cells(1).Value = False Then + dgvRow.DefaultCellStyle.BackColor = Color.LavenderBlush + ElseIf dgvRow.Cells(1).Value = True Then + dgvRow.DefaultCellStyle.BackColor = Color.Honeydew + End If + + End Sub + Private Sub ButtonGuardar_Click(sender As Object, e As EventArgs) Handles ButtonGuardar.Click 'Verificamos que todos los campos hayan pasado las validaciones From 0dca01943688d1faef4729be0a6608db4b11e798 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Mon, 8 May 2017 22:43:24 -0300 Subject: [PATCH 20/27] Evitar eventos en Encabezados de Datagrid * Permitir eventos de click a partir de la fila 1 * Cambiar color de fondo de fila sin check a blanco --- SireCu/Paneles/ABMEgresos.vb | 72 ++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index 8467ad6..8066885 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -104,46 +104,48 @@ Public Class ABMEgresos Private Sub DataGridViewModificar_CellMouseDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DGVModificar.CellMouseDoubleClick ' Cargar el formulario con los datos para modificar - Try - idModificando = CInt(DGVModificar.Rows(e.RowIndex).Cells("id").Value) - - TextBoxNombre.Text = DGVModificar.Rows(e.RowIndex).Cells("persona_nombre").Value - ComboBoxCategGasto.SelectedValue = DGVModificar.Rows(e.RowIndex).Cells("categoria_gasto_id").Value - TextBoxProveedor.Text = DGVModificar.Rows(e.RowIndex).Cells("proveedor_nombre").Value - If DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value Is DBNull.Value Then - DateTimePickerMesReintegro.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("fecha").Value) - DateTimePickerMesReintegro.Checked = False - Else - If DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value = DGVModificar.Rows(e.RowIndex).Cells("fecha").Value Then - DateTimePickerMesReintegro.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value) + If e.RowIndex > 0 Then ' Evita los encabezados de la tabla + Try + idModificando = CInt(DGVModificar.Rows(e.RowIndex).Cells("id").Value) + + TextBoxNombre.Text = DGVModificar.Rows(e.RowIndex).Cells("persona_nombre").Value + ComboBoxCategGasto.SelectedValue = DGVModificar.Rows(e.RowIndex).Cells("categoria_gasto_id").Value + TextBoxProveedor.Text = DGVModificar.Rows(e.RowIndex).Cells("proveedor_nombre").Value + If DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value Is DBNull.Value Then + DateTimePickerMesReintegro.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("fecha").Value) DateTimePickerMesReintegro.Checked = False Else - DateTimePickerMesReintegro.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value) - DateTimePickerMesReintegro.Checked = True + If DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value = DGVModificar.Rows(e.RowIndex).Cells("fecha").Value Then + DateTimePickerMesReintegro.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value) + DateTimePickerMesReintegro.Checked = False + Else + DateTimePickerMesReintegro.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value) + DateTimePickerMesReintegro.Checked = True + End If End If - End If - ComboBoxSeccional.SelectedValue = DGVModificar.Rows(e.RowIndex).Cells("seccional_id").Value - TextBoxComentario.Text = DGVModificar.Rows(e.RowIndex).Cells("comentario").Value.ToString - DateTimePickerFecha.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("fecha").Value) - ComboBoxTipoComprobante.SelectedValue = DGVModificar.Rows(e.RowIndex).Cells("tipo_comprobante_id").Value - If DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Contains("-") Then - TextBoxPVenta.Text = DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Split("-")(0) - TextBoxNroComprobante.Text = DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Split("-")(1) - Else - TextBoxPVenta.Text = "0" - TextBoxNroComprobante.Text = DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value - End If - TextBoxMonto.Text = DGVModificar.Rows(e.RowIndex).Cells("monto").Value - Catch ex As Exception - MessageBox.Show(ex.Message, "Error al cargar el formulario", MessageBoxButtons.OK, MessageBoxIcon.Error) - End Try + ComboBoxSeccional.SelectedValue = DGVModificar.Rows(e.RowIndex).Cells("seccional_id").Value + TextBoxComentario.Text = DGVModificar.Rows(e.RowIndex).Cells("comentario").Value.ToString + DateTimePickerFecha.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("fecha").Value) + ComboBoxTipoComprobante.SelectedValue = DGVModificar.Rows(e.RowIndex).Cells("tipo_comprobante_id").Value + If DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Contains("-") Then + TextBoxPVenta.Text = DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Split("-")(0) + TextBoxNroComprobante.Text = DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value.ToString.Split("-")(1) + Else + TextBoxPVenta.Text = "0" + TextBoxNroComprobante.Text = DGVModificar.Rows(e.RowIndex).Cells("nro_comprobante").Value + End If + TextBoxMonto.Text = DGVModificar.Rows(e.RowIndex).Cells("monto").Value + Catch ex As Exception + MessageBox.Show(ex.Message, "Error al cargar el formulario", MessageBoxButtons.OK, MessageBoxIcon.Error) + End Try - activarModificar(True) + activarModificar(True) + End If End Sub Private Sub DGVModificar_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DGVModificar.CellContentClick - If e.ColumnIndex = 1 Then + If e.ColumnIndex = 1 And e.RowIndex > 0 Then Dim id As Integer = DGVModificar.Rows(e.RowIndex).Cells("id").Value Dim seleccionado As Integer If DGVModificar.Rows(e.RowIndex).Cells("seleccionado").Value = 0 Then @@ -165,10 +167,10 @@ Public Class ABMEgresos Dim dgvRow As DataGridViewRow = DGVModificar.Rows(e.RowIndex) - If dgvRow.Cells(1).Value = False Then - dgvRow.DefaultCellStyle.BackColor = Color.LavenderBlush - ElseIf dgvRow.Cells(1).Value = True Then + If dgvRow.Cells(1).Value = True Then dgvRow.DefaultCellStyle.BackColor = Color.Honeydew + Else + dgvRow.DefaultCellStyle.BackColor = Color.White End If End Sub From 86592752e91d2d890f81fc35075ec564a30015f1 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Tue, 9 May 2017 22:09:55 -0300 Subject: [PATCH 21/27] Filtros + Fix + Filtro adicional para campos en egresos + Buscar resultados exactos o parciales * Fix para evitar primera fila en eventos de datos --- SireCu/Paneles/ABMEgresos.Designer.vb | 114 ++++++++++++++++++++++---- SireCu/Paneles/ABMEgresos.resx | 66 ++++----------- SireCu/Paneles/ABMEgresos.vb | 95 ++++++++++++++++----- 3 files changed, 191 insertions(+), 84 deletions(-) diff --git a/SireCu/Paneles/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb index f606752..64900c2 100644 --- a/SireCu/Paneles/ABMEgresos.Designer.vb +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -127,6 +127,12 @@ Partial Class ABMEgresos Me.PapeleraReintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.PapeleraMonto = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.PapeleraComentario = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.TSComboBoxOpera1 = New System.Windows.Forms.ToolStripComboBox() + Me.TSComboBoxFiltro2 = New System.Windows.Forms.ToolStripComboBox() + Me.TSComboBoxOpera2 = New System.Windows.Forms.ToolStripComboBox() + Me.TSTextBoxFiltro2 = New System.Windows.Forms.ToolStripTextBox() + Me.TSLabelFiltro2 = New System.Windows.Forms.ToolStripLabel() + Me.TSButtonQuitarFiltros = New System.Windows.Forms.ToolStripButton() Me.TabControl.SuspendLayout() Me.TabPageAgregar.SuspendLayout() Me.TabPageModificar.SuspendLayout() @@ -478,7 +484,7 @@ Partial Class ABMEgresos 'ToolStripContainerModificar.ContentPanel ' Me.ToolStripContainerModificar.ContentPanel.Controls.Add(Me.DGVModificar) - Me.ToolStripContainerModificar.ContentPanel.Size = New System.Drawing.Size(741, 176) + Me.ToolStripContainerModificar.ContentPanel.Size = New System.Drawing.Size(741, 143) Me.ToolStripContainerModificar.Dock = System.Windows.Forms.DockStyle.Fill Me.ToolStripContainerModificar.LeftToolStripPanelVisible = False Me.ToolStripContainerModificar.Location = New System.Drawing.Point(0, 0) @@ -503,63 +509,80 @@ Partial Class ABMEgresos Me.DGVModificar.Name = "DGVModificar" Me.DGVModificar.ReadOnly = True Me.DGVModificar.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DGVModificar.Size = New System.Drawing.Size(741, 176) + Me.DGVModificar.Size = New System.Drawing.Size(741, 143) Me.DGVModificar.TabIndex = 0 ' 'ToolStripModificar ' + Me.ToolStripModificar.AutoSize = False Me.ToolStripModificar.Dock = System.Windows.Forms.DockStyle.None Me.ToolStripModificar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStripModificar.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TSLabelTrimestre, Me.TSComboBoxTrimestre, Me.TSLabelAño, Me.TSTextBoxAño, Me.TSLabelFiltro1, Me.TSComboBoxFiltro1, Me.TSTextBoxFiltro1, Me.TSButtonFiltrar}) + Me.ToolStripModificar.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TSLabelTrimestre, Me.TSComboBoxTrimestre, Me.TSLabelAño, Me.TSTextBoxAño, Me.TSLabelFiltro1, Me.TSComboBoxFiltro1, Me.TSComboBoxOpera1, Me.TSTextBoxFiltro1, Me.TSLabelFiltro2, Me.TSComboBoxFiltro2, Me.TSComboBoxOpera2, Me.TSTextBoxFiltro2, Me.TSButtonFiltrar, Me.TSButtonQuitarFiltros}) + Me.ToolStripModificar.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow Me.ToolStripModificar.Location = New System.Drawing.Point(3, 0) Me.ToolStripModificar.Name = "ToolStripModificar" - Me.ToolStripModificar.Size = New System.Drawing.Size(652, 25) + Me.ToolStripModificar.Padding = New System.Windows.Forms.Padding(0) + Me.ToolStripModificar.Size = New System.Drawing.Size(738, 58) Me.ToolStripModificar.TabIndex = 0 ' 'TSLabelTrimestre ' + Me.TSLabelTrimestre.Margin = New System.Windows.Forms.Padding(3) Me.TSLabelTrimestre.Name = "TSLabelTrimestre" - Me.TSLabelTrimestre.Size = New System.Drawing.Size(62, 22) + Me.TSLabelTrimestre.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) + Me.TSLabelTrimestre.Size = New System.Drawing.Size(62, 21) Me.TSLabelTrimestre.Text = "Trimestre: " ' 'TSComboBoxTrimestre ' Me.TSComboBoxTrimestre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend Me.TSComboBoxTrimestre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems + Me.TSComboBoxTrimestre.FlatStyle = System.Windows.Forms.FlatStyle.Standard Me.TSComboBoxTrimestre.Items.AddRange(New Object() {"Primero", "Segundo", "Tercero", "Cuarto"}) + Me.TSComboBoxTrimestre.Margin = New System.Windows.Forms.Padding(3) Me.TSComboBoxTrimestre.Name = "TSComboBoxTrimestre" - Me.TSComboBoxTrimestre.Size = New System.Drawing.Size(121, 25) + Me.TSComboBoxTrimestre.Size = New System.Drawing.Size(121, 23) ' 'TSLabelAño ' + Me.TSLabelAño.Margin = New System.Windows.Forms.Padding(3) Me.TSLabelAño.Name = "TSLabelAño" - Me.TSLabelAño.Size = New System.Drawing.Size(35, 22) + Me.TSLabelAño.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) + Me.TSLabelAño.Size = New System.Drawing.Size(35, 21) Me.TSLabelAño.Text = "Año: " ' 'TSTextBoxAño ' + Me.TSTextBoxAño.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.TSTextBoxAño.Margin = New System.Windows.Forms.Padding(3) Me.TSTextBoxAño.Name = "TSTextBoxAño" - Me.TSTextBoxAño.Size = New System.Drawing.Size(100, 25) + Me.TSTextBoxAño.Size = New System.Drawing.Size(100, 23) ' 'TSLabelFiltro1 ' + Me.TSLabelFiltro1.Margin = New System.Windows.Forms.Padding(3) Me.TSLabelFiltro1.Name = "TSLabelFiltro1" - Me.TSLabelFiltro1.Size = New System.Drawing.Size(61, 22) + Me.TSLabelFiltro1.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) + Me.TSLabelFiltro1.Size = New System.Drawing.Size(61, 21) Me.TSLabelFiltro1.Text = "Filtrar Por:" ' 'TSComboBoxFiltro1 ' Me.TSComboBoxFiltro1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend Me.TSComboBoxFiltro1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems - Me.TSComboBoxFiltro1.Items.AddRange(New Object() {"Id", "Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario", "Seleccionado"}) + Me.TSComboBoxFiltro1.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxFiltro1.Items.AddRange(New Object() {"Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario", "Seleccionado"}) + Me.TSComboBoxFiltro1.Margin = New System.Windows.Forms.Padding(3) Me.TSComboBoxFiltro1.Name = "TSComboBoxFiltro1" - Me.TSComboBoxFiltro1.Size = New System.Drawing.Size(121, 25) + Me.TSComboBoxFiltro1.Size = New System.Drawing.Size(121, 23) Me.TSComboBoxFiltro1.ToolTipText = "Seleccione columna por la cual desea filtrar" ' 'TSTextBoxFiltro1 ' + Me.TSTextBoxFiltro1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.TSTextBoxFiltro1.Margin = New System.Windows.Forms.Padding(3) Me.TSTextBoxFiltro1.Name = "TSTextBoxFiltro1" - Me.TSTextBoxFiltro1.Size = New System.Drawing.Size(100, 25) + Me.TSTextBoxFiltro1.Size = New System.Drawing.Size(100, 23) Me.TSTextBoxFiltro1.ToolTipText = "Ingresar valores por los cuales quiere filtrar la tabla." ' 'TSButtonFiltrar @@ -568,8 +591,10 @@ Partial Class ABMEgresos Me.TSButtonFiltrar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text Me.TSButtonFiltrar.Image = CType(resources.GetObject("TSButtonFiltrar.Image"), System.Drawing.Image) Me.TSButtonFiltrar.ImageTransparentColor = System.Drawing.Color.Magenta + Me.TSButtonFiltrar.Margin = New System.Windows.Forms.Padding(3) Me.TSButtonFiltrar.Name = "TSButtonFiltrar" - Me.TSButtonFiltrar.Size = New System.Drawing.Size(41, 22) + Me.TSButtonFiltrar.Padding = New System.Windows.Forms.Padding(10, 2, 10, 2) + Me.TSButtonFiltrar.Size = New System.Drawing.Size(61, 23) Me.TSButtonFiltrar.Text = "Filtrar" ' 'ButtonEliminar @@ -1115,6 +1140,62 @@ Partial Class ABMEgresos Me.PapeleraComentario.Name = "PapeleraComentario" Me.PapeleraComentario.ReadOnly = True ' + 'TSComboBoxOpera1 + ' + Me.TSComboBoxOpera1.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxOpera1.Items.AddRange(New Object() {"*", "="}) + Me.TSComboBoxOpera1.Margin = New System.Windows.Forms.Padding(3) + Me.TSComboBoxOpera1.Name = "TSComboBoxOpera1" + Me.TSComboBoxOpera1.Size = New System.Drawing.Size(75, 23) + Me.TSComboBoxOpera1.Text = "*" + Me.TSComboBoxOpera1.ToolTipText = "Elija entre buscar resultados apróximados o exactos" + ' + 'TSComboBoxFiltro2 + ' + Me.TSComboBoxFiltro2.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxFiltro2.Items.AddRange(New Object() {"Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario", "Seleccionado"}) + Me.TSComboBoxFiltro2.Margin = New System.Windows.Forms.Padding(3) + Me.TSComboBoxFiltro2.Name = "TSComboBoxFiltro2" + Me.TSComboBoxFiltro2.Size = New System.Drawing.Size(121, 23) + Me.TSComboBoxFiltro2.ToolTipText = "Seleccione columna por la cual desea filtrar" + ' + 'TSComboBoxOpera2 + ' + Me.TSComboBoxOpera2.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxOpera2.Items.AddRange(New Object() {"*", "="}) + Me.TSComboBoxOpera2.Margin = New System.Windows.Forms.Padding(3) + Me.TSComboBoxOpera2.Name = "TSComboBoxOpera2" + Me.TSComboBoxOpera2.Size = New System.Drawing.Size(75, 23) + Me.TSComboBoxOpera2.Text = "*" + Me.TSComboBoxOpera2.ToolTipText = "Elija entre buscar resultados apróximados o exactos" + ' + 'TSTextBoxFiltro2 + ' + Me.TSTextBoxFiltro2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.TSTextBoxFiltro2.Margin = New System.Windows.Forms.Padding(3) + Me.TSTextBoxFiltro2.Name = "TSTextBoxFiltro2" + Me.TSTextBoxFiltro2.Size = New System.Drawing.Size(100, 23) + ' + 'TSLabelFiltro2 + ' + Me.TSLabelFiltro2.Margin = New System.Windows.Forms.Padding(3) + Me.TSLabelFiltro2.Name = "TSLabelFiltro2" + Me.TSLabelFiltro2.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) + Me.TSLabelFiltro2.Size = New System.Drawing.Size(93, 21) + Me.TSLabelFiltro2.Text = "Filtro Adicional: " + ' + 'TSButtonQuitarFiltros + ' + Me.TSButtonQuitarFiltros.BackColor = System.Drawing.Color.LightBlue + Me.TSButtonQuitarFiltros.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text + Me.TSButtonQuitarFiltros.Image = CType(resources.GetObject("TSButtonQuitarFiltros.Image"), System.Drawing.Image) + Me.TSButtonQuitarFiltros.ImageTransparentColor = System.Drawing.Color.Magenta + Me.TSButtonQuitarFiltros.Margin = New System.Windows.Forms.Padding(3) + Me.TSButtonQuitarFiltros.Name = "TSButtonQuitarFiltros" + Me.TSButtonQuitarFiltros.Padding = New System.Windows.Forms.Padding(10, 2, 10, 2) + Me.TSButtonQuitarFiltros.Size = New System.Drawing.Size(99, 23) + Me.TSButtonQuitarFiltros.Text = "Quitar Filtros" + ' 'ABMEgresos ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -1134,7 +1215,6 @@ Partial Class ABMEgresos Me.SplitContainerModificar.ResumeLayout(False) Me.ToolStripContainerModificar.ContentPanel.ResumeLayout(False) Me.ToolStripContainerModificar.TopToolStripPanel.ResumeLayout(False) - Me.ToolStripContainerModificar.TopToolStripPanel.PerformLayout() Me.ToolStripContainerModificar.ResumeLayout(False) Me.ToolStripContainerModificar.PerformLayout() CType(Me.DGVModificar, System.ComponentModel.ISupportInitialize).EndInit() @@ -1257,4 +1337,10 @@ Partial Class ABMEgresos Friend WithEvents PapeleraReintegro As DataGridViewTextBoxColumn Friend WithEvents PapeleraMonto As DataGridViewTextBoxColumn Friend WithEvents PapeleraComentario As DataGridViewTextBoxColumn + Friend WithEvents TSComboBoxOpera1 As ToolStripComboBox + Friend WithEvents TSComboBoxFiltro2 As ToolStripComboBox + Friend WithEvents TSComboBoxOpera2 As ToolStripComboBox + Friend WithEvents TSTextBoxFiltro2 As ToolStripTextBox + Friend WithEvents TSLabelFiltro2 As ToolStripLabel + Friend WithEvents TSButtonQuitarFiltros As ToolStripButton End Class diff --git a/SireCu/Paneles/ABMEgresos.resx b/SireCu/Paneles/ABMEgresos.resx index 72688a5..ba7279b 100644 --- a/SireCu/Paneles/ABMEgresos.resx +++ b/SireCu/Paneles/ABMEgresos.resx @@ -187,57 +187,21 @@ TgDQASA1MVpwzwAAAABJRU5ErkJggg== - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + True diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index 8066885..c66f8ed 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -104,7 +104,7 @@ Public Class ABMEgresos Private Sub DataGridViewModificar_CellMouseDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DGVModificar.CellMouseDoubleClick ' Cargar el formulario con los datos para modificar - If e.RowIndex > 0 Then ' Evita los encabezados de la tabla + If e.RowIndex >= 0 Then ' Evita los encabezados de la tabla Try idModificando = CInt(DGVModificar.Rows(e.RowIndex).Cells("id").Value) @@ -145,7 +145,7 @@ Public Class ABMEgresos End Sub Private Sub DGVModificar_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DGVModificar.CellContentClick - If e.ColumnIndex = 1 And e.RowIndex > 0 Then + If e.ColumnIndex = 1 And e.RowIndex >= 0 Then Dim id As Integer = DGVModificar.Rows(e.RowIndex).Cells("id").Value Dim seleccionado As Integer If DGVModificar.Rows(e.RowIndex).Cells("seleccionado").Value = 0 Then @@ -269,7 +269,11 @@ Public Class ABMEgresos End If If Not (TSComboBoxFiltro1.SelectedItem = "" Or TSTextBoxFiltro1.Text = "") Then - filtros.Add(New KeyValuePair(Of String, String)(TSComboBoxFiltro1.SelectedItem, TSTextBoxFiltro1.Text)) + filtros.Add(New KeyValuePair(Of String, String)(TSComboBoxFiltro1.SelectedItem & TSComboBoxOpera1.SelectedItem, TSTextBoxFiltro1.Text)) + End If + + If Not (TSComboBoxFiltro2.SelectedItem = "" Or TSTextBoxFiltro2.Text = "") Then + filtros.Add(New KeyValuePair(Of String, String)(TSComboBoxFiltro2.SelectedItem & TSComboBoxOpera2.SelectedItem, TSTextBoxFiltro2.Text)) End If ' SQL Basico @@ -325,29 +329,66 @@ Public Class ABMEgresos ' Filtros adicionales Select Case keyv.Key - Case "Id" - sql += " AND E.id = " & keyv.Value - Case "Nro Comprobante" + Case "Nro Comprobante=" sql += " AND E.nro_comprobante = '" & keyv.Value & "'" - Case "Tipo Comprobante" + Case "Nro Comprobante*" + sql += " AND E.nro_comprobante LIKE '%" & keyv.Value & "%'" + + Case "Tipo Comprobante=" sql += " AND Comp.nombre = '" & keyv.Value & "'" - Case "Proveedor" + Case "Tipo Comprobante*" + sql += " AND Comp.nombre LIKE '%" & keyv.Value & "%'" + + Case "Proveedor=" sql += " AND Pro.nombre = '" & keyv.Value & "'" - Case "Categoria Gasto" + Case "Proveedor*" + sql += " AND Pro.nombre LIKE '%" & keyv.Value & "%'" + + Case "Categoria Gasto=" sql += " AND Gastos.nombre = '" & keyv.Value & "'" - Case "Persona" + Case "Categoria Gasto*" + sql += " AND Gastos.nombre LIKE '%" & keyv.Value & "%'" + + Case "Persona=" sql += " AND Per.nombre = '" & keyv.Value & "'" - Case "Fecha" - sql += " AND E.fecha = " & keyv.Value - Case "Seccional" + Case "Persona*" + sql += " AND Per.nombre LIKE '%" & keyv.Value & "%'" + + Case "Fecha=" + Case "Fecha*" + Dim fecha As Date + If Date.TryParse(keyv.Value, fecha) Then + sql += " AND E.fecha > '" & fecha.AddDays(-1).ToString("yyyy-MM-dd") & "' AND E.fecha < '" & fecha.AddDays(1).ToString("yyyy-MM-dd") & "'" + Else + MsgBox("No se pudo convertir el filtro a una fecha valida", MsgBoxStyle.Exclamation, "Filtrar") + End If + + Case "Seccional=" sql += " AND Secc.nombre = '" & keyv.Value & "'" - Case "Mes Reintegro" - sql += " AND E.mes_reintegro = " & keyv.Value - Case "Monto" - sql += " AND E.monto = " & keyv.Value - Case "Comentario" + Case "Seccional*" + sql += " AND Secc.nombre LIKE '%" & keyv.Value & "%'" + + Case "Mes Reintegro=" + Case "Mes Reintegro*" + Dim fecha As Date + If Date.TryParse(keyv.Value, fecha) Then + sql += " AND DATEPART(month, E.mes_reintegro) = '" & fecha.Month & "' AND DATEPART(year, E.mes_reintegro) = '" & fecha.Year & "'" + Else + MsgBox("No se pudo convertir el filtro a una fecha valida", MsgBoxStyle.Exclamation, "Filtrar") + End If + + Case "Monto=" + sql += " AND E.monto = '" & keyv.Value & "'" + Case "Monto*" + sql += " AND E.monto LIKE '%" & keyv.Value & "%'" + + Case "Comentario=" sql += " AND E.comentario = '" & keyv.Value & "'" - Case "Seleccionado" + Case "Comentario*" + sql += " AND E.comentario LIKE '%" & keyv.Value & "%'" + + Case "Seleccionado=" + Case "Seleccionado*" sql += " AND E.seleccionado = " & keyv.Value Case Else Exit Select @@ -361,6 +402,22 @@ Public Class ABMEgresos End Sub + + Private Sub TSButtonQuitarFiltros_Click(sender As Object, e As EventArgs) Handles TSButtonQuitarFiltros.Click + + TSComboBoxTrimestre.SelectedIndex = -1 + TSTextBoxAño.Text = "" + TSComboBoxFiltro1.SelectedIndex = -1 + TSComboBoxOpera1.SelectedIndex = 0 + TSTextBoxFiltro1.Text = "" + TSComboBoxFiltro2.SelectedIndex = -1 + TSComboBoxOpera2.SelectedIndex = 0 + TSTextBoxFiltro2.Text = "" + + CargardDGV(DGVModificar) + + End Sub + #End Region #Region "TAB Papelera - Eventos" From 3cfadd750bd57434ae454d656a1916ada882947e Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Wed, 10 May 2017 21:58:58 -0300 Subject: [PATCH 22/27] Validaciones Filtros --- SireCu/Paneles/ABMEgresos.resx | 102 +++++++++++++++++++++++++++++++++ SireCu/Paneles/ABMEgresos.vb | 98 +++++++++++++++++++++++++++++-- 2 files changed, 195 insertions(+), 5 deletions(-) diff --git a/SireCu/Paneles/ABMEgresos.resx b/SireCu/Paneles/ABMEgresos.resx index ba7279b..3e9b8bd 100644 --- a/SireCu/Paneles/ABMEgresos.resx +++ b/SireCu/Paneles/ABMEgresos.resx @@ -253,4 +253,106 @@ True + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + \ No newline at end of file diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index c66f8ed..da774e2 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -368,8 +368,7 @@ Public Class ABMEgresos Case "Seccional*" sql += " AND Secc.nombre LIKE '%" & keyv.Value & "%'" - Case "Mes Reintegro=" - Case "Mes Reintegro*" + Case "Mes Reintegro=", "Mes Reintegro*" Dim fecha As Date If Date.TryParse(keyv.Value, fecha) Then sql += " AND DATEPART(month, E.mes_reintegro) = '" & fecha.Month & "' AND DATEPART(year, E.mes_reintegro) = '" & fecha.Year & "'" @@ -387,8 +386,7 @@ Public Class ABMEgresos Case "Comentario*" sql += " AND E.comentario LIKE '%" & keyv.Value & "%'" - Case "Seleccionado=" - Case "Seleccionado*" + Case "Seleccionado=", "Seleccionado*" sql += " AND E.seleccionado = " & keyv.Value Case Else Exit Select @@ -757,6 +755,9 @@ Public Class ABMEgresos Private Sub ComboBoxTipoComprobante_KeyPress(sender As Object, e As KeyPressEventArgs) Handles ComboBoxTipoComprobante.KeyPress keyverify(e, letras:=True, espacios:=True) End Sub + Private Sub TSTextBoxAño_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TSTextBoxAño.KeyPress + keyverify(e, numeros:=True) + End Sub 'Validating Private Sub TextBoxNombre_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBoxNombre.Validating @@ -844,7 +845,94 @@ Public Class ABMEgresos End Sub Private Sub TSTextBoxFiltro1_Validating(sender As Object, e As CancelEventArgs) Handles TSTextBoxFiltro1.Validating - ' TODO validación segun tipo de campo seleccionado + Select Case TSComboBoxFiltro1.SelectedItem + Case "Fecha", "Mes Reintegro" + If Not (Date.TryParse(sender.Text, New Date) Or sender.Text = "") Then + System.Media.SystemSounds.Beep.Play() + sender.BackColor = Color.MistyRose + TSComboBoxFiltro1.BackColor = Color.MistyRose + Else + sender.BackColor = SystemColors.Window + TSComboBoxFiltro1.BackColor = SystemColors.Window + End If + Case "Monto" + If Not (IsNumeric(sender.Text) Or sender.Text = "") Then + System.Media.SystemSounds.Beep.Play() + sender.BackColor = Color.MistyRose + TSComboBoxFiltro1.BackColor = Color.MistyRose + Else + sender.BackColor = SystemColors.Window + TSComboBoxFiltro1.BackColor = SystemColors.Window + End If + Case "Seleccionado" + If Not (sender.text = "0" Or sender.Text = "1" Or sender.Text = "") Then + System.Media.SystemSounds.Beep.Play() + sender.BackColor = Color.MistyRose + TSComboBoxFiltro1.BackColor = Color.MistyRose + Else + sender.BackColor = SystemColors.Window + TSComboBoxFiltro1.BackColor = SystemColors.Window + End If + Case Else + sender.BackColor = SystemColors.Window + TSComboBoxFiltro1.BackColor = SystemColors.Window + Exit Select + End Select + End Sub + Private Sub TSTextBoxFiltro2_Validating(sender As Object, e As CancelEventArgs) Handles TSTextBoxFiltro2.Validating + Select Case TSComboBoxFiltro2.SelectedItem + Case "Fecha", "Mes Reintegro" + If Not (Date.TryParse(sender.Text, New Date) Or sender.Text = "") Then + System.Media.SystemSounds.Beep.Play() + sender.BackColor = Color.MistyRose + TSComboBoxFiltro2.BackColor = Color.MistyRose + Else + sender.BackColor = SystemColors.Window + TSComboBoxFiltro2.BackColor = SystemColors.Window + End If + Case "Monto" + If Not (IsNumeric(sender.Text) Or sender.Text = "") Then + System.Media.SystemSounds.Beep.Play() + sender.BackColor = Color.MistyRose + TSComboBoxFiltro2.BackColor = Color.MistyRose + Else + sender.BackColor = SystemColors.Window + TSComboBoxFiltro2.BackColor = SystemColors.Window + End If + Case "Seleccionado" + If Not (sender.text = "0" Or sender.Text = "1" Or sender.Text = "") Then + System.Media.SystemSounds.Beep.Play() + sender.BackColor = Color.MistyRose + TSComboBoxFiltro2.BackColor = Color.MistyRose + Else + sender.BackColor = SystemColors.Window + TSComboBoxFiltro2.BackColor = SystemColors.Window + End If + Case Else + sender.BackColor = SystemColors.Window + TSComboBoxFiltro2.BackColor = SystemColors.Window + Exit Select + End Select + End Sub + Private Sub TSComboBoxTrimestre_Validating(sender As Object, e As CancelEventArgs) Handles TSComboBoxTrimestre.Validating + If TSComboBoxTrimestre.Items.Contains(TSComboBoxTrimestre.Text) Or TSComboBoxTrimestre.Text = "" Then + TSComboBoxTrimestre.BackColor = SystemColors.Window + Else + TSComboBoxTrimestre.SelectedIndex = -1 + TSComboBoxTrimestre.Text = "" + System.Media.SystemSounds.Beep.Play() + TSComboBoxTrimestre.BackColor = Color.MistyRose + End If + End Sub + Private Sub TSComboBoxFiltro1_Validating(sender As Object, e As CancelEventArgs) Handles TSComboBoxFiltro1.Validating + If TSComboBoxFiltro1.Items.Contains(TSComboBoxFiltro1.Text) Or TSComboBoxFiltro1.Text = "" Then + TSComboBoxFiltro1.BackColor = SystemColors.Window + Else + TSComboBoxFiltro1.SelectedIndex = -1 + TSComboBoxFiltro1.Text = "" + System.Media.SystemSounds.Beep.Play() + TSComboBoxFiltro1.BackColor = Color.MistyRose + End If End Sub #End Region From 2d30f615b06e6471bc559ff7d477c5890155f8b9 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 12 May 2017 12:00:04 -0300 Subject: [PATCH 23/27] Minor Fix comboBox --- SireCu/Paneles/ABMEgresos.vb | 16 ++++++---------- SireCu/Paneles/Otros_AMB.vb | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index da774e2..d370574 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -648,9 +648,7 @@ Public Class ABMEgresos End If End Sub Private Sub cbTGasto_Validating(sender As Object, e As CancelEventArgs) Handles cbTGasto.Validating - ' Verifica que haya un item seleccionado y corresponda a la colección de opciones - If (sender.Text = "") Or (cbTGasto.AutoCompleteCustomSource.Contains(sender.Text) = False) Then - Dim var As String = cbTGasto.SelectedText + If (sender.Text = "") Or (exist("CategoriasGastos", "nombre", sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Categoría correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") ControlesConErroresAgregar.Add(sender) @@ -671,8 +669,7 @@ Public Class ABMEgresos End If End Sub Private Sub cbTComprobante_Validating(sender As Object, e As CancelEventArgs) Handles cbTComprobante.Validating - ' Verifica que haya un item seleccionado y corresponda a la colección de opciones - If (sender.Text = "") Or (cbTComprobante.AutoCompleteCustomSource.Contains(sender.Text) = False) Then + If (sender.Text = "") Or (exist("TiposComprobantes", "nombre", sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Tipo de Comprobante correcto." & vbCrLf & "Puede agregar uno nuevo en el menú Editar") ControlesConErroresAgregar.Add(sender) @@ -691,8 +688,7 @@ Public Class ABMEgresos End If End Sub Private Sub cbSeccional_Validating(sender As Object, e As CancelEventArgs) Handles cbSeccional.Validating - ' Verifica que haya un item seleccionado y corresponda a la colección de opciones - If (sender.Text = "") Or (cbSeccional.AutoCompleteCustomSource.Contains(sender.Text) = False) Then + If (sender.Text = "") Or (exist("Seccionales", "nombre", sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Seccional correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") ControlesConErroresAgregar.Add(sender) @@ -814,7 +810,7 @@ Public Class ABMEgresos End If End Sub Private Sub ComboBoxSeccional_Validating(sender As Object, e As CancelEventArgs) Handles ComboBoxSeccional.Validating - If (sender.Text = "") Or (ComboBoxSeccional.AutoCompleteCustomSource.Contains(sender.text) = False) Then + If (sender.Text = "") Or (exist("Seccionales", "nombre", sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Seccional correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") ControlesConErroresModificar.Add(sender) @@ -824,7 +820,7 @@ Public Class ABMEgresos End If End Sub Private Sub ComboBoxTipoComprobante_Validating(sender As Object, e As CancelEventArgs) Handles ComboBoxTipoComprobante.Validating - If (sender.Text = "") Or (ComboBoxTipoComprobante.AutoCompleteCustomSource.Contains(sender.Text) = False) Then + If (sender.Text = "") Or (exist("TiposComprobantes", "nombre", sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un Tipo de Comprobante correcto." & vbCrLf & "Puede agregar uno nuevo en el menú Editar") ControlesConErroresModificar.Add(sender) @@ -834,7 +830,7 @@ Public Class ABMEgresos End If End Sub Private Sub ComboBoxCategGasto_Validating(sender As Object, e As CancelEventArgs) Handles ComboBoxCategGasto.Validating - If (sender.Text = "") Or (ComboBoxCategGasto.AutoCompleteCustomSource.Contains(sender.Text) = False) Then + If (sender.Text = "") Or (exist("Categoriasgastos", "nombre", sender.Text) = False) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar una Categoría correcta." & vbCrLf & "Puede agregar una nueva en el menú Editar") ControlesConErroresModificar.Add(sender) diff --git a/SireCu/Paneles/Otros_AMB.vb b/SireCu/Paneles/Otros_AMB.vb index 40e25a5..23deb10 100644 --- a/SireCu/Paneles/Otros_AMB.vb +++ b/SireCu/Paneles/Otros_AMB.vb @@ -147,7 +147,7 @@ Public Class Otros_AMB keyverify(e, letras:=True, espacios:=True) End Sub Private Sub tb_editar_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tb_editar.KeyPress - keyverify(e, letras:=True, espacios:=True) + keyverify(e, letras:=True, espacios:=True, numeros:=True) End Sub Private Sub cb_tabla_Validating(sender As Object, e As CancelEventArgs) Handles cb_tabla.Validating From 84e0e71932ddbbe0ab7999f169b1d48c3c4eae95 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Fri, 12 May 2017 17:24:57 -0300 Subject: [PATCH 24/27] =?UTF-8?q?ABM=20Admin=20como=20m=C3=B3dulo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SireCu/Paneles/ABMAdmin.Designer.vb | 171 +++++++++++++++++++++++++++ SireCu/Paneles/ABMAdmin.resx | 120 +++++++++++++++++++ SireCu/Paneles/ABMAdmin.vb | 177 ++++++++++++++++++++++++++++ SireCu/Principal.Designer.vb | 37 ++++-- SireCu/Principal.vb | 8 ++ SireCu/SireCu.vbproj | 9 ++ 6 files changed, 513 insertions(+), 9 deletions(-) create mode 100644 SireCu/Paneles/ABMAdmin.Designer.vb create mode 100644 SireCu/Paneles/ABMAdmin.resx create mode 100644 SireCu/Paneles/ABMAdmin.vb diff --git a/SireCu/Paneles/ABMAdmin.Designer.vb b/SireCu/Paneles/ABMAdmin.Designer.vb new file mode 100644 index 0000000..74cc923 --- /dev/null +++ b/SireCu/Paneles/ABMAdmin.Designer.vb @@ -0,0 +1,171 @@ + _ +Partial Class ABMAdmin + Inherits System.Windows.Forms.UserControl + + 'UserControl reemplaza a Dispose para limpiar la lista de componentes. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Requerido por el Diseñador de Windows Forms + Private components As System.ComponentModel.IContainer + + 'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento + 'Se puede modificar usando el Diseñador de Windows Forms. + 'No lo modifique con el editor de código. + _ + Private Sub InitializeComponent() + Me.SplitContainerAdmin = New System.Windows.Forms.SplitContainer() + Me.DGVAdmin = New System.Windows.Forms.DataGridView() + Me.CBTabla = New System.Windows.Forms.ComboBox() + Me.TBModificar = New System.Windows.Forms.TextBox() + Me.BGuardar = New System.Windows.Forms.Button() + Me.BEliminar = New System.Windows.Forms.Button() + Me.BCancelar = New System.Windows.Forms.Button() + Me.LTabla = New System.Windows.Forms.Label() + Me.LEditar = New System.Windows.Forms.Label() + CType(Me.SplitContainerAdmin, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerAdmin.Panel1.SuspendLayout() + Me.SplitContainerAdmin.Panel2.SuspendLayout() + Me.SplitContainerAdmin.SuspendLayout() + CType(Me.DGVAdmin, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'SplitContainerAdmin + ' + Me.SplitContainerAdmin.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainerAdmin.FixedPanel = System.Windows.Forms.FixedPanel.Panel2 + Me.SplitContainerAdmin.IsSplitterFixed = True + Me.SplitContainerAdmin.Location = New System.Drawing.Point(0, 0) + Me.SplitContainerAdmin.Name = "SplitContainerAdmin" + ' + 'SplitContainerAdmin.Panel1 + ' + Me.SplitContainerAdmin.Panel1.Controls.Add(Me.DGVAdmin) + ' + 'SplitContainerAdmin.Panel2 + ' + Me.SplitContainerAdmin.Panel2.Controls.Add(Me.LEditar) + Me.SplitContainerAdmin.Panel2.Controls.Add(Me.LTabla) + Me.SplitContainerAdmin.Panel2.Controls.Add(Me.BCancelar) + Me.SplitContainerAdmin.Panel2.Controls.Add(Me.BEliminar) + Me.SplitContainerAdmin.Panel2.Controls.Add(Me.BGuardar) + Me.SplitContainerAdmin.Panel2.Controls.Add(Me.TBModificar) + Me.SplitContainerAdmin.Panel2.Controls.Add(Me.CBTabla) + Me.SplitContainerAdmin.Size = New System.Drawing.Size(755, 456) + Me.SplitContainerAdmin.SplitterDistance = 530 + Me.SplitContainerAdmin.TabIndex = 0 + ' + 'DGVAdmin + ' + Me.DGVAdmin.AllowUserToAddRows = False + Me.DGVAdmin.AllowUserToDeleteRows = False + Me.DGVAdmin.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill + Me.DGVAdmin.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DGVAdmin.Dock = System.Windows.Forms.DockStyle.Fill + Me.DGVAdmin.Location = New System.Drawing.Point(0, 0) + Me.DGVAdmin.Name = "DGVAdmin" + Me.DGVAdmin.Size = New System.Drawing.Size(530, 456) + Me.DGVAdmin.TabIndex = 0 + ' + 'CBTabla + ' + Me.CBTabla.FormattingEnabled = True + Me.CBTabla.Items.AddRange(New Object() {"Proveedor", "Tipo de Comprobante", "Tipo de Gasto", "Persona", "Seccional"}) + Me.CBTabla.Location = New System.Drawing.Point(17, 117) + Me.CBTabla.Name = "CBTabla" + Me.CBTabla.Size = New System.Drawing.Size(186, 21) + Me.CBTabla.TabIndex = 0 + ' + 'TBModificar + ' + Me.TBModificar.Location = New System.Drawing.Point(17, 166) + Me.TBModificar.Name = "TBModificar" + Me.TBModificar.Size = New System.Drawing.Size(186, 20) + Me.TBModificar.TabIndex = 1 + ' + 'BGuardar + ' + Me.BGuardar.BackColor = System.Drawing.Color.Honeydew + Me.BGuardar.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.BGuardar.Location = New System.Drawing.Point(17, 214) + Me.BGuardar.Name = "BGuardar" + Me.BGuardar.Size = New System.Drawing.Size(186, 23) + Me.BGuardar.TabIndex = 2 + Me.BGuardar.Text = "Guardar Nuevo" + Me.BGuardar.UseVisualStyleBackColor = False + ' + 'BEliminar + ' + Me.BEliminar.BackColor = System.Drawing.Color.MistyRose + Me.BEliminar.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.BEliminar.Location = New System.Drawing.Point(17, 265) + Me.BEliminar.Name = "BEliminar" + Me.BEliminar.Size = New System.Drawing.Size(186, 23) + Me.BEliminar.TabIndex = 3 + Me.BEliminar.Text = "Eliminar" + Me.BEliminar.UseVisualStyleBackColor = False + ' + 'BCancelar + ' + Me.BCancelar.Enabled = False + Me.BCancelar.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.BCancelar.Location = New System.Drawing.Point(17, 316) + Me.BCancelar.Name = "BCancelar" + Me.BCancelar.Size = New System.Drawing.Size(186, 23) + Me.BCancelar.TabIndex = 4 + Me.BCancelar.Text = "Cancelar" + Me.BCancelar.UseVisualStyleBackColor = True + ' + 'LTabla + ' + Me.LTabla.AutoSize = True + Me.LTabla.Location = New System.Drawing.Point(17, 98) + Me.LTabla.Name = "LTabla" + Me.LTabla.Size = New System.Drawing.Size(53, 13) + Me.LTabla.TabIndex = 5 + Me.LTabla.Text = "Modificar:" + ' + 'LEditar + ' + Me.LEditar.AutoSize = True + Me.LEditar.Location = New System.Drawing.Point(17, 150) + Me.LEditar.Name = "LEditar" + Me.LEditar.Size = New System.Drawing.Size(37, 13) + Me.LEditar.TabIndex = 6 + Me.LEditar.Text = "Editar:" + ' + 'ABMAdmin + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.SplitContainerAdmin) + Me.Name = "ABMAdmin" + Me.Size = New System.Drawing.Size(755, 456) + Me.SplitContainerAdmin.Panel1.ResumeLayout(False) + Me.SplitContainerAdmin.Panel2.ResumeLayout(False) + Me.SplitContainerAdmin.Panel2.PerformLayout() + CType(Me.SplitContainerAdmin, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerAdmin.ResumeLayout(False) + CType(Me.DGVAdmin, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents SplitContainerAdmin As SplitContainer + Friend WithEvents DGVAdmin As DataGridView + Friend WithEvents CBTabla As ComboBox + Friend WithEvents TBModificar As TextBox + Friend WithEvents BCancelar As Button + Friend WithEvents BEliminar As Button + Friend WithEvents BGuardar As Button + Friend WithEvents LEditar As Label + Friend WithEvents LTabla As Label +End Class diff --git a/SireCu/Paneles/ABMAdmin.resx b/SireCu/Paneles/ABMAdmin.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/SireCu/Paneles/ABMAdmin.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/SireCu/Paneles/ABMAdmin.vb b/SireCu/Paneles/ABMAdmin.vb new file mode 100644 index 0000000..2931d18 --- /dev/null +++ b/SireCu/Paneles/ABMAdmin.vb @@ -0,0 +1,177 @@ +Public Class ABMAdmin + + Dim tabla As String + Dim ControlesConErrores As List(Of Control) = New List(Of Control) + +#Region "Eventos y Botones" + Private Sub ABMAdmin_Load(sender As Object, e As EventArgs) Handles MyBase.Load + actualizar() + End Sub + + Private Sub BGuardar_Click(sender As Object, e As EventArgs) Handles BGuardar.Click + ' Verificamos que todos los campos hayan pasado las validaciones + If ControlesConErrores.Count > 0 Then + MsgBox("Por favor revise los campos ingresados", MsgBoxStyle.Exclamation, "Error") + Exit Sub + End If + + If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Guardar?") = MsgBoxResult.Ok) Then + + If (BGuardar.Text = "Guardar Nuevo") Then + + 'Verificación de registro repetido + If (exist(tabla, "nombre", TBModificar.Text) = True) Then + MsgBox("Ese " & CBTabla.Text & " ya se encuentra cargado", MsgBoxStyle.Exclamation, "Error") + Exit Sub + End If + Principal.query = "INSERT INTO [" & tabla & "] ([nombre]) VALUES (@nombre)" + + ElseIf (BGuardar.Text = "Actualizar") Then + + Principal.query = "UPDATE " & tabla & " SET [nombre] = @nombre WHERE id=@id " + Principal.command.Parameters.AddWithValue("@id", DGVAdmin.CurrentRow.Cells(0).Value) + + DGVAdmin.Enabled = True + CBTabla.Enabled = True + BGuardar.Text = "Guardar Nuevo" + + End If + + Principal.command.Parameters.AddWithValue("@nombre", TBModificar.Text) + consultarNQ(Principal.query, Principal.command) + + Principal.command.Parameters.Clear() + + MsgBox("Guardado Correctamente!", MsgBoxStyle.Information, "Guardado") + TBModificar.Text = "" + BCancelar.Enabled = False + + 'Actualizamos el Autocomplete de campos y el DataGridview + actualizar() + + End If + End Sub + + Private Sub BEliminar_Click(sender As Object, e As EventArgs) Handles BEliminar.Click + 'Verificacion de selección + If DGVAdmin.SelectedCells.Count = 0 Then + MsgBox("Por favor seleccione un registro", MsgBoxStyle.Exclamation, "Error") + Exit Sub + End If + + If ControlesConErrores.Count > 0 Then + MsgBox("Por favor revise los campos ingresados", MsgBoxStyle.Exclamation, "Error") + Exit Sub + End If + + If (MsgBox("Eliminar registro?", MsgBoxStyle.OkCancel, "Eliminar?") = MsgBoxResult.Ok) Then + + Principal.query = "DELETE FROM [" & tabla & "] WHERE id = @id" + Principal.command.Parameters.AddWithValue("@id", DGVAdmin.CurrentRow.Cells(0).Value) + consultarNQ(Principal.query, Principal.command) + + Principal.command.Parameters.Clear() + + MsgBox("Eliminado correctamente", MsgBoxStyle.Information, "Eliminado") + TBModificar.Text = "" + actualizar() + + End If + End Sub + + Private Sub BCancelar_Click(sender As Object, e As EventArgs) Handles BCancelar.Click + DGVAdmin.Enabled = True + TBModificar.Text = "" + CBTabla.Enabled = True + BCancelar.Enabled = False + BGuardar.Text = "Guardar Nuevo" + End Sub + + Private Sub DGVAdmin_CellMouseDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DGVAdmin.CellMouseDoubleClick + TBModificar.Text = DGVAdmin.CurrentRow.Cells(1).Value + DGVAdmin.Enabled = False + CBTabla.Enabled = False + BGuardar.Text = "Actualizar" + BCancelar.Enabled = True + End Sub + + Private Sub CBTabla_TextChanged(sender As Object, e As EventArgs) Handles CBTabla.TextChanged + actualizar() + 'TODO Revisar + 'Sacamos el TB de la lista de errores + Principal.ErrorProvider.SetError(TBModificar, "") + ControlesConErrores.Remove(TBModificar) + End Sub +#End Region + +#Region "Helpers" + + Private Sub actualizar() + Select Case CBTabla.Text + Case "Proveedor" + tabla = "Proveedores" + cargarDatos("Proveedores") + Case "Tipo de Comprobante" + tabla = "TiposComprobantes" + cargarDatos("TiposComprobantes") + Case "Tipo de Gasto" + tabla = "CategoriasGastos" + cargarDatos("CategoriasGastos") + Case "Persona" + tabla = "Personas" + cargarDatos("Personas") + Case "Seccional" + tabla = "Seccionales" + cargarDatos("Seccionales") + End Select + End Sub + Private Sub cargarDatos(ByVal tabla As String) + + cargarTablaEnDataSet(tabla) + + Dim bindSource As New BindingSource + bindSource.DataSource = Principal.dataset.Tables(tabla) + DGVAdmin.DataSource = bindSource + DGVAdmin.Columns.Item("id").Visible = False + + TBModificar.AutoCompleteCustomSource = autocomplete(tabla, "nombre") + + End Sub + +#End Region + +#Region "Validaciones" + + Private Sub CBTabla_KeyPress(sender As Object, e As KeyPressEventArgs) Handles CBTabla.KeyPress + keyverify(e, letras:=True, espacios:=True) + End Sub + + Private Sub TBModificar_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TBModificar.KeyPress + keyverify(e, letras:=True, espacios:=True, numeros:=True) + End Sub + + Private Sub CBTabla_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles CBTabla.Validating + 'TODO Revisar + If (CBTabla.Text <> "Proveedor") And (CBTabla.Text <> "Tipo de Comprobante") And + (CBTabla.Text <> "Tipo de Gasto") And (CBTabla.Text <> "Persona") And (CBTabla.Text <> "Seccional") Or + IsDBNull(sender.Text) Or (CBTabla.Text = "") Then + + Principal.ErrorProvider.SetError(sender, "Debe ingresar una opción válida") + ControlesConErrores.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErrores.Remove(sender) + End If + End Sub + + Private Sub TBModificar_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TBModificar.Validating + If IsDBNull(sender.Text) Or (TBModificar.Text = "") Then + Principal.ErrorProvider.SetError(sender, "Debe ingresar un nombre válido") + ControlesConErrores.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErrores.Remove(sender) + End If + End Sub +#End Region +End Class diff --git a/SireCu/Principal.Designer.vb b/SireCu/Principal.Designer.vb index c2efd0c..d577e12 100644 --- a/SireCu/Principal.Designer.vb +++ b/SireCu/Principal.Designer.vb @@ -29,6 +29,7 @@ Partial Class Principal Me.stat_Label = New System.Windows.Forms.ToolStripStatusLabel() Me.stat_Bar = New System.Windows.Forms.ToolStripProgressBar() Me.TStripLabelSaldo = New System.Windows.Forms.ToolStripStatusLabel() + Me.ToolStripStatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel() Me.SplitContainerPrincipal = New System.Windows.Forms.SplitContainer() Me.RadioButtonEgresos = New System.Windows.Forms.RadioButton() Me.RadioButtonIngresos = New System.Windows.Forms.RadioButton() @@ -42,7 +43,7 @@ Partial Class Principal Me.PersonasToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.SeccionalesToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ErrorProvider = New System.Windows.Forms.ErrorProvider(Me.components) - Me.ToolStripStatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel() + Me.RadioButtonABMAdmin = New System.Windows.Forms.RadioButton() Me.ToolStripContainerPrincipal.BottomToolStripPanel.SuspendLayout() Me.ToolStripContainerPrincipal.ContentPanel.SuspendLayout() Me.ToolStripContainerPrincipal.TopToolStripPanel.SuspendLayout() @@ -91,7 +92,7 @@ Partial Class Principal 'stat_Label ' Me.stat_Label.Name = "stat_Label" - Me.stat_Label.Size = New System.Drawing.Size(795, 17) + Me.stat_Label.Size = New System.Drawing.Size(928, 17) Me.stat_Label.Spring = True Me.stat_Label.Text = "Conectado" Me.stat_Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft @@ -108,6 +109,13 @@ Partial Class Principal Me.TStripLabelSaldo.Size = New System.Drawing.Size(39, 17) Me.TStripLabelSaldo.Text = "Saldo:" ' + 'ToolStripStatusLabel1 + ' + Me.ToolStripStatusLabel1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripStatusLabel1.Name = "ToolStripStatusLabel1" + Me.ToolStripStatusLabel1.Size = New System.Drawing.Size(0, 17) + Me.ToolStripStatusLabel1.Text = "ToolStripStatusLabel1" + ' 'SplitContainerPrincipal ' Me.SplitContainerPrincipal.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D @@ -120,6 +128,7 @@ Partial Class Principal ' 'SplitContainerPrincipal.Panel1 ' + Me.SplitContainerPrincipal.Panel1.Controls.Add(Me.RadioButtonABMAdmin) Me.SplitContainerPrincipal.Panel1.Controls.Add(Me.RadioButtonEgresos) Me.SplitContainerPrincipal.Panel1.Controls.Add(Me.RadioButtonIngresos) Me.SplitContainerPrincipal.Size = New System.Drawing.Size(982, 465) @@ -134,7 +143,7 @@ Partial Class Principal Me.RadioButtonEgresos.BackColor = System.Drawing.SystemColors.Control Me.RadioButtonEgresos.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.RadioButtonEgresos.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.RadioButtonEgresos.Location = New System.Drawing.Point(3, 78) + Me.RadioButtonEgresos.Location = New System.Drawing.Point(3, 70) Me.RadioButtonEgresos.MinimumSize = New System.Drawing.Size(190, 30) Me.RadioButtonEgresos.Name = "RadioButtonEgresos" Me.RadioButtonEgresos.Size = New System.Drawing.Size(190, 30) @@ -222,12 +231,21 @@ Partial Class Principal ' Me.ErrorProvider.ContainerControl = Me ' - 'ToolStripStatusLabel1 - ' - Me.ToolStripStatusLabel1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripStatusLabel1.Name = "ToolStripStatusLabel1" - Me.ToolStripStatusLabel1.Size = New System.Drawing.Size(0, 17) - Me.ToolStripStatusLabel1.Text = "ToolStripStatusLabel1" + 'RadioButtonABMAdmin + ' + Me.RadioButtonABMAdmin.Appearance = System.Windows.Forms.Appearance.Button + Me.RadioButtonABMAdmin.AutoSize = True + Me.RadioButtonABMAdmin.BackColor = System.Drawing.SystemColors.Control + Me.RadioButtonABMAdmin.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.RadioButtonABMAdmin.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.RadioButtonABMAdmin.Location = New System.Drawing.Point(3, 127) + Me.RadioButtonABMAdmin.MinimumSize = New System.Drawing.Size(190, 30) + Me.RadioButtonABMAdmin.Name = "RadioButtonABMAdmin" + Me.RadioButtonABMAdmin.Size = New System.Drawing.Size(190, 30) + Me.RadioButtonABMAdmin.TabIndex = 2 + Me.RadioButtonABMAdmin.Text = "ABM Admin" + Me.RadioButtonABMAdmin.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.RadioButtonABMAdmin.UseVisualStyleBackColor = False ' 'Principal ' @@ -278,4 +296,5 @@ Partial Class Principal Friend WithEvents SeccionalesToolStripMenuItem As ToolStripMenuItem Friend WithEvents TStripLabelSaldo As ToolStripStatusLabel Friend WithEvents ToolStripStatusLabel1 As ToolStripStatusLabel + Friend WithEvents RadioButtonABMAdmin As RadioButton End Class diff --git a/SireCu/Principal.vb b/SireCu/Principal.vb index 50f542f..d51661b 100644 --- a/SireCu/Principal.vb +++ b/SireCu/Principal.vb @@ -17,11 +17,15 @@ Public Class Principal Private Sub RadioButtonEgresos_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButtonEgresos.CheckedChanged AdminPantallas("ABMEgresos") End Sub + Private Sub RadioButtonABMAdmin_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButtonABMAdmin.CheckedChanged + AdminPantallas("ABMAdmin") + End Sub Private Sub AdminPantallas(ByVal pantalla As String) Dim bandera As Boolean = False ' Si la pantalla no se encuentra cargada, la hace visible + ' TODO Revisar For Each ctrl As Control In SplitContainerPrincipal.Panel2.Controls If pantalla = ctrl.Name Then ctrl.Show() @@ -42,6 +46,10 @@ Public Class Principal Dim pantallaABMEgresos As ABMEgresos = New ABMEgresos() pantallaABMEgresos.Dock = DockStyle.Fill SplitContainerPrincipal.Panel2.Controls.Add(pantallaABMEgresos) + Case "ABMAdmin" + Dim pantallaABMAdmin As ABMAdmin = New ABMAdmin() + pantallaABMAdmin.Dock = DockStyle.Fill + SplitContainerPrincipal.Panel2.Controls.Add(pantallaABMAdmin) Case Else MessageBox.Show("Error del administrador de pantallas") diff --git a/SireCu/SireCu.vbproj b/SireCu/SireCu.vbproj index d8aa3d2..df262d0 100644 --- a/SireCu/SireCu.vbproj +++ b/SireCu/SireCu.vbproj @@ -125,6 +125,12 @@ + + ABMAdmin.vb + + + UserControl + ABMEgresos.vb @@ -168,6 +174,9 @@ + + ABMAdmin.vb + ABMEgresos.vb From 700a2339f3e71763639e8e163a1088b1a3024942 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Wed, 17 May 2017 23:24:58 -0300 Subject: [PATCH 25/27] Remover MiniABM --- SireCu/Paneles/Otros_AMB.Designer.vb | 165 ------------------------- SireCu/Paneles/Otros_AMB.resx | 120 ------------------ SireCu/Paneles/Otros_AMB.vb | 177 --------------------------- SireCu/Principal.Designer.vb | 87 +++---------- SireCu/Principal.vb | 25 ---- SireCu/SireCu.vbproj | 9 -- 6 files changed, 19 insertions(+), 564 deletions(-) delete mode 100644 SireCu/Paneles/Otros_AMB.Designer.vb delete mode 100644 SireCu/Paneles/Otros_AMB.resx delete mode 100644 SireCu/Paneles/Otros_AMB.vb diff --git a/SireCu/Paneles/Otros_AMB.Designer.vb b/SireCu/Paneles/Otros_AMB.Designer.vb deleted file mode 100644 index 1a50bc5..0000000 --- a/SireCu/Paneles/Otros_AMB.Designer.vb +++ /dev/null @@ -1,165 +0,0 @@ - -Partial Class Otros_AMB - Inherits System.Windows.Forms.Form - - 'Form reemplaza a Dispose para limpiar la lista de componentes. - - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub - - 'Requerido por el Diseñador de Windows Forms - Private components As System.ComponentModel.IContainer - - 'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento - 'Se puede modificar usando el Diseñador de Windows Forms. - 'No lo modifique con el editor de código. - - Private Sub InitializeComponent() - Me.SplitContainer1 = New System.Windows.Forms.SplitContainer() - Me.dgv_otros = New System.Windows.Forms.DataGridView() - Me.Label1 = New System.Windows.Forms.Label() - Me.btn_Eliminar = New System.Windows.Forms.Button() - Me.tb_editar = New System.Windows.Forms.TextBox() - Me.btn_Cancelar = New System.Windows.Forms.Button() - Me.cb_tabla = New System.Windows.Forms.ComboBox() - Me.btn_Guardar = New System.Windows.Forms.Button() - CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SplitContainer1.Panel1.SuspendLayout() - Me.SplitContainer1.Panel2.SuspendLayout() - Me.SplitContainer1.SuspendLayout() - CType(Me.dgv_otros, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'SplitContainer1 - ' - Me.SplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill - Me.SplitContainer1.Location = New System.Drawing.Point(0, 0) - Me.SplitContainer1.Name = "SplitContainer1" - ' - 'SplitContainer1.Panel1 - ' - Me.SplitContainer1.Panel1.Controls.Add(Me.dgv_otros) - ' - 'SplitContainer1.Panel2 - ' - Me.SplitContainer1.Panel2.Controls.Add(Me.Label1) - Me.SplitContainer1.Panel2.Controls.Add(Me.btn_Eliminar) - Me.SplitContainer1.Panel2.Controls.Add(Me.tb_editar) - Me.SplitContainer1.Panel2.Controls.Add(Me.btn_Cancelar) - Me.SplitContainer1.Panel2.Controls.Add(Me.cb_tabla) - Me.SplitContainer1.Panel2.Controls.Add(Me.btn_Guardar) - Me.SplitContainer1.Size = New System.Drawing.Size(387, 201) - Me.SplitContainer1.SplitterDistance = 229 - Me.SplitContainer1.TabIndex = 0 - ' - 'dgv_otros - ' - Me.dgv_otros.AllowUserToAddRows = False - Me.dgv_otros.AllowUserToDeleteRows = False - Me.dgv_otros.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill - Me.dgv_otros.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.dgv_otros.Dock = System.Windows.Forms.DockStyle.Fill - Me.dgv_otros.Location = New System.Drawing.Point(0, 0) - Me.dgv_otros.MultiSelect = False - Me.dgv_otros.Name = "dgv_otros" - Me.dgv_otros.ReadOnly = True - Me.dgv_otros.Size = New System.Drawing.Size(229, 201) - Me.dgv_otros.TabIndex = 0 - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(53, 53) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(44, 13) - Me.Label1.TabIndex = 7 - Me.Label1.Text = "Nombre" - ' - 'btn_Eliminar - ' - Me.btn_Eliminar.Location = New System.Drawing.Point(78, 108) - Me.btn_Eliminar.Name = "btn_Eliminar" - Me.btn_Eliminar.Size = New System.Drawing.Size(64, 36) - Me.btn_Eliminar.TabIndex = 6 - Me.btn_Eliminar.TabStop = False - Me.btn_Eliminar.Text = "Eliminar" - Me.btn_Eliminar.UseVisualStyleBackColor = True - ' - 'tb_editar - ' - Me.tb_editar.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.tb_editar.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.tb_editar.Location = New System.Drawing.Point(8, 69) - Me.tb_editar.Name = "tb_editar" - Me.tb_editar.Size = New System.Drawing.Size(131, 20) - Me.tb_editar.TabIndex = 2 - ' - 'btn_Cancelar - ' - Me.btn_Cancelar.Enabled = False - Me.btn_Cancelar.Location = New System.Drawing.Point(41, 166) - Me.btn_Cancelar.Name = "btn_Cancelar" - Me.btn_Cancelar.Size = New System.Drawing.Size(75, 23) - Me.btn_Cancelar.TabIndex = 4 - Me.btn_Cancelar.TabStop = False - Me.btn_Cancelar.Text = "Cancelar" - Me.btn_Cancelar.UseVisualStyleBackColor = True - ' - 'cb_tabla - ' - Me.cb_tabla.AutoCompleteCustomSource.AddRange(New String() {"Proveedor", "Tipo de Comprobante", "Tipo de Gasto", "Persona", "Seccional"}) - Me.cb_tabla.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.cb_tabla.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems - Me.cb_tabla.FormattingEnabled = True - Me.cb_tabla.Items.AddRange(New Object() {"Proveedor", "Tipo de Comprobante", "Tipo de Gasto", "Persona", "Seccional"}) - Me.cb_tabla.Location = New System.Drawing.Point(8, 19) - Me.cb_tabla.Name = "cb_tabla" - Me.cb_tabla.Size = New System.Drawing.Size(131, 21) - Me.cb_tabla.TabIndex = 1 - ' - 'btn_Guardar - ' - Me.btn_Guardar.Location = New System.Drawing.Point(8, 108) - Me.btn_Guardar.Name = "btn_Guardar" - Me.btn_Guardar.Size = New System.Drawing.Size(64, 36) - Me.btn_Guardar.TabIndex = 3 - Me.btn_Guardar.Text = "Guardar Nuevo" - Me.btn_Guardar.UseVisualStyleBackColor = True - ' - 'Otros_AMB - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(387, 201) - Me.Controls.Add(Me.SplitContainer1) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "Otros_AMB" - Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "SireCu" - Me.SplitContainer1.Panel1.ResumeLayout(False) - Me.SplitContainer1.Panel2.ResumeLayout(False) - Me.SplitContainer1.Panel2.PerformLayout() - CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).EndInit() - Me.SplitContainer1.ResumeLayout(False) - CType(Me.dgv_otros, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - - End Sub - - Friend WithEvents SplitContainer1 As SplitContainer - Friend WithEvents dgv_otros As DataGridView - Friend WithEvents btn_Guardar As Button - Friend WithEvents cb_tabla As ComboBox - Friend WithEvents btn_Cancelar As Button - Friend WithEvents tb_editar As TextBox - Friend WithEvents btn_Eliminar As Button - Friend WithEvents Label1 As Label -End Class diff --git a/SireCu/Paneles/Otros_AMB.resx b/SireCu/Paneles/Otros_AMB.resx deleted file mode 100644 index 1af7de1..0000000 --- a/SireCu/Paneles/Otros_AMB.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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/SireCu/Paneles/Otros_AMB.vb b/SireCu/Paneles/Otros_AMB.vb deleted file mode 100644 index 23deb10..0000000 --- a/SireCu/Paneles/Otros_AMB.vb +++ /dev/null @@ -1,177 +0,0 @@ -Imports System.ComponentModel - -Public Class Otros_AMB - - Dim tabla As String - Dim ControlesConErrores As List(Of Control) = New List(Of Control) - -#Region "Botones" - Private Sub btn_Cancelar_Click(sender As Object, e As EventArgs) Handles btn_Cancelar.Click - dgv_otros.Enabled = True - tb_editar.Text = "" - cb_tabla.Enabled = True - btn_Cancelar.Enabled = False - btn_Guardar.Text = "Guardar Nuevo" - End Sub - Private Sub btn_Guardar_Click(sender As Object, e As EventArgs) Handles btn_Guardar.Click - - ' Verificamos que todos los campos hayan pasado las validaciones - If ControlesConErrores.Count > 0 Then - MsgBox("Por favor revise los campos ingresados", MsgBoxStyle.Exclamation, "Error") - Exit Sub - End If - - If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Guardar?") = MsgBoxResult.Ok) Then - - If (btn_Guardar.Text = "Guardar Nuevo") Then - - 'Verificación de registro repetido - If (exist(tabla, "nombre", tb_editar.Text) = True) Then - MsgBox("Ese " & cb_tabla.Text & " ya se encuentra cargado", MsgBoxStyle.Exclamation, "Error") - Exit Sub - End If - Principal.query = "INSERT INTO [" & tabla & "] ([nombre]) VALUES (@nombre)" - - ElseIf (btn_Guardar.Text = "Actualizar") Then - - Principal.query = "UPDATE " & tabla & " SET [nombre] = @nombre WHERE id=@id " - Principal.command.Parameters.AddWithValue("@id", dgv_otros.CurrentRow.Cells(0).Value) - - dgv_otros.Enabled = True - cb_tabla.Enabled = True - btn_Guardar.Text = "Guardar Nuevo" - - End If - - Principal.command.Parameters.AddWithValue("@nombre", tb_editar.Text) - consultarNQ(Principal.query, Principal.command) - - Principal.command.Parameters.Clear() - - MsgBox("Guardado Correctamente!", MsgBoxStyle.Information, "Guardado") - tb_editar.Text = "" - btn_Cancelar.Enabled = False - - 'Actualizamos el Autocomplete de campos y el DataGridview - actualizar() - - End If - - End Sub - Private Sub btn_Eliminar_Click(sender As Object, e As EventArgs) Handles btn_Eliminar.Click - - 'Verificacion de selección - If dgv_otros.SelectedCells.Count = 0 Then - MsgBox("Por favor seleccione un registro", MsgBoxStyle.Exclamation, "Error") - Exit Sub - End If - - If ControlesConErrores.Count > 0 Then - MsgBox("Por favor revise los campos ingresados", MsgBoxStyle.Exclamation, "Error") - Exit Sub - End If - - If (MsgBox("Eliminar registro?", MsgBoxStyle.OkCancel, "Eliminar?") = MsgBoxResult.Ok) Then - - Principal.query = "DELETE FROM [" & tabla & "] WHERE id = @id" - Principal.command.Parameters.AddWithValue("@id", dgv_otros.CurrentRow.Cells(0).Value) - consultarNQ(Principal.query, Principal.command) - - Principal.command.Parameters.Clear() - - MsgBox("Eliminado correctamente", MsgBoxStyle.Information, "Eliminado") - tb_editar.Text = "" - actualizar() - - End If - - End Sub -#End Region - -#Region "Otros" - Private Sub dgv_otros_CellMouseDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles dgv_otros.CellMouseDoubleClick - tb_editar.Text = dgv_otros.CurrentRow.Cells(1).Value - dgv_otros.Enabled = False - cb_tabla.Enabled = False - btn_Guardar.Text = "Actualizar" - btn_Cancelar.Enabled = True - End Sub - Private Sub Otros_AMB_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing - dgv_otros.DataSource = Nothing - End Sub - Private Sub cb_tabla_TextChanged(sender As Object, e As EventArgs) Handles cb_tabla.TextChanged - actualizar() - - 'Sacamos el TB de la lista de errores - Principal.ErrorProvider.SetError(tb_editar, "") - ControlesConErrores.Remove(tb_editar) - End Sub - Private Sub actualizar() - Select Case cb_tabla.Text - Case "Proveedor" - tabla = "Proveedores" - abm_otros("Proveedores") - Case "Tipo de Comprobante" - tabla = "TiposComprobantes" - abm_otros("TiposComprobantes") - Case "Tipo de Gasto" - tabla = "CategoriasGastos" - abm_otros("CategoriasGastos") - Case "Persona" - tabla = "Personas" - abm_otros("Personas") - Case "Seccional" - tabla = "Seccionales" - abm_otros("Seccionales") - End Select - End Sub - Private Sub Otros_AMB_Load(sender As Object, e As EventArgs) Handles MyBase.Load - actualizar() - End Sub - Private Sub abm_otros(ByVal tabla As String) - - cargarTablaEnDataSet(tabla) - - Dim bindSource As New BindingSource - bindSource.DataSource = Principal.dataset.Tables(tabla) - dgv_otros.DataSource = bindSource - dgv_otros.Columns.Item("id").Visible = False - - tb_editar.AutoCompleteCustomSource = autocomplete(tabla, "nombre") - - End Sub -#End Region - -#Region "Validaciones" - Private Sub cb_tabla_KeyPress(sender As Object, e As KeyPressEventArgs) Handles cb_tabla.KeyPress - keyverify(e, letras:=True, espacios:=True) - End Sub - Private Sub tb_editar_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tb_editar.KeyPress - keyverify(e, letras:=True, espacios:=True, numeros:=True) - End Sub - - Private Sub cb_tabla_Validating(sender As Object, e As CancelEventArgs) Handles cb_tabla.Validating - If (cb_tabla.Text <> "Proveedor") And (cb_tabla.Text <> "Tipo de Comprobante") And - (cb_tabla.Text <> "Tipo de Gasto") And (cb_tabla.Text <> "Persona") And (cb_tabla.Text <> "Seccional") Or - IsDBNull(sender.Text) Or (cb_tabla.Text = "") Then - - Principal.ErrorProvider.SetError(sender, "Debe ingresar una opción válida") - ControlesConErrores.Add(sender) - Else - Principal.ErrorProvider.SetError(sender, "") - ControlesConErrores.Remove(sender) - End If - End Sub - Private Sub tb_editar_Validating(sender As Object, e As CancelEventArgs) Handles tb_editar.Validating - If IsDBNull(sender.Text) Or (tb_editar.Text = "") Then - Principal.ErrorProvider.SetError(sender, "Debe ingresar un nombre válido") - ControlesConErrores.Add(sender) - Else - Principal.ErrorProvider.SetError(sender, "") - ControlesConErrores.Remove(sender) - End If - End Sub - -#End Region - -End Class \ No newline at end of file diff --git a/SireCu/Principal.Designer.vb b/SireCu/Principal.Designer.vb index d577e12..4b95be7 100644 --- a/SireCu/Principal.Designer.vb +++ b/SireCu/Principal.Designer.vb @@ -31,19 +31,13 @@ Partial Class Principal Me.TStripLabelSaldo = New System.Windows.Forms.ToolStripStatusLabel() Me.ToolStripStatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel() Me.SplitContainerPrincipal = New System.Windows.Forms.SplitContainer() + Me.RadioButtonABMAdmin = New System.Windows.Forms.RadioButton() Me.RadioButtonEgresos = New System.Windows.Forms.RadioButton() Me.RadioButtonIngresos = New System.Windows.Forms.RadioButton() Me.MenuStripPrincipal = New System.Windows.Forms.MenuStrip() Me.ArchivoToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.SalirToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.EditarToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.ProveedoresToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.TiposDeGastosToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.CategoríasDeGastosToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.PersonasToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.SeccionalesToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ErrorProvider = New System.Windows.Forms.ErrorProvider(Me.components) - Me.RadioButtonABMAdmin = New System.Windows.Forms.RadioButton() Me.ToolStripContainerPrincipal.BottomToolStripPanel.SuspendLayout() Me.ToolStripContainerPrincipal.ContentPanel.SuspendLayout() Me.ToolStripContainerPrincipal.TopToolStripPanel.SuspendLayout() @@ -136,6 +130,22 @@ Partial Class Principal Me.SplitContainerPrincipal.SplitterWidth = 1 Me.SplitContainerPrincipal.TabIndex = 0 ' + 'RadioButtonABMAdmin + ' + Me.RadioButtonABMAdmin.Appearance = System.Windows.Forms.Appearance.Button + Me.RadioButtonABMAdmin.AutoSize = True + Me.RadioButtonABMAdmin.BackColor = System.Drawing.SystemColors.Control + Me.RadioButtonABMAdmin.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.RadioButtonABMAdmin.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.RadioButtonABMAdmin.Location = New System.Drawing.Point(3, 127) + Me.RadioButtonABMAdmin.MinimumSize = New System.Drawing.Size(190, 30) + Me.RadioButtonABMAdmin.Name = "RadioButtonABMAdmin" + Me.RadioButtonABMAdmin.Size = New System.Drawing.Size(190, 30) + Me.RadioButtonABMAdmin.TabIndex = 2 + Me.RadioButtonABMAdmin.Text = "Administrar" + Me.RadioButtonABMAdmin.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.RadioButtonABMAdmin.UseVisualStyleBackColor = False + ' 'RadioButtonEgresos ' Me.RadioButtonEgresos.Appearance = System.Windows.Forms.Appearance.Button @@ -170,7 +180,7 @@ Partial Class Principal 'MenuStripPrincipal ' Me.MenuStripPrincipal.Dock = System.Windows.Forms.DockStyle.None - Me.MenuStripPrincipal.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ArchivoToolStripMenuItem, Me.EditarToolStripMenuItem}) + Me.MenuStripPrincipal.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ArchivoToolStripMenuItem}) Me.MenuStripPrincipal.Location = New System.Drawing.Point(0, 0) Me.MenuStripPrincipal.Name = "MenuStripPrincipal" Me.MenuStripPrincipal.Size = New System.Drawing.Size(982, 24) @@ -187,66 +197,13 @@ Partial Class Principal 'SalirToolStripMenuItem ' Me.SalirToolStripMenuItem.Name = "SalirToolStripMenuItem" - Me.SalirToolStripMenuItem.Size = New System.Drawing.Size(96, 22) + Me.SalirToolStripMenuItem.Size = New System.Drawing.Size(152, 22) Me.SalirToolStripMenuItem.Text = "&Salir" ' - 'EditarToolStripMenuItem - ' - Me.EditarToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ProveedoresToolStripMenuItem, Me.TiposDeGastosToolStripMenuItem, Me.CategoríasDeGastosToolStripMenuItem, Me.PersonasToolStripMenuItem, Me.SeccionalesToolStripMenuItem}) - Me.EditarToolStripMenuItem.Name = "EditarToolStripMenuItem" - Me.EditarToolStripMenuItem.Size = New System.Drawing.Size(49, 20) - Me.EditarToolStripMenuItem.Text = "Editar" - ' - 'ProveedoresToolStripMenuItem - ' - Me.ProveedoresToolStripMenuItem.Name = "ProveedoresToolStripMenuItem" - Me.ProveedoresToolStripMenuItem.Size = New System.Drawing.Size(201, 22) - Me.ProveedoresToolStripMenuItem.Text = "Proveedores" - ' - 'TiposDeGastosToolStripMenuItem - ' - Me.TiposDeGastosToolStripMenuItem.Name = "TiposDeGastosToolStripMenuItem" - Me.TiposDeGastosToolStripMenuItem.Size = New System.Drawing.Size(201, 22) - Me.TiposDeGastosToolStripMenuItem.Text = "Tipos de Comprobantes" - ' - 'CategoríasDeGastosToolStripMenuItem - ' - Me.CategoríasDeGastosToolStripMenuItem.Name = "CategoríasDeGastosToolStripMenuItem" - Me.CategoríasDeGastosToolStripMenuItem.Size = New System.Drawing.Size(201, 22) - Me.CategoríasDeGastosToolStripMenuItem.Text = "Tipos de Gastos" - ' - 'PersonasToolStripMenuItem - ' - Me.PersonasToolStripMenuItem.Name = "PersonasToolStripMenuItem" - Me.PersonasToolStripMenuItem.Size = New System.Drawing.Size(201, 22) - Me.PersonasToolStripMenuItem.Text = "Personas" - ' - 'SeccionalesToolStripMenuItem - ' - Me.SeccionalesToolStripMenuItem.Name = "SeccionalesToolStripMenuItem" - Me.SeccionalesToolStripMenuItem.Size = New System.Drawing.Size(201, 22) - Me.SeccionalesToolStripMenuItem.Text = "Seccionales" - ' 'ErrorProvider ' Me.ErrorProvider.ContainerControl = Me ' - 'RadioButtonABMAdmin - ' - Me.RadioButtonABMAdmin.Appearance = System.Windows.Forms.Appearance.Button - Me.RadioButtonABMAdmin.AutoSize = True - Me.RadioButtonABMAdmin.BackColor = System.Drawing.SystemColors.Control - Me.RadioButtonABMAdmin.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.RadioButtonABMAdmin.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.RadioButtonABMAdmin.Location = New System.Drawing.Point(3, 127) - Me.RadioButtonABMAdmin.MinimumSize = New System.Drawing.Size(190, 30) - Me.RadioButtonABMAdmin.Name = "RadioButtonABMAdmin" - Me.RadioButtonABMAdmin.Size = New System.Drawing.Size(190, 30) - Me.RadioButtonABMAdmin.TabIndex = 2 - Me.RadioButtonABMAdmin.Text = "ABM Admin" - Me.RadioButtonABMAdmin.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.RadioButtonABMAdmin.UseVisualStyleBackColor = False - ' 'Principal ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -288,12 +245,6 @@ Partial Class Principal Friend WithEvents stat_Bar As System.Windows.Forms.ToolStripProgressBar Friend WithEvents RadioButtonEgresos As System.Windows.Forms.RadioButton Friend WithEvents ErrorProvider As System.Windows.Forms.ErrorProvider - Friend WithEvents EditarToolStripMenuItem As ToolStripMenuItem - Friend WithEvents ProveedoresToolStripMenuItem As ToolStripMenuItem - Friend WithEvents TiposDeGastosToolStripMenuItem As ToolStripMenuItem - Friend WithEvents CategoríasDeGastosToolStripMenuItem As ToolStripMenuItem - Friend WithEvents PersonasToolStripMenuItem As ToolStripMenuItem - Friend WithEvents SeccionalesToolStripMenuItem As ToolStripMenuItem Friend WithEvents TStripLabelSaldo As ToolStripStatusLabel Friend WithEvents ToolStripStatusLabel1 As ToolStripStatusLabel Friend WithEvents RadioButtonABMAdmin As RadioButton diff --git a/SireCu/Principal.vb b/SireCu/Principal.vb index d51661b..ebf6207 100644 --- a/SireCu/Principal.vb +++ b/SireCu/Principal.vb @@ -73,29 +73,4 @@ Public Class Principal ActualizarSaldo() End Sub - - Private Sub ProveedoresToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ProveedoresToolStripMenuItem.Click - Otros_AMB.cb_tabla.Text = "Proveedor" - Otros_AMB.ShowDialog() - End Sub - - Private Sub TiposDeGastosToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TiposDeGastosToolStripMenuItem.Click - Otros_AMB.cb_tabla.Text = "Tipo de Comprobante" - Otros_AMB.ShowDialog() - End Sub - - Private Sub CategoríasDeGastosToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CategoríasDeGastosToolStripMenuItem.Click - Otros_AMB.cb_tabla.Text = "Tipo de Gasto" - Otros_AMB.ShowDialog() - End Sub - - Private Sub PersonasToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PersonasToolStripMenuItem.Click - Otros_AMB.cb_tabla.Text = "Persona" - Otros_AMB.ShowDialog() - End Sub - - Private Sub SeccionalesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SeccionalesToolStripMenuItem.Click - Otros_AMB.cb_tabla.Text = "Seccional" - Otros_AMB.ShowDialog() - End Sub End Class diff --git a/SireCu/SireCu.vbproj b/SireCu/SireCu.vbproj index df262d0..7385351 100644 --- a/SireCu/SireCu.vbproj +++ b/SireCu/SireCu.vbproj @@ -144,12 +144,6 @@ UserControl - - Otros_AMB.vb - - - Form - Form @@ -189,9 +183,6 @@ My.Resources Designer - - Otros_AMB.vb - Principal.vb From 3f25cea0260e04bdc8ed0b5b44caa7d43580fad9 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Thu, 18 May 2017 01:30:39 -0300 Subject: [PATCH 26/27] Cambios en UI --- SireCu/Paneles/ABMEgresos.Designer.vb | 1379 ++++++++++++------------- SireCu/Paneles/ABMEgresos.resx | 68 +- 2 files changed, 723 insertions(+), 724 deletions(-) diff --git a/SireCu/Paneles/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb index 64900c2..4ff1f5a 100644 --- a/SireCu/Paneles/ABMEgresos.Designer.vb +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -50,9 +50,31 @@ Partial Class ABMEgresos Me.tbComentario = New System.Windows.Forms.TextBox() Me.tbProveedor = New System.Windows.Forms.TextBox() Me.TabPageModificar = New System.Windows.Forms.TabPage() - Me.SplitContainerModificar = New System.Windows.Forms.SplitContainer() + Me.TabPagePapelera = New System.Windows.Forms.TabPage() + Me.SplitContainerPapelera = New System.Windows.Forms.SplitContainer() + Me.ToolStripContainerPapelera = New System.Windows.Forms.ToolStripContainer() + Me.DGVPapelera = New System.Windows.Forms.DataGridView() + Me.PapeleraId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraSeleccionado = New System.Windows.Forms.DataGridViewCheckBoxColumn() + Me.PapeleraNroComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraTComprobanteId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraTipoComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraProveedorId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraProveedor = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraCategoriaGastoId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraCategoriaGasto = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraPersonaId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraPersona = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraFecha = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraSeccionalId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraSeccional = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraReintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraMonto = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraComentario = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.bPapeleraEliminar = New System.Windows.Forms.Button() + Me.bPapeleraVaciarPapelera = New System.Windows.Forms.Button() + Me.bPapeleraRestaurar = New System.Windows.Forms.Button() Me.ToolStripContainerModificar = New System.Windows.Forms.ToolStripContainer() - Me.DGVModificar = New System.Windows.Forms.DataGridView() Me.ToolStripModificar = New System.Windows.Forms.ToolStrip() Me.TSLabelTrimestre = New System.Windows.Forms.ToolStripLabel() Me.TSComboBoxTrimestre = New System.Windows.Forms.ToolStripComboBox() @@ -60,8 +82,15 @@ Partial Class ABMEgresos Me.TSTextBoxAño = New System.Windows.Forms.ToolStripTextBox() Me.TSLabelFiltro1 = New System.Windows.Forms.ToolStripLabel() Me.TSComboBoxFiltro1 = New System.Windows.Forms.ToolStripComboBox() + Me.TSComboBoxOpera1 = New System.Windows.Forms.ToolStripComboBox() Me.TSTextBoxFiltro1 = New System.Windows.Forms.ToolStripTextBox() + Me.TSLabelFiltro2 = New System.Windows.Forms.ToolStripLabel() + Me.TSComboBoxFiltro2 = New System.Windows.Forms.ToolStripComboBox() + Me.TSComboBoxOpera2 = New System.Windows.Forms.ToolStripComboBox() + Me.TSTextBoxFiltro2 = New System.Windows.Forms.ToolStripTextBox() Me.TSButtonFiltrar = New System.Windows.Forms.ToolStripButton() + Me.TSButtonQuitarFiltros = New System.Windows.Forms.ToolStripButton() + Me.SplitContainerModificar = New System.Windows.Forms.SplitContainer() Me.ButtonEliminar = New System.Windows.Forms.Button() Me.LabelSeccional = New System.Windows.Forms.Label() Me.ComboBoxSeccional = New System.Windows.Forms.ComboBox() @@ -86,13 +115,7 @@ Partial Class ABMEgresos Me.Label12 = New System.Windows.Forms.Label() Me.TextBoxComentario = New System.Windows.Forms.TextBox() Me.TextBoxProveedor = New System.Windows.Forms.TextBox() - Me.TabPagePapelera = New System.Windows.Forms.TabPage() - Me.SplitContainerPapelera = New System.Windows.Forms.SplitContainer() - Me.ToolStripContainerPapelera = New System.Windows.Forms.ToolStripContainer() - Me.DGVPapelera = New System.Windows.Forms.DataGridView() - Me.bPapeleraEliminar = New System.Windows.Forms.Button() - Me.bPapeleraVaciarPapelera = New System.Windows.Forms.Button() - Me.bPapeleraRestaurar = New System.Windows.Forms.Button() + Me.DGVModificar = New System.Windows.Forms.DataGridView() Me.id = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.seleccionado = New System.Windows.Forms.DataGridViewCheckBoxColumn() Me.nro_comprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() @@ -110,41 +133,9 @@ Partial Class ABMEgresos Me.mes_reintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.monto = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.comentario = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraSeleccionado = New System.Windows.Forms.DataGridViewCheckBoxColumn() - Me.PapeleraNroComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraTComprobanteId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraTipoComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraProveedorId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraProveedor = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraCategoriaGastoId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraCategoriaGasto = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraPersonaId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraPersona = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraFecha = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraSeccionalId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraSeccional = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraReintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraMonto = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraComentario = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.TSComboBoxOpera1 = New System.Windows.Forms.ToolStripComboBox() - Me.TSComboBoxFiltro2 = New System.Windows.Forms.ToolStripComboBox() - Me.TSComboBoxOpera2 = New System.Windows.Forms.ToolStripComboBox() - Me.TSTextBoxFiltro2 = New System.Windows.Forms.ToolStripTextBox() - Me.TSLabelFiltro2 = New System.Windows.Forms.ToolStripLabel() - Me.TSButtonQuitarFiltros = New System.Windows.Forms.ToolStripButton() Me.TabControl.SuspendLayout() Me.TabPageAgregar.SuspendLayout() Me.TabPageModificar.SuspendLayout() - CType(Me.SplitContainerModificar, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SplitContainerModificar.Panel1.SuspendLayout() - Me.SplitContainerModificar.Panel2.SuspendLayout() - Me.SplitContainerModificar.SuspendLayout() - Me.ToolStripContainerModificar.ContentPanel.SuspendLayout() - Me.ToolStripContainerModificar.TopToolStripPanel.SuspendLayout() - Me.ToolStripContainerModificar.SuspendLayout() - CType(Me.DGVModificar, System.ComponentModel.ISupportInitialize).BeginInit() - Me.ToolStripModificar.SuspendLayout() Me.TabPagePapelera.SuspendLayout() CType(Me.SplitContainerPapelera, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainerPapelera.Panel1.SuspendLayout() @@ -153,6 +144,15 @@ Partial Class ABMEgresos Me.ToolStripContainerPapelera.ContentPanel.SuspendLayout() Me.ToolStripContainerPapelera.SuspendLayout() CType(Me.DGVPapelera, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ToolStripContainerModificar.ContentPanel.SuspendLayout() + Me.ToolStripContainerModificar.RightToolStripPanel.SuspendLayout() + Me.ToolStripContainerModificar.SuspendLayout() + Me.ToolStripModificar.SuspendLayout() + CType(Me.SplitContainerModificar, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerModificar.Panel1.SuspendLayout() + Me.SplitContainerModificar.Panel2.SuspendLayout() + Me.SplitContainerModificar.SuspendLayout() + CType(Me.DGVModificar, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'TabControl @@ -427,7 +427,7 @@ Partial Class ABMEgresos ' 'TabPageModificar ' - Me.TabPageModificar.Controls.Add(Me.SplitContainerModificar) + Me.TabPageModificar.Controls.Add(Me.ToolStripContainerModificar) Me.TabPageModificar.Location = New System.Drawing.Point(4, 25) Me.TabPageModificar.Name = "TabPageModificar" Me.TabPageModificar.Padding = New System.Windows.Forms.Padding(3) @@ -436,765 +436,763 @@ Partial Class ABMEgresos Me.TabPageModificar.Text = "Modificar" Me.TabPageModificar.UseVisualStyleBackColor = True ' - 'SplitContainerModificar - ' - Me.SplitContainerModificar.Dock = System.Windows.Forms.DockStyle.Fill - Me.SplitContainerModificar.Location = New System.Drawing.Point(3, 3) - Me.SplitContainerModificar.Name = "SplitContainerModificar" - Me.SplitContainerModificar.Orientation = System.Windows.Forms.Orientation.Horizontal - ' - 'SplitContainerModificar.Panel1 + 'TabPagePapelera ' - Me.SplitContainerModificar.Panel1.Controls.Add(Me.ToolStripContainerModificar) + Me.TabPagePapelera.Controls.Add(Me.SplitContainerPapelera) + Me.TabPagePapelera.Location = New System.Drawing.Point(4, 25) + Me.TabPagePapelera.Name = "TabPagePapelera" + Me.TabPagePapelera.Padding = New System.Windows.Forms.Padding(3) + Me.TabPagePapelera.Size = New System.Drawing.Size(747, 427) + Me.TabPagePapelera.TabIndex = 2 + Me.TabPagePapelera.Text = "Papelera" + Me.TabPagePapelera.UseVisualStyleBackColor = True ' - 'SplitContainerModificar.Panel2 + 'SplitContainerPapelera ' - Me.SplitContainerModificar.Panel2.Controls.Add(Me.ButtonEliminar) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.LabelSeccional) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxSeccional) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.DateTimePickerMesReintegro) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label1) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.DateTimePickerFecha) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxNroComprobante) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxTipoComprobante) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxPVenta) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label4) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label5) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxMonto) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxCategGasto) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.ButtonGuardar) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label6) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxNombre) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label7) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label8) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label9) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label10) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label11) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label12) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxComentario) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxProveedor) - Me.SplitContainerModificar.Size = New System.Drawing.Size(741, 421) - Me.SplitContainerModificar.SplitterDistance = 201 - Me.SplitContainerModificar.TabIndex = 0 + Me.SplitContainerPapelera.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainerPapelera.Location = New System.Drawing.Point(3, 3) + Me.SplitContainerPapelera.Name = "SplitContainerPapelera" + Me.SplitContainerPapelera.Orientation = System.Windows.Forms.Orientation.Horizontal ' - 'ToolStripContainerModificar + 'SplitContainerPapelera.Panel1 ' - Me.ToolStripContainerModificar.BottomToolStripPanelVisible = False + Me.SplitContainerPapelera.Panel1.Controls.Add(Me.ToolStripContainerPapelera) ' - 'ToolStripContainerModificar.ContentPanel + 'SplitContainerPapelera.Panel2 ' - Me.ToolStripContainerModificar.ContentPanel.Controls.Add(Me.DGVModificar) - Me.ToolStripContainerModificar.ContentPanel.Size = New System.Drawing.Size(741, 143) - Me.ToolStripContainerModificar.Dock = System.Windows.Forms.DockStyle.Fill - Me.ToolStripContainerModificar.LeftToolStripPanelVisible = False - Me.ToolStripContainerModificar.Location = New System.Drawing.Point(0, 0) - Me.ToolStripContainerModificar.Name = "ToolStripContainerModificar" - Me.ToolStripContainerModificar.RightToolStripPanelVisible = False - Me.ToolStripContainerModificar.Size = New System.Drawing.Size(741, 201) - Me.ToolStripContainerModificar.TabIndex = 0 - Me.ToolStripContainerModificar.Text = "ToolStripContainer1" + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraEliminar) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraVaciarPapelera) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraRestaurar) + Me.SplitContainerPapelera.Size = New System.Drawing.Size(741, 421) + Me.SplitContainerPapelera.SplitterDistance = 350 + Me.SplitContainerPapelera.TabIndex = 1 ' - 'ToolStripContainerModificar.TopToolStripPanel + 'ToolStripContainerPapelera ' - Me.ToolStripContainerModificar.TopToolStripPanel.Controls.Add(Me.ToolStripModificar) ' - 'DGVModificar + 'ToolStripContainerPapelera.ContentPanel ' - Me.DGVModificar.AllowUserToAddRows = False - Me.DGVModificar.AllowUserToDeleteRows = False - Me.DGVModificar.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DGVModificar.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.id, Me.seleccionado, Me.nro_comprobante, Me.tipo_comprobante_id, Me.tipo_comprobante_nombre, Me.proveedor_id, Me.proveedor_nombre, Me.categoria_gasto_id, Me.categoria_nombre, Me.persona_id, Me.persona_nombre, Me.fecha, Me.seccional_id, Me.seccional_nombre, Me.mes_reintegro, Me.monto, Me.comentario}) - Me.DGVModificar.Dock = System.Windows.Forms.DockStyle.Fill - Me.DGVModificar.Location = New System.Drawing.Point(0, 0) - Me.DGVModificar.Name = "DGVModificar" - Me.DGVModificar.ReadOnly = True - Me.DGVModificar.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DGVModificar.Size = New System.Drawing.Size(741, 143) - Me.DGVModificar.TabIndex = 0 + Me.ToolStripContainerPapelera.ContentPanel.Controls.Add(Me.DGVPapelera) + Me.ToolStripContainerPapelera.ContentPanel.Size = New System.Drawing.Size(741, 325) + Me.ToolStripContainerPapelera.Dock = System.Windows.Forms.DockStyle.Fill + Me.ToolStripContainerPapelera.Location = New System.Drawing.Point(0, 0) + Me.ToolStripContainerPapelera.Name = "ToolStripContainerPapelera" + Me.ToolStripContainerPapelera.Size = New System.Drawing.Size(741, 350) + Me.ToolStripContainerPapelera.TabIndex = 0 + Me.ToolStripContainerPapelera.Text = "ToolStripContainer1" ' - 'ToolStripModificar + 'DGVPapelera ' - Me.ToolStripModificar.AutoSize = False - Me.ToolStripModificar.Dock = System.Windows.Forms.DockStyle.None - Me.ToolStripModificar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStripModificar.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TSLabelTrimestre, Me.TSComboBoxTrimestre, Me.TSLabelAño, Me.TSTextBoxAño, Me.TSLabelFiltro1, Me.TSComboBoxFiltro1, Me.TSComboBoxOpera1, Me.TSTextBoxFiltro1, Me.TSLabelFiltro2, Me.TSComboBoxFiltro2, Me.TSComboBoxOpera2, Me.TSTextBoxFiltro2, Me.TSButtonFiltrar, Me.TSButtonQuitarFiltros}) - Me.ToolStripModificar.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow - Me.ToolStripModificar.Location = New System.Drawing.Point(3, 0) - Me.ToolStripModificar.Name = "ToolStripModificar" - Me.ToolStripModificar.Padding = New System.Windows.Forms.Padding(0) - Me.ToolStripModificar.Size = New System.Drawing.Size(738, 58) - Me.ToolStripModificar.TabIndex = 0 + Me.DGVPapelera.AllowUserToAddRows = False + Me.DGVPapelera.AllowUserToDeleteRows = False + Me.DGVPapelera.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DGVPapelera.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.PapeleraId, Me.PapeleraSeleccionado, Me.PapeleraNroComprobante, Me.PapeleraTComprobanteId, Me.PapeleraTipoComprobante, Me.PapeleraProveedorId, Me.PapeleraProveedor, Me.PapeleraCategoriaGastoId, Me.PapeleraCategoriaGasto, Me.PapeleraPersonaId, Me.PapeleraPersona, Me.PapeleraFecha, Me.PapeleraSeccionalId, Me.PapeleraSeccional, Me.PapeleraReintegro, Me.PapeleraMonto, Me.PapeleraComentario}) + Me.DGVPapelera.Dock = System.Windows.Forms.DockStyle.Fill + Me.DGVPapelera.Location = New System.Drawing.Point(0, 0) + Me.DGVPapelera.Name = "DGVPapelera" + Me.DGVPapelera.ReadOnly = True + Me.DGVPapelera.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DGVPapelera.Size = New System.Drawing.Size(741, 325) + Me.DGVPapelera.TabIndex = 0 ' - 'TSLabelTrimestre + 'PapeleraId ' - Me.TSLabelTrimestre.Margin = New System.Windows.Forms.Padding(3) - Me.TSLabelTrimestre.Name = "TSLabelTrimestre" - Me.TSLabelTrimestre.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) - Me.TSLabelTrimestre.Size = New System.Drawing.Size(62, 21) - Me.TSLabelTrimestre.Text = "Trimestre: " + Me.PapeleraId.HeaderText = "Id" + Me.PapeleraId.Name = "PapeleraId" + Me.PapeleraId.ReadOnly = True + Me.PapeleraId.Visible = False ' - 'TSComboBoxTrimestre + 'PapeleraSeleccionado ' - Me.TSComboBoxTrimestre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.TSComboBoxTrimestre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems - Me.TSComboBoxTrimestre.FlatStyle = System.Windows.Forms.FlatStyle.Standard - Me.TSComboBoxTrimestre.Items.AddRange(New Object() {"Primero", "Segundo", "Tercero", "Cuarto"}) - Me.TSComboBoxTrimestre.Margin = New System.Windows.Forms.Padding(3) - Me.TSComboBoxTrimestre.Name = "TSComboBoxTrimestre" - Me.TSComboBoxTrimestre.Size = New System.Drawing.Size(121, 23) + Me.PapeleraSeleccionado.HeaderText = "Seleccionado" + Me.PapeleraSeleccionado.Name = "PapeleraSeleccionado" + Me.PapeleraSeleccionado.ReadOnly = True ' - 'TSLabelAño + 'PapeleraNroComprobante ' - Me.TSLabelAño.Margin = New System.Windows.Forms.Padding(3) - Me.TSLabelAño.Name = "TSLabelAño" - Me.TSLabelAño.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) - Me.TSLabelAño.Size = New System.Drawing.Size(35, 21) - Me.TSLabelAño.Text = "Año: " + Me.PapeleraNroComprobante.HeaderText = "Nro Comprobante" + Me.PapeleraNroComprobante.Name = "PapeleraNroComprobante" + Me.PapeleraNroComprobante.ReadOnly = True ' - 'TSTextBoxAño + 'PapeleraTComprobanteId ' - Me.TSTextBoxAño.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.TSTextBoxAño.Margin = New System.Windows.Forms.Padding(3) - Me.TSTextBoxAño.Name = "TSTextBoxAño" - Me.TSTextBoxAño.Size = New System.Drawing.Size(100, 23) + Me.PapeleraTComprobanteId.HeaderText = "tipo_comprobante_id" + Me.PapeleraTComprobanteId.Name = "PapeleraTComprobanteId" + Me.PapeleraTComprobanteId.ReadOnly = True + Me.PapeleraTComprobanteId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraTComprobanteId.Visible = False ' - 'TSLabelFiltro1 + 'PapeleraTipoComprobante ' - Me.TSLabelFiltro1.Margin = New System.Windows.Forms.Padding(3) - Me.TSLabelFiltro1.Name = "TSLabelFiltro1" - Me.TSLabelFiltro1.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) - Me.TSLabelFiltro1.Size = New System.Drawing.Size(61, 21) - Me.TSLabelFiltro1.Text = "Filtrar Por:" + Me.PapeleraTipoComprobante.HeaderText = "Tipo Comprobante" + Me.PapeleraTipoComprobante.Name = "PapeleraTipoComprobante" + Me.PapeleraTipoComprobante.ReadOnly = True ' - 'TSComboBoxFiltro1 + 'PapeleraProveedorId ' - Me.TSComboBoxFiltro1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.TSComboBoxFiltro1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems - Me.TSComboBoxFiltro1.FlatStyle = System.Windows.Forms.FlatStyle.Standard - Me.TSComboBoxFiltro1.Items.AddRange(New Object() {"Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario", "Seleccionado"}) - Me.TSComboBoxFiltro1.Margin = New System.Windows.Forms.Padding(3) - Me.TSComboBoxFiltro1.Name = "TSComboBoxFiltro1" - Me.TSComboBoxFiltro1.Size = New System.Drawing.Size(121, 23) - Me.TSComboBoxFiltro1.ToolTipText = "Seleccione columna por la cual desea filtrar" + Me.PapeleraProveedorId.HeaderText = "proveedor_id" + Me.PapeleraProveedorId.Name = "PapeleraProveedorId" + Me.PapeleraProveedorId.ReadOnly = True + Me.PapeleraProveedorId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraProveedorId.Visible = False ' - 'TSTextBoxFiltro1 + 'PapeleraProveedor ' - Me.TSTextBoxFiltro1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.TSTextBoxFiltro1.Margin = New System.Windows.Forms.Padding(3) - Me.TSTextBoxFiltro1.Name = "TSTextBoxFiltro1" - Me.TSTextBoxFiltro1.Size = New System.Drawing.Size(100, 23) - Me.TSTextBoxFiltro1.ToolTipText = "Ingresar valores por los cuales quiere filtrar la tabla." + Me.PapeleraProveedor.HeaderText = "Proveedor" + Me.PapeleraProveedor.Name = "PapeleraProveedor" + Me.PapeleraProveedor.ReadOnly = True ' - 'TSButtonFiltrar + 'PapeleraCategoriaGastoId ' - Me.TSButtonFiltrar.BackColor = System.Drawing.Color.LightGreen - Me.TSButtonFiltrar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text - Me.TSButtonFiltrar.Image = CType(resources.GetObject("TSButtonFiltrar.Image"), System.Drawing.Image) - Me.TSButtonFiltrar.ImageTransparentColor = System.Drawing.Color.Magenta - Me.TSButtonFiltrar.Margin = New System.Windows.Forms.Padding(3) - Me.TSButtonFiltrar.Name = "TSButtonFiltrar" - Me.TSButtonFiltrar.Padding = New System.Windows.Forms.Padding(10, 2, 10, 2) - Me.TSButtonFiltrar.Size = New System.Drawing.Size(61, 23) - Me.TSButtonFiltrar.Text = "Filtrar" + Me.PapeleraCategoriaGastoId.HeaderText = "categoria_gasto_id" + Me.PapeleraCategoriaGastoId.Name = "PapeleraCategoriaGastoId" + Me.PapeleraCategoriaGastoId.ReadOnly = True + Me.PapeleraCategoriaGastoId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraCategoriaGastoId.Visible = False ' - 'ButtonEliminar + 'PapeleraCategoriaGasto ' - Me.ButtonEliminar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.ButtonEliminar.ForeColor = System.Drawing.Color.Red - Me.ButtonEliminar.Location = New System.Drawing.Point(529, 182) - Me.ButtonEliminar.Name = "ButtonEliminar" - Me.ButtonEliminar.Size = New System.Drawing.Size(163, 31) - Me.ButtonEliminar.TabIndex = 103 - Me.ButtonEliminar.Text = "Eliminar" - Me.ButtonEliminar.UseVisualStyleBackColor = True + Me.PapeleraCategoriaGasto.HeaderText = "Categoria Gasto" + Me.PapeleraCategoriaGasto.Name = "PapeleraCategoriaGasto" + Me.PapeleraCategoriaGasto.ReadOnly = True ' - 'LabelSeccional + 'PapeleraPersonaId ' - Me.LabelSeccional.AutoSize = True - Me.LabelSeccional.Location = New System.Drawing.Point(22, 130) - Me.LabelSeccional.Name = "LabelSeccional" - Me.LabelSeccional.Size = New System.Drawing.Size(68, 16) - Me.LabelSeccional.TabIndex = 119 - Me.LabelSeccional.Text = "Seccional" + Me.PapeleraPersonaId.HeaderText = "persona_id" + Me.PapeleraPersonaId.Name = "PapeleraPersonaId" + Me.PapeleraPersonaId.ReadOnly = True + Me.PapeleraPersonaId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraPersonaId.Visible = False ' - 'ComboBoxSeccional + 'PapeleraPersona ' - Me.ComboBoxSeccional.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.ComboBoxSeccional.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.ComboBoxSeccional.FormattingEnabled = True - Me.ComboBoxSeccional.Location = New System.Drawing.Point(145, 127) - Me.ComboBoxSeccional.Name = "ComboBoxSeccional" - Me.ComboBoxSeccional.Size = New System.Drawing.Size(197, 24) - Me.ComboBoxSeccional.TabIndex = 95 + Me.PapeleraPersona.HeaderText = "Persona" + Me.PapeleraPersona.Name = "PapeleraPersona" + Me.PapeleraPersona.ReadOnly = True ' - 'DateTimePickerMesReintegro + 'PapeleraFecha ' - Me.DateTimePickerMesReintegro.Checked = False - Me.DateTimePickerMesReintegro.CustomFormat = "MM/yyyy" - Me.DateTimePickerMesReintegro.Format = System.Windows.Forms.DateTimePickerFormat.Custom - Me.DateTimePickerMesReintegro.Location = New System.Drawing.Point(145, 99) - Me.DateTimePickerMesReintegro.Name = "DateTimePickerMesReintegro" - Me.DateTimePickerMesReintegro.ShowCheckBox = True - Me.DateTimePickerMesReintegro.ShowUpDown = True - Me.DateTimePickerMesReintegro.Size = New System.Drawing.Size(197, 22) - Me.DateTimePickerMesReintegro.TabIndex = 94 - Me.DateTimePickerMesReintegro.Value = New Date(2017, 3, 4, 19, 31, 9, 0) + Me.PapeleraFecha.HeaderText = "Fecha" + Me.PapeleraFecha.Name = "PapeleraFecha" + Me.PapeleraFecha.ReadOnly = True ' - 'Label1 + 'PapeleraSeccionalId ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(383, 16) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(49, 16) - Me.Label1.TabIndex = 116 - Me.Label1.Text = "Fecha:" + Me.PapeleraSeccionalId.HeaderText = "seccional_id" + Me.PapeleraSeccionalId.Name = "PapeleraSeccionalId" + Me.PapeleraSeccionalId.ReadOnly = True + Me.PapeleraSeccionalId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraSeccionalId.Visible = False ' - 'DateTimePickerFecha + 'PapeleraSeccional ' - Me.DateTimePickerFecha.CustomFormat = "" - Me.DateTimePickerFecha.Format = System.Windows.Forms.DateTimePickerFormat.[Short] - Me.DateTimePickerFecha.Location = New System.Drawing.Point(529, 13) - Me.DateTimePickerFecha.Name = "DateTimePickerFecha" - Me.DateTimePickerFecha.Size = New System.Drawing.Size(163, 22) - Me.DateTimePickerFecha.TabIndex = 96 - Me.DateTimePickerFecha.Value = New Date(2017, 3, 4, 19, 31, 9, 0) + Me.PapeleraSeccional.HeaderText = "Seccional" + Me.PapeleraSeccional.Name = "PapeleraSeccional" + Me.PapeleraSeccional.ReadOnly = True ' - 'TextBoxNroComprobante + 'PapeleraReintegro ' - Me.TextBoxNroComprobante.Location = New System.Drawing.Point(595, 71) - Me.TextBoxNroComprobante.Name = "TextBoxNroComprobante" - Me.TextBoxNroComprobante.Size = New System.Drawing.Size(97, 22) - Me.TextBoxNroComprobante.TabIndex = 99 + Me.PapeleraReintegro.HeaderText = "Mes Reintegro" + Me.PapeleraReintegro.Name = "PapeleraReintegro" + Me.PapeleraReintegro.ReadOnly = True ' - 'ComboBoxTipoComprobante + 'PapeleraMonto ' - Me.ComboBoxTipoComprobante.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.ComboBoxTipoComprobante.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.ComboBoxTipoComprobante.FormattingEnabled = True - Me.ComboBoxTipoComprobante.Location = New System.Drawing.Point(529, 41) - Me.ComboBoxTipoComprobante.Name = "ComboBoxTipoComprobante" - Me.ComboBoxTipoComprobante.Size = New System.Drawing.Size(163, 24) - Me.ComboBoxTipoComprobante.TabIndex = 97 + Me.PapeleraMonto.HeaderText = "Monto" + Me.PapeleraMonto.Name = "PapeleraMonto" + Me.PapeleraMonto.ReadOnly = True ' - 'TextBoxPVenta + 'PapeleraComentario ' - Me.TextBoxPVenta.Location = New System.Drawing.Point(529, 71) - Me.TextBoxPVenta.Name = "TextBoxPVenta" - Me.TextBoxPVenta.Size = New System.Drawing.Size(56, 22) - Me.TextBoxPVenta.TabIndex = 98 + Me.PapeleraComentario.HeaderText = "Comentario" + Me.PapeleraComentario.Name = "PapeleraComentario" + Me.PapeleraComentario.ReadOnly = True ' - 'Label4 + 'bPapeleraEliminar ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(508, 102) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(15, 16) - Me.Label4.TabIndex = 114 - Me.Label4.Text = "$" + Me.bPapeleraEliminar.Enabled = False + Me.bPapeleraEliminar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.bPapeleraEliminar.ForeColor = System.Drawing.Color.Red + Me.bPapeleraEliminar.Location = New System.Drawing.Point(289, 5) + Me.bPapeleraEliminar.Name = "bPapeleraEliminar" + Me.bPapeleraEliminar.Size = New System.Drawing.Size(163, 56) + Me.bPapeleraEliminar.TabIndex = 105 + Me.bPapeleraEliminar.Text = "Eliminar Permanetemente" + Me.bPapeleraEliminar.UseVisualStyleBackColor = True ' - 'Label5 + 'bPapeleraVaciarPapelera ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(383, 44) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(140, 16) - Me.Label5.TabIndex = 113 - Me.Label5.Text = "Tipo de Comprobante" + Me.bPapeleraVaciarPapelera.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.bPapeleraVaciarPapelera.ForeColor = System.Drawing.Color.Red + Me.bPapeleraVaciarPapelera.Location = New System.Drawing.Point(486, 5) + Me.bPapeleraVaciarPapelera.Name = "bPapeleraVaciarPapelera" + Me.bPapeleraVaciarPapelera.Size = New System.Drawing.Size(163, 56) + Me.bPapeleraVaciarPapelera.TabIndex = 104 + Me.bPapeleraVaciarPapelera.Text = "Vaciar Papelera" + Me.bPapeleraVaciarPapelera.UseVisualStyleBackColor = True ' - 'TextBoxMonto + 'bPapeleraRestaurar ' - Me.TextBoxMonto.Location = New System.Drawing.Point(529, 99) - Me.TextBoxMonto.Name = "TextBoxMonto" - Me.TextBoxMonto.Size = New System.Drawing.Size(163, 22) - Me.TextBoxMonto.TabIndex = 100 - Me.TextBoxMonto.Tag = "" + Me.bPapeleraRestaurar.Enabled = False + Me.bPapeleraRestaurar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.bPapeleraRestaurar.ForeColor = System.Drawing.Color.Red + Me.bPapeleraRestaurar.Location = New System.Drawing.Point(91, 5) + Me.bPapeleraRestaurar.Name = "bPapeleraRestaurar" + Me.bPapeleraRestaurar.Size = New System.Drawing.Size(163, 56) + Me.bPapeleraRestaurar.TabIndex = 103 + Me.bPapeleraRestaurar.Text = "Restaurar" + Me.bPapeleraRestaurar.UseVisualStyleBackColor = True ' - 'ComboBoxCategGasto + 'ToolStripContainerModificar ' - Me.ComboBoxCategGasto.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.ComboBoxCategGasto.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.ComboBoxCategGasto.FormattingEnabled = True - Me.ComboBoxCategGasto.Location = New System.Drawing.Point(145, 41) - Me.ComboBoxCategGasto.Name = "ComboBoxCategGasto" - Me.ComboBoxCategGasto.Size = New System.Drawing.Size(197, 24) - Me.ComboBoxCategGasto.TabIndex = 92 + Me.ToolStripContainerModificar.BottomToolStripPanelVisible = False ' - 'ButtonGuardar + 'ToolStripContainerModificar.ContentPanel ' - Me.ButtonGuardar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.ButtonGuardar.ForeColor = System.Drawing.Color.Green - Me.ButtonGuardar.Location = New System.Drawing.Point(529, 145) - Me.ButtonGuardar.Name = "ButtonGuardar" - Me.ButtonGuardar.Size = New System.Drawing.Size(163, 31) - Me.ButtonGuardar.TabIndex = 102 - Me.ButtonGuardar.Text = "Guardar" - Me.ButtonGuardar.UseVisualStyleBackColor = True + Me.ToolStripContainerModificar.ContentPanel.Controls.Add(Me.SplitContainerModificar) + Me.ToolStripContainerModificar.ContentPanel.Size = New System.Drawing.Size(614, 421) + Me.ToolStripContainerModificar.Dock = System.Windows.Forms.DockStyle.Fill + Me.ToolStripContainerModificar.LeftToolStripPanelVisible = False + Me.ToolStripContainerModificar.Location = New System.Drawing.Point(3, 3) + Me.ToolStripContainerModificar.Name = "ToolStripContainerModificar" ' - 'Label6 + 'ToolStripContainerModificar.RightToolStripPanel ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(22, 44) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(63, 16) - Me.Label6.TabIndex = 112 - Me.Label6.Text = "Gasto de" + Me.ToolStripContainerModificar.RightToolStripPanel.Controls.Add(Me.ToolStripModificar) + Me.ToolStripContainerModificar.Size = New System.Drawing.Size(741, 421) + Me.ToolStripContainerModificar.TabIndex = 1 + Me.ToolStripContainerModificar.Text = "ToolStripContainer1" + Me.ToolStripContainerModificar.TopToolStripPanelVisible = False ' - 'TextBoxNombre + 'ToolStripModificar ' - Me.TextBoxNombre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.TextBoxNombre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.TextBoxNombre.BackColor = System.Drawing.SystemColors.Window - Me.TextBoxNombre.Location = New System.Drawing.Point(145, 13) - Me.TextBoxNombre.Name = "TextBoxNombre" - Me.TextBoxNombre.Size = New System.Drawing.Size(197, 22) - Me.TextBoxNombre.TabIndex = 91 + Me.ToolStripModificar.Dock = System.Windows.Forms.DockStyle.Fill + Me.ToolStripModificar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStripModificar.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TSLabelTrimestre, Me.TSComboBoxTrimestre, Me.TSLabelAño, Me.TSTextBoxAño, Me.TSLabelFiltro1, Me.TSComboBoxFiltro1, Me.TSComboBoxOpera1, Me.TSTextBoxFiltro1, Me.TSLabelFiltro2, Me.TSComboBoxFiltro2, Me.TSComboBoxOpera2, Me.TSTextBoxFiltro2, Me.TSButtonFiltrar, Me.TSButtonQuitarFiltros}) + Me.ToolStripModificar.Location = New System.Drawing.Point(0, 3) + Me.ToolStripModificar.Name = "ToolStripModificar" + Me.ToolStripModificar.Padding = New System.Windows.Forms.Padding(0) + Me.ToolStripModificar.Size = New System.Drawing.Size(127, 400) + Me.ToolStripModificar.TabIndex = 0 ' - 'Label7 + 'TSLabelTrimestre ' - Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(22, 101) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(115, 16) - Me.Label7.TabIndex = 111 - Me.Label7.Text = "Mes de Reintegro" + Me.TSLabelTrimestre.Margin = New System.Windows.Forms.Padding(3) + Me.TSLabelTrimestre.Name = "TSLabelTrimestre" + Me.TSLabelTrimestre.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) + Me.TSLabelTrimestre.Size = New System.Drawing.Size(143, 21) + Me.TSLabelTrimestre.Text = "Trimestre: " ' - 'Label8 + 'TSComboBoxTrimestre ' - Me.Label8.AutoSize = True - Me.Label8.Location = New System.Drawing.Point(22, 161) - Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(77, 16) - Me.Label8.TabIndex = 110 - Me.Label8.Text = "Comentario" + Me.TSComboBoxTrimestre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TSComboBoxTrimestre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems + Me.TSComboBoxTrimestre.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxTrimestre.Items.AddRange(New Object() {"Primero", "Segundo", "Tercero", "Cuarto"}) + Me.TSComboBoxTrimestre.Margin = New System.Windows.Forms.Padding(3) + Me.TSComboBoxTrimestre.Name = "TSComboBoxTrimestre" + Me.TSComboBoxTrimestre.Size = New System.Drawing.Size(143, 23) ' - 'Label9 + 'TSLabelAño ' - Me.Label9.AutoSize = True - Me.Label9.Location = New System.Drawing.Point(383, 102) - Me.Label9.Name = "Label9" - Me.Label9.Size = New System.Drawing.Size(45, 16) - Me.Label9.TabIndex = 109 - Me.Label9.Text = "Monto" + Me.TSLabelAño.Margin = New System.Windows.Forms.Padding(3) + Me.TSLabelAño.Name = "TSLabelAño" + Me.TSLabelAño.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) + Me.TSLabelAño.Size = New System.Drawing.Size(143, 21) + Me.TSLabelAño.Text = "Año: " ' - 'Label10 + 'TSTextBoxAño ' - Me.Label10.AutoSize = True - Me.Label10.Location = New System.Drawing.Point(22, 74) - Me.Label10.Name = "Label10" - Me.Label10.Size = New System.Drawing.Size(72, 16) - Me.Label10.TabIndex = 108 - Me.Label10.Text = "Proveedor" + Me.TSTextBoxAño.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.TSTextBoxAño.Margin = New System.Windows.Forms.Padding(3) + Me.TSTextBoxAño.Name = "TSTextBoxAño" + Me.TSTextBoxAño.Size = New System.Drawing.Size(143, 23) ' - 'Label11 + 'TSLabelFiltro1 ' - Me.Label11.AutoSize = True - Me.Label11.Location = New System.Drawing.Point(22, 16) - Me.Label11.Name = "Label11" - Me.Label11.Size = New System.Drawing.Size(120, 16) - Me.Label11.TabIndex = 107 - Me.Label11.Text = "Nombre y Apellido" + Me.TSLabelFiltro1.Margin = New System.Windows.Forms.Padding(3) + Me.TSLabelFiltro1.Name = "TSLabelFiltro1" + Me.TSLabelFiltro1.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) + Me.TSLabelFiltro1.Size = New System.Drawing.Size(143, 21) + Me.TSLabelFiltro1.Text = "Filtrar Por:" ' - 'Label12 + 'TSComboBoxFiltro1 ' - Me.Label12.AutoSize = True - Me.Label12.Location = New System.Drawing.Point(383, 74) - Me.Label12.Name = "Label12" - Me.Label12.Size = New System.Drawing.Size(107, 16) - Me.Label12.TabIndex = 106 - Me.Label12.Text = "N° Comprobante" + Me.TSComboBoxFiltro1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TSComboBoxFiltro1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems + Me.TSComboBoxFiltro1.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxFiltro1.Items.AddRange(New Object() {"Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario", "Seleccionado"}) + Me.TSComboBoxFiltro1.Margin = New System.Windows.Forms.Padding(3) + Me.TSComboBoxFiltro1.Name = "TSComboBoxFiltro1" + Me.TSComboBoxFiltro1.Size = New System.Drawing.Size(143, 23) + Me.TSComboBoxFiltro1.ToolTipText = "Seleccione columna por la cual desea filtrar" ' - 'TextBoxComentario + 'TSComboBoxOpera1 ' - Me.TextBoxComentario.Location = New System.Drawing.Point(145, 157) - Me.TextBoxComentario.Multiline = True - Me.TextBoxComentario.Name = "TextBoxComentario" - Me.TextBoxComentario.Size = New System.Drawing.Size(378, 56) - Me.TextBoxComentario.TabIndex = 101 + Me.TSComboBoxOpera1.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxOpera1.Items.AddRange(New Object() {"*", "="}) + Me.TSComboBoxOpera1.Margin = New System.Windows.Forms.Padding(3) + Me.TSComboBoxOpera1.Name = "TSComboBoxOpera1" + Me.TSComboBoxOpera1.Size = New System.Drawing.Size(143, 23) + Me.TSComboBoxOpera1.Text = "*" + Me.TSComboBoxOpera1.ToolTipText = "Elija entre buscar resultados apróximados o exactos" ' - 'TextBoxProveedor + 'TSTextBoxFiltro1 ' - Me.TextBoxProveedor.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.TextBoxProveedor.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.TextBoxProveedor.Location = New System.Drawing.Point(145, 71) - Me.TextBoxProveedor.Name = "TextBoxProveedor" - Me.TextBoxProveedor.Size = New System.Drawing.Size(197, 22) - Me.TextBoxProveedor.TabIndex = 93 + Me.TSTextBoxFiltro1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.TSTextBoxFiltro1.Margin = New System.Windows.Forms.Padding(3) + Me.TSTextBoxFiltro1.Name = "TSTextBoxFiltro1" + Me.TSTextBoxFiltro1.Size = New System.Drawing.Size(143, 23) + Me.TSTextBoxFiltro1.ToolTipText = "Ingresar valores por los cuales quiere filtrar la tabla." ' - 'TabPagePapelera + 'TSLabelFiltro2 ' - Me.TabPagePapelera.Controls.Add(Me.SplitContainerPapelera) - Me.TabPagePapelera.Location = New System.Drawing.Point(4, 25) - Me.TabPagePapelera.Name = "TabPagePapelera" - Me.TabPagePapelera.Padding = New System.Windows.Forms.Padding(3) - Me.TabPagePapelera.Size = New System.Drawing.Size(747, 427) - Me.TabPagePapelera.TabIndex = 2 - Me.TabPagePapelera.Text = "Papelera" - Me.TabPagePapelera.UseVisualStyleBackColor = True + Me.TSLabelFiltro2.Margin = New System.Windows.Forms.Padding(3) + Me.TSLabelFiltro2.Name = "TSLabelFiltro2" + Me.TSLabelFiltro2.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) + Me.TSLabelFiltro2.Size = New System.Drawing.Size(143, 21) + Me.TSLabelFiltro2.Text = "Filtro Adicional: " ' - 'SplitContainerPapelera + 'TSComboBoxFiltro2 ' - Me.SplitContainerPapelera.Dock = System.Windows.Forms.DockStyle.Fill - Me.SplitContainerPapelera.Location = New System.Drawing.Point(3, 3) - Me.SplitContainerPapelera.Name = "SplitContainerPapelera" - Me.SplitContainerPapelera.Orientation = System.Windows.Forms.Orientation.Horizontal + Me.TSComboBoxFiltro2.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxFiltro2.Items.AddRange(New Object() {"Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario", "Seleccionado"}) + Me.TSComboBoxFiltro2.Margin = New System.Windows.Forms.Padding(3) + Me.TSComboBoxFiltro2.Name = "TSComboBoxFiltro2" + Me.TSComboBoxFiltro2.Size = New System.Drawing.Size(143, 23) + Me.TSComboBoxFiltro2.ToolTipText = "Seleccione columna por la cual desea filtrar" ' - 'SplitContainerPapelera.Panel1 + 'TSComboBoxOpera2 ' - Me.SplitContainerPapelera.Panel1.Controls.Add(Me.ToolStripContainerPapelera) + Me.TSComboBoxOpera2.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxOpera2.Items.AddRange(New Object() {"*", "="}) + Me.TSComboBoxOpera2.Margin = New System.Windows.Forms.Padding(3) + Me.TSComboBoxOpera2.Name = "TSComboBoxOpera2" + Me.TSComboBoxOpera2.Size = New System.Drawing.Size(143, 23) + Me.TSComboBoxOpera2.Text = "*" + Me.TSComboBoxOpera2.ToolTipText = "Elija entre buscar resultados apróximados o exactos" ' - 'SplitContainerPapelera.Panel2 + 'TSTextBoxFiltro2 ' - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraEliminar) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraVaciarPapelera) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraRestaurar) - Me.SplitContainerPapelera.Size = New System.Drawing.Size(741, 421) - Me.SplitContainerPapelera.SplitterDistance = 350 - Me.SplitContainerPapelera.TabIndex = 1 + Me.TSTextBoxFiltro2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.TSTextBoxFiltro2.Margin = New System.Windows.Forms.Padding(3) + Me.TSTextBoxFiltro2.Name = "TSTextBoxFiltro2" + Me.TSTextBoxFiltro2.Size = New System.Drawing.Size(143, 23) ' - 'ToolStripContainerPapelera + 'TSButtonFiltrar ' + Me.TSButtonFiltrar.BackColor = System.Drawing.Color.LightGreen + Me.TSButtonFiltrar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text + Me.TSButtonFiltrar.Image = CType(resources.GetObject("TSButtonFiltrar.Image"), System.Drawing.Image) + Me.TSButtonFiltrar.ImageTransparentColor = System.Drawing.Color.Magenta + Me.TSButtonFiltrar.Margin = New System.Windows.Forms.Padding(3) + Me.TSButtonFiltrar.Name = "TSButtonFiltrar" + Me.TSButtonFiltrar.Padding = New System.Windows.Forms.Padding(10, 2, 10, 2) + Me.TSButtonFiltrar.Size = New System.Drawing.Size(120, 23) + Me.TSButtonFiltrar.Text = "Filtrar" ' - 'ToolStripContainerPapelera.ContentPanel + 'TSButtonQuitarFiltros ' - Me.ToolStripContainerPapelera.ContentPanel.Controls.Add(Me.DGVPapelera) - Me.ToolStripContainerPapelera.ContentPanel.Size = New System.Drawing.Size(741, 325) - Me.ToolStripContainerPapelera.Dock = System.Windows.Forms.DockStyle.Fill - Me.ToolStripContainerPapelera.Location = New System.Drawing.Point(0, 0) - Me.ToolStripContainerPapelera.Name = "ToolStripContainerPapelera" - Me.ToolStripContainerPapelera.Size = New System.Drawing.Size(741, 350) - Me.ToolStripContainerPapelera.TabIndex = 0 - Me.ToolStripContainerPapelera.Text = "ToolStripContainer1" + Me.TSButtonQuitarFiltros.BackColor = System.Drawing.Color.LightBlue + Me.TSButtonQuitarFiltros.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text + Me.TSButtonQuitarFiltros.Image = CType(resources.GetObject("TSButtonQuitarFiltros.Image"), System.Drawing.Image) + Me.TSButtonQuitarFiltros.ImageTransparentColor = System.Drawing.Color.Magenta + Me.TSButtonQuitarFiltros.Margin = New System.Windows.Forms.Padding(3) + Me.TSButtonQuitarFiltros.Name = "TSButtonQuitarFiltros" + Me.TSButtonQuitarFiltros.Padding = New System.Windows.Forms.Padding(10, 2, 10, 2) + Me.TSButtonQuitarFiltros.Size = New System.Drawing.Size(143, 23) + Me.TSButtonQuitarFiltros.Text = "Quitar Filtros" ' - 'DGVPapelera + 'SplitContainerModificar ' - Me.DGVPapelera.AllowUserToAddRows = False - Me.DGVPapelera.AllowUserToDeleteRows = False - Me.DGVPapelera.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DGVPapelera.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.PapeleraId, Me.PapeleraSeleccionado, Me.PapeleraNroComprobante, Me.PapeleraTComprobanteId, Me.PapeleraTipoComprobante, Me.PapeleraProveedorId, Me.PapeleraProveedor, Me.PapeleraCategoriaGastoId, Me.PapeleraCategoriaGasto, Me.PapeleraPersonaId, Me.PapeleraPersona, Me.PapeleraFecha, Me.PapeleraSeccionalId, Me.PapeleraSeccional, Me.PapeleraReintegro, Me.PapeleraMonto, Me.PapeleraComentario}) - Me.DGVPapelera.Dock = System.Windows.Forms.DockStyle.Fill - Me.DGVPapelera.Location = New System.Drawing.Point(0, 0) - Me.DGVPapelera.Name = "DGVPapelera" - Me.DGVPapelera.ReadOnly = True - Me.DGVPapelera.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DGVPapelera.Size = New System.Drawing.Size(741, 325) - Me.DGVPapelera.TabIndex = 0 + Me.SplitContainerModificar.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainerModificar.Location = New System.Drawing.Point(0, 0) + Me.SplitContainerModificar.Name = "SplitContainerModificar" + Me.SplitContainerModificar.Orientation = System.Windows.Forms.Orientation.Horizontal ' - 'bPapeleraEliminar + 'SplitContainerModificar.Panel1 ' - Me.bPapeleraEliminar.Enabled = False - Me.bPapeleraEliminar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.bPapeleraEliminar.ForeColor = System.Drawing.Color.Red - Me.bPapeleraEliminar.Location = New System.Drawing.Point(289, 5) - Me.bPapeleraEliminar.Name = "bPapeleraEliminar" - Me.bPapeleraEliminar.Size = New System.Drawing.Size(163, 56) - Me.bPapeleraEliminar.TabIndex = 105 - Me.bPapeleraEliminar.Text = "Eliminar Permanetemente" - Me.bPapeleraEliminar.UseVisualStyleBackColor = True + Me.SplitContainerModificar.Panel1.Controls.Add(Me.DGVModificar) ' - 'bPapeleraVaciarPapelera + 'SplitContainerModificar.Panel2 ' - Me.bPapeleraVaciarPapelera.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.bPapeleraVaciarPapelera.ForeColor = System.Drawing.Color.Red - Me.bPapeleraVaciarPapelera.Location = New System.Drawing.Point(486, 5) - Me.bPapeleraVaciarPapelera.Name = "bPapeleraVaciarPapelera" - Me.bPapeleraVaciarPapelera.Size = New System.Drawing.Size(163, 56) - Me.bPapeleraVaciarPapelera.TabIndex = 104 - Me.bPapeleraVaciarPapelera.Text = "Vaciar Papelera" - Me.bPapeleraVaciarPapelera.UseVisualStyleBackColor = True + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ButtonEliminar) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.LabelSeccional) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxSeccional) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.DateTimePickerMesReintegro) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label1) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.DateTimePickerFecha) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxNroComprobante) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxTipoComprobante) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxPVenta) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label4) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label5) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxMonto) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxCategGasto) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ButtonGuardar) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label6) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxNombre) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label7) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label8) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label9) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label10) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label11) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label12) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxComentario) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxProveedor) + Me.SplitContainerModificar.Size = New System.Drawing.Size(614, 421) + Me.SplitContainerModificar.SplitterDistance = 201 + Me.SplitContainerModificar.TabIndex = 1 ' - 'bPapeleraRestaurar + 'ButtonEliminar ' - Me.bPapeleraRestaurar.Enabled = False - Me.bPapeleraRestaurar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.bPapeleraRestaurar.ForeColor = System.Drawing.Color.Red - Me.bPapeleraRestaurar.Location = New System.Drawing.Point(91, 5) - Me.bPapeleraRestaurar.Name = "bPapeleraRestaurar" - Me.bPapeleraRestaurar.Size = New System.Drawing.Size(163, 56) - Me.bPapeleraRestaurar.TabIndex = 103 - Me.bPapeleraRestaurar.Text = "Restaurar" - Me.bPapeleraRestaurar.UseVisualStyleBackColor = True + Me.ButtonEliminar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.ButtonEliminar.ForeColor = System.Drawing.Color.Red + Me.ButtonEliminar.Location = New System.Drawing.Point(449, 182) + Me.ButtonEliminar.Name = "ButtonEliminar" + Me.ButtonEliminar.Size = New System.Drawing.Size(150, 31) + Me.ButtonEliminar.TabIndex = 103 + Me.ButtonEliminar.Text = "Eliminar" + Me.ButtonEliminar.UseVisualStyleBackColor = True ' - 'id + 'LabelSeccional ' - Me.id.HeaderText = "Id" - Me.id.Name = "id" - Me.id.ReadOnly = True - Me.id.Visible = False + Me.LabelSeccional.AutoSize = True + Me.LabelSeccional.Location = New System.Drawing.Point(13, 130) + Me.LabelSeccional.Name = "LabelSeccional" + Me.LabelSeccional.Size = New System.Drawing.Size(68, 16) + Me.LabelSeccional.TabIndex = 119 + Me.LabelSeccional.Text = "Seccional" ' - 'seleccionado + 'ComboBoxSeccional ' - Me.seleccionado.HeaderText = "Seleccionado" - Me.seleccionado.Name = "seleccionado" - Me.seleccionado.ReadOnly = True + Me.ComboBoxSeccional.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.ComboBoxSeccional.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.ComboBoxSeccional.FormattingEnabled = True + Me.ComboBoxSeccional.Location = New System.Drawing.Point(133, 127) + Me.ComboBoxSeccional.Name = "ComboBoxSeccional" + Me.ComboBoxSeccional.Size = New System.Drawing.Size(160, 24) + Me.ComboBoxSeccional.TabIndex = 95 ' - 'nro_comprobante + 'DateTimePickerMesReintegro ' - Me.nro_comprobante.HeaderText = "Nro Comprobante" - Me.nro_comprobante.Name = "nro_comprobante" - Me.nro_comprobante.ReadOnly = True + Me.DateTimePickerMesReintegro.Checked = False + Me.DateTimePickerMesReintegro.CustomFormat = "MM/yyyy" + Me.DateTimePickerMesReintegro.Format = System.Windows.Forms.DateTimePickerFormat.Custom + Me.DateTimePickerMesReintegro.Location = New System.Drawing.Point(133, 99) + Me.DateTimePickerMesReintegro.Name = "DateTimePickerMesReintegro" + Me.DateTimePickerMesReintegro.ShowCheckBox = True + Me.DateTimePickerMesReintegro.ShowUpDown = True + Me.DateTimePickerMesReintegro.Size = New System.Drawing.Size(160, 22) + Me.DateTimePickerMesReintegro.TabIndex = 94 + Me.DateTimePickerMesReintegro.Value = New Date(2017, 3, 4, 19, 31, 9, 0) + ' + 'Label1 ' - 'tipo_comprobante_id + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(305, 16) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(49, 16) + Me.Label1.TabIndex = 116 + Me.Label1.Text = "Fecha:" ' - Me.tipo_comprobante_id.HeaderText = "tipo_comprobante_id" - Me.tipo_comprobante_id.Name = "tipo_comprobante_id" - Me.tipo_comprobante_id.ReadOnly = True - Me.tipo_comprobante_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.tipo_comprobante_id.Visible = False + 'DateTimePickerFecha ' - 'tipo_comprobante_nombre + Me.DateTimePickerFecha.CustomFormat = "" + Me.DateTimePickerFecha.Format = System.Windows.Forms.DateTimePickerFormat.[Short] + Me.DateTimePickerFecha.Location = New System.Drawing.Point(444, 13) + Me.DateTimePickerFecha.Name = "DateTimePickerFecha" + Me.DateTimePickerFecha.Size = New System.Drawing.Size(160, 22) + Me.DateTimePickerFecha.TabIndex = 96 + Me.DateTimePickerFecha.Value = New Date(2017, 3, 4, 19, 31, 9, 0) ' - Me.tipo_comprobante_nombre.HeaderText = "Tipo Comprobante" - Me.tipo_comprobante_nombre.Name = "tipo_comprobante_nombre" - Me.tipo_comprobante_nombre.ReadOnly = True + 'TextBoxNroComprobante ' - 'proveedor_id + Me.TextBoxNroComprobante.Location = New System.Drawing.Point(499, 71) + Me.TextBoxNroComprobante.Name = "TextBoxNroComprobante" + Me.TextBoxNroComprobante.Size = New System.Drawing.Size(105, 22) + Me.TextBoxNroComprobante.TabIndex = 99 ' - Me.proveedor_id.HeaderText = "proveedor_id" - Me.proveedor_id.Name = "proveedor_id" - Me.proveedor_id.ReadOnly = True - Me.proveedor_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.proveedor_id.Visible = False + 'ComboBoxTipoComprobante ' - 'proveedor_nombre + Me.ComboBoxTipoComprobante.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.ComboBoxTipoComprobante.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.ComboBoxTipoComprobante.FormattingEnabled = True + Me.ComboBoxTipoComprobante.Location = New System.Drawing.Point(444, 41) + Me.ComboBoxTipoComprobante.Name = "ComboBoxTipoComprobante" + Me.ComboBoxTipoComprobante.Size = New System.Drawing.Size(160, 24) + Me.ComboBoxTipoComprobante.TabIndex = 97 ' - Me.proveedor_nombre.HeaderText = "Proveedor" - Me.proveedor_nombre.Name = "proveedor_nombre" - Me.proveedor_nombre.ReadOnly = True + 'TextBoxPVenta ' - 'categoria_gasto_id + Me.TextBoxPVenta.Location = New System.Drawing.Point(444, 71) + Me.TextBoxPVenta.Name = "TextBoxPVenta" + Me.TextBoxPVenta.Size = New System.Drawing.Size(49, 22) + Me.TextBoxPVenta.TabIndex = 98 ' - Me.categoria_gasto_id.HeaderText = "categoria_gasto_id" - Me.categoria_gasto_id.Name = "categoria_gasto_id" - Me.categoria_gasto_id.ReadOnly = True - Me.categoria_gasto_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.categoria_gasto_id.Visible = False + 'Label4 ' - 'categoria_nombre + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(423, 102) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(15, 16) + Me.Label4.TabIndex = 114 + Me.Label4.Text = "$" ' - Me.categoria_nombre.HeaderText = "Categoria Gasto" - Me.categoria_nombre.Name = "categoria_nombre" - Me.categoria_nombre.ReadOnly = True + 'Label5 ' - 'persona_id + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(305, 44) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(140, 16) + Me.Label5.TabIndex = 113 + Me.Label5.Text = "Tipo de Comprobante" ' - Me.persona_id.HeaderText = "persona_id" - Me.persona_id.Name = "persona_id" - Me.persona_id.ReadOnly = True - Me.persona_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.persona_id.Visible = False + 'TextBoxMonto ' - 'persona_nombre + Me.TextBoxMonto.Location = New System.Drawing.Point(444, 99) + Me.TextBoxMonto.Name = "TextBoxMonto" + Me.TextBoxMonto.Size = New System.Drawing.Size(160, 22) + Me.TextBoxMonto.TabIndex = 100 + Me.TextBoxMonto.Tag = "" ' - Me.persona_nombre.HeaderText = "Persona" - Me.persona_nombre.Name = "persona_nombre" - Me.persona_nombre.ReadOnly = True + 'ComboBoxCategGasto ' - 'fecha + Me.ComboBoxCategGasto.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.ComboBoxCategGasto.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.ComboBoxCategGasto.FormattingEnabled = True + Me.ComboBoxCategGasto.Location = New System.Drawing.Point(133, 41) + Me.ComboBoxCategGasto.Name = "ComboBoxCategGasto" + Me.ComboBoxCategGasto.Size = New System.Drawing.Size(160, 24) + Me.ComboBoxCategGasto.TabIndex = 92 ' - Me.fecha.HeaderText = "Fecha" - Me.fecha.Name = "fecha" - Me.fecha.ReadOnly = True + 'ButtonGuardar ' - 'seccional_id + Me.ButtonGuardar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.ButtonGuardar.ForeColor = System.Drawing.Color.Green + Me.ButtonGuardar.Location = New System.Drawing.Point(449, 145) + Me.ButtonGuardar.Name = "ButtonGuardar" + Me.ButtonGuardar.Size = New System.Drawing.Size(150, 31) + Me.ButtonGuardar.TabIndex = 102 + Me.ButtonGuardar.Text = "Guardar" + Me.ButtonGuardar.UseVisualStyleBackColor = True ' - Me.seccional_id.HeaderText = "seccional_id" - Me.seccional_id.Name = "seccional_id" - Me.seccional_id.ReadOnly = True - Me.seccional_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.seccional_id.Visible = False + 'Label6 ' - 'seccional_nombre + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(13, 44) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(63, 16) + Me.Label6.TabIndex = 112 + Me.Label6.Text = "Gasto de" ' - Me.seccional_nombre.HeaderText = "Seccional" - Me.seccional_nombre.Name = "seccional_nombre" - Me.seccional_nombre.ReadOnly = True + 'TextBoxNombre ' - 'mes_reintegro + Me.TextBoxNombre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TextBoxNombre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.TextBoxNombre.BackColor = System.Drawing.SystemColors.Window + Me.TextBoxNombre.Location = New System.Drawing.Point(133, 13) + Me.TextBoxNombre.Name = "TextBoxNombre" + Me.TextBoxNombre.Size = New System.Drawing.Size(160, 22) + Me.TextBoxNombre.TabIndex = 91 ' - Me.mes_reintegro.HeaderText = "Mes Reintegro" - Me.mes_reintegro.Name = "mes_reintegro" - Me.mes_reintegro.ReadOnly = True + 'Label7 ' - 'monto + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(13, 101) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(115, 16) + Me.Label7.TabIndex = 111 + Me.Label7.Text = "Mes de Reintegro" ' - Me.monto.HeaderText = "Monto" - Me.monto.Name = "monto" - Me.monto.ReadOnly = True + 'Label8 ' - 'comentario + Me.Label8.AutoSize = True + Me.Label8.Location = New System.Drawing.Point(13, 161) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(77, 16) + Me.Label8.TabIndex = 110 + Me.Label8.Text = "Comentario" ' - Me.comentario.HeaderText = "Comentario" - Me.comentario.Name = "comentario" - Me.comentario.ReadOnly = True + 'Label9 ' - 'PapeleraId + Me.Label9.AutoSize = True + Me.Label9.Location = New System.Drawing.Point(305, 102) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(45, 16) + Me.Label9.TabIndex = 109 + Me.Label9.Text = "Monto" ' - Me.PapeleraId.HeaderText = "Id" - Me.PapeleraId.Name = "PapeleraId" - Me.PapeleraId.ReadOnly = True - Me.PapeleraId.Visible = False + 'Label10 ' - 'PapeleraSeleccionado + Me.Label10.AutoSize = True + Me.Label10.Location = New System.Drawing.Point(13, 74) + Me.Label10.Name = "Label10" + Me.Label10.Size = New System.Drawing.Size(72, 16) + Me.Label10.TabIndex = 108 + Me.Label10.Text = "Proveedor" ' - Me.PapeleraSeleccionado.HeaderText = "Seleccionado" - Me.PapeleraSeleccionado.Name = "PapeleraSeleccionado" - Me.PapeleraSeleccionado.ReadOnly = True + 'Label11 ' - 'PapeleraNroComprobante + Me.Label11.AutoSize = True + Me.Label11.Location = New System.Drawing.Point(13, 16) + Me.Label11.Name = "Label11" + Me.Label11.Size = New System.Drawing.Size(120, 16) + Me.Label11.TabIndex = 107 + Me.Label11.Text = "Nombre y Apellido" ' - Me.PapeleraNroComprobante.HeaderText = "Nro Comprobante" - Me.PapeleraNroComprobante.Name = "PapeleraNroComprobante" - Me.PapeleraNroComprobante.ReadOnly = True + 'Label12 ' - 'PapeleraTComprobanteId + Me.Label12.AutoSize = True + Me.Label12.Location = New System.Drawing.Point(305, 74) + Me.Label12.Name = "Label12" + Me.Label12.Size = New System.Drawing.Size(107, 16) + Me.Label12.TabIndex = 106 + Me.Label12.Text = "N° Comprobante" ' - Me.PapeleraTComprobanteId.HeaderText = "tipo_comprobante_id" - Me.PapeleraTComprobanteId.Name = "PapeleraTComprobanteId" - Me.PapeleraTComprobanteId.ReadOnly = True - Me.PapeleraTComprobanteId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraTComprobanteId.Visible = False + 'TextBoxComentario ' - 'PapeleraTipoComprobante + Me.TextBoxComentario.Location = New System.Drawing.Point(133, 157) + Me.TextBoxComentario.Multiline = True + Me.TextBoxComentario.Name = "TextBoxComentario" + Me.TextBoxComentario.Size = New System.Drawing.Size(300, 56) + Me.TextBoxComentario.TabIndex = 101 ' - Me.PapeleraTipoComprobante.HeaderText = "Tipo Comprobante" - Me.PapeleraTipoComprobante.Name = "PapeleraTipoComprobante" - Me.PapeleraTipoComprobante.ReadOnly = True + 'TextBoxProveedor ' - 'PapeleraProveedorId + Me.TextBoxProveedor.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TextBoxProveedor.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.TextBoxProveedor.Location = New System.Drawing.Point(133, 71) + Me.TextBoxProveedor.Name = "TextBoxProveedor" + Me.TextBoxProveedor.Size = New System.Drawing.Size(160, 22) + Me.TextBoxProveedor.TabIndex = 93 ' - Me.PapeleraProveedorId.HeaderText = "proveedor_id" - Me.PapeleraProveedorId.Name = "PapeleraProveedorId" - Me.PapeleraProveedorId.ReadOnly = True - Me.PapeleraProveedorId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraProveedorId.Visible = False + 'DGVModificar ' - 'PapeleraProveedor + Me.DGVModificar.AllowUserToAddRows = False + Me.DGVModificar.AllowUserToDeleteRows = False + Me.DGVModificar.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DGVModificar.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.id, Me.seleccionado, Me.nro_comprobante, Me.tipo_comprobante_id, Me.tipo_comprobante_nombre, Me.proveedor_id, Me.proveedor_nombre, Me.categoria_gasto_id, Me.categoria_nombre, Me.persona_id, Me.persona_nombre, Me.fecha, Me.seccional_id, Me.seccional_nombre, Me.mes_reintegro, Me.monto, Me.comentario}) + Me.DGVModificar.Dock = System.Windows.Forms.DockStyle.Fill + Me.DGVModificar.Location = New System.Drawing.Point(0, 0) + Me.DGVModificar.Name = "DGVModificar" + Me.DGVModificar.ReadOnly = True + Me.DGVModificar.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DGVModificar.Size = New System.Drawing.Size(614, 201) + Me.DGVModificar.TabIndex = 1 ' - Me.PapeleraProveedor.HeaderText = "Proveedor" - Me.PapeleraProveedor.Name = "PapeleraProveedor" - Me.PapeleraProveedor.ReadOnly = True + 'id ' - 'PapeleraCategoriaGastoId + Me.id.HeaderText = "Id" + Me.id.Name = "id" + Me.id.ReadOnly = True + Me.id.Visible = False ' - Me.PapeleraCategoriaGastoId.HeaderText = "categoria_gasto_id" - Me.PapeleraCategoriaGastoId.Name = "PapeleraCategoriaGastoId" - Me.PapeleraCategoriaGastoId.ReadOnly = True - Me.PapeleraCategoriaGastoId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraCategoriaGastoId.Visible = False + 'seleccionado ' - 'PapeleraCategoriaGasto + Me.seleccionado.HeaderText = "Seleccionado" + Me.seleccionado.Name = "seleccionado" + Me.seleccionado.ReadOnly = True ' - Me.PapeleraCategoriaGasto.HeaderText = "Categoria Gasto" - Me.PapeleraCategoriaGasto.Name = "PapeleraCategoriaGasto" - Me.PapeleraCategoriaGasto.ReadOnly = True + 'nro_comprobante ' - 'PapeleraPersonaId + Me.nro_comprobante.HeaderText = "Nro Comprobante" + Me.nro_comprobante.Name = "nro_comprobante" + Me.nro_comprobante.ReadOnly = True ' - Me.PapeleraPersonaId.HeaderText = "persona_id" - Me.PapeleraPersonaId.Name = "PapeleraPersonaId" - Me.PapeleraPersonaId.ReadOnly = True - Me.PapeleraPersonaId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraPersonaId.Visible = False + 'tipo_comprobante_id ' - 'PapeleraPersona + Me.tipo_comprobante_id.HeaderText = "tipo_comprobante_id" + Me.tipo_comprobante_id.Name = "tipo_comprobante_id" + Me.tipo_comprobante_id.ReadOnly = True + Me.tipo_comprobante_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.tipo_comprobante_id.Visible = False + ' + 'tipo_comprobante_nombre ' - Me.PapeleraPersona.HeaderText = "Persona" - Me.PapeleraPersona.Name = "PapeleraPersona" - Me.PapeleraPersona.ReadOnly = True + Me.tipo_comprobante_nombre.HeaderText = "Tipo Comprobante" + Me.tipo_comprobante_nombre.Name = "tipo_comprobante_nombre" + Me.tipo_comprobante_nombre.ReadOnly = True ' - 'PapeleraFecha + 'proveedor_id ' - Me.PapeleraFecha.HeaderText = "Fecha" - Me.PapeleraFecha.Name = "PapeleraFecha" - Me.PapeleraFecha.ReadOnly = True + Me.proveedor_id.HeaderText = "proveedor_id" + Me.proveedor_id.Name = "proveedor_id" + Me.proveedor_id.ReadOnly = True + Me.proveedor_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.proveedor_id.Visible = False ' - 'PapeleraSeccionalId + 'proveedor_nombre ' - Me.PapeleraSeccionalId.HeaderText = "seccional_id" - Me.PapeleraSeccionalId.Name = "PapeleraSeccionalId" - Me.PapeleraSeccionalId.ReadOnly = True - Me.PapeleraSeccionalId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraSeccionalId.Visible = False + Me.proveedor_nombre.HeaderText = "Proveedor" + Me.proveedor_nombre.Name = "proveedor_nombre" + Me.proveedor_nombre.ReadOnly = True ' - 'PapeleraSeccional + 'categoria_gasto_id ' - Me.PapeleraSeccional.HeaderText = "Seccional" - Me.PapeleraSeccional.Name = "PapeleraSeccional" - Me.PapeleraSeccional.ReadOnly = True + Me.categoria_gasto_id.HeaderText = "categoria_gasto_id" + Me.categoria_gasto_id.Name = "categoria_gasto_id" + Me.categoria_gasto_id.ReadOnly = True + Me.categoria_gasto_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.categoria_gasto_id.Visible = False ' - 'PapeleraReintegro + 'categoria_nombre ' - Me.PapeleraReintegro.HeaderText = "Mes Reintegro" - Me.PapeleraReintegro.Name = "PapeleraReintegro" - Me.PapeleraReintegro.ReadOnly = True + Me.categoria_nombre.HeaderText = "Categoria Gasto" + Me.categoria_nombre.Name = "categoria_nombre" + Me.categoria_nombre.ReadOnly = True ' - 'PapeleraMonto + 'persona_id ' - Me.PapeleraMonto.HeaderText = "Monto" - Me.PapeleraMonto.Name = "PapeleraMonto" - Me.PapeleraMonto.ReadOnly = True + Me.persona_id.HeaderText = "persona_id" + Me.persona_id.Name = "persona_id" + Me.persona_id.ReadOnly = True + Me.persona_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.persona_id.Visible = False ' - 'PapeleraComentario + 'persona_nombre ' - Me.PapeleraComentario.HeaderText = "Comentario" - Me.PapeleraComentario.Name = "PapeleraComentario" - Me.PapeleraComentario.ReadOnly = True + Me.persona_nombre.HeaderText = "Persona" + Me.persona_nombre.Name = "persona_nombre" + Me.persona_nombre.ReadOnly = True ' - 'TSComboBoxOpera1 + 'fecha ' - Me.TSComboBoxOpera1.FlatStyle = System.Windows.Forms.FlatStyle.Standard - Me.TSComboBoxOpera1.Items.AddRange(New Object() {"*", "="}) - Me.TSComboBoxOpera1.Margin = New System.Windows.Forms.Padding(3) - Me.TSComboBoxOpera1.Name = "TSComboBoxOpera1" - Me.TSComboBoxOpera1.Size = New System.Drawing.Size(75, 23) - Me.TSComboBoxOpera1.Text = "*" - Me.TSComboBoxOpera1.ToolTipText = "Elija entre buscar resultados apróximados o exactos" + Me.fecha.HeaderText = "Fecha" + Me.fecha.Name = "fecha" + Me.fecha.ReadOnly = True ' - 'TSComboBoxFiltro2 + 'seccional_id ' - Me.TSComboBoxFiltro2.FlatStyle = System.Windows.Forms.FlatStyle.Standard - Me.TSComboBoxFiltro2.Items.AddRange(New Object() {"Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario", "Seleccionado"}) - Me.TSComboBoxFiltro2.Margin = New System.Windows.Forms.Padding(3) - Me.TSComboBoxFiltro2.Name = "TSComboBoxFiltro2" - Me.TSComboBoxFiltro2.Size = New System.Drawing.Size(121, 23) - Me.TSComboBoxFiltro2.ToolTipText = "Seleccione columna por la cual desea filtrar" + Me.seccional_id.HeaderText = "seccional_id" + Me.seccional_id.Name = "seccional_id" + Me.seccional_id.ReadOnly = True + Me.seccional_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.seccional_id.Visible = False ' - 'TSComboBoxOpera2 + 'seccional_nombre ' - Me.TSComboBoxOpera2.FlatStyle = System.Windows.Forms.FlatStyle.Standard - Me.TSComboBoxOpera2.Items.AddRange(New Object() {"*", "="}) - Me.TSComboBoxOpera2.Margin = New System.Windows.Forms.Padding(3) - Me.TSComboBoxOpera2.Name = "TSComboBoxOpera2" - Me.TSComboBoxOpera2.Size = New System.Drawing.Size(75, 23) - Me.TSComboBoxOpera2.Text = "*" - Me.TSComboBoxOpera2.ToolTipText = "Elija entre buscar resultados apróximados o exactos" + Me.seccional_nombre.HeaderText = "Seccional" + Me.seccional_nombre.Name = "seccional_nombre" + Me.seccional_nombre.ReadOnly = True ' - 'TSTextBoxFiltro2 + 'mes_reintegro ' - Me.TSTextBoxFiltro2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.TSTextBoxFiltro2.Margin = New System.Windows.Forms.Padding(3) - Me.TSTextBoxFiltro2.Name = "TSTextBoxFiltro2" - Me.TSTextBoxFiltro2.Size = New System.Drawing.Size(100, 23) + Me.mes_reintegro.HeaderText = "Mes Reintegro" + Me.mes_reintegro.Name = "mes_reintegro" + Me.mes_reintegro.ReadOnly = True ' - 'TSLabelFiltro2 + 'monto ' - Me.TSLabelFiltro2.Margin = New System.Windows.Forms.Padding(3) - Me.TSLabelFiltro2.Name = "TSLabelFiltro2" - Me.TSLabelFiltro2.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) - Me.TSLabelFiltro2.Size = New System.Drawing.Size(93, 21) - Me.TSLabelFiltro2.Text = "Filtro Adicional: " + Me.monto.HeaderText = "Monto" + Me.monto.Name = "monto" + Me.monto.ReadOnly = True ' - 'TSButtonQuitarFiltros + 'comentario ' - Me.TSButtonQuitarFiltros.BackColor = System.Drawing.Color.LightBlue - Me.TSButtonQuitarFiltros.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text - Me.TSButtonQuitarFiltros.Image = CType(resources.GetObject("TSButtonQuitarFiltros.Image"), System.Drawing.Image) - Me.TSButtonQuitarFiltros.ImageTransparentColor = System.Drawing.Color.Magenta - Me.TSButtonQuitarFiltros.Margin = New System.Windows.Forms.Padding(3) - Me.TSButtonQuitarFiltros.Name = "TSButtonQuitarFiltros" - Me.TSButtonQuitarFiltros.Padding = New System.Windows.Forms.Padding(10, 2, 10, 2) - Me.TSButtonQuitarFiltros.Size = New System.Drawing.Size(99, 23) - Me.TSButtonQuitarFiltros.Text = "Quitar Filtros" + Me.comentario.HeaderText = "Comentario" + Me.comentario.Name = "comentario" + Me.comentario.ReadOnly = True ' 'ABMEgresos ' @@ -1208,18 +1206,6 @@ Partial Class ABMEgresos Me.TabPageAgregar.ResumeLayout(False) Me.TabPageAgregar.PerformLayout() Me.TabPageModificar.ResumeLayout(False) - Me.SplitContainerModificar.Panel1.ResumeLayout(False) - Me.SplitContainerModificar.Panel2.ResumeLayout(False) - Me.SplitContainerModificar.Panel2.PerformLayout() - CType(Me.SplitContainerModificar, System.ComponentModel.ISupportInitialize).EndInit() - Me.SplitContainerModificar.ResumeLayout(False) - Me.ToolStripContainerModificar.ContentPanel.ResumeLayout(False) - Me.ToolStripContainerModificar.TopToolStripPanel.ResumeLayout(False) - Me.ToolStripContainerModificar.ResumeLayout(False) - Me.ToolStripContainerModificar.PerformLayout() - CType(Me.DGVModificar, System.ComponentModel.ISupportInitialize).EndInit() - Me.ToolStripModificar.ResumeLayout(False) - Me.ToolStripModificar.PerformLayout() Me.TabPagePapelera.ResumeLayout(False) Me.SplitContainerPapelera.Panel1.ResumeLayout(False) Me.SplitContainerPapelera.Panel2.ResumeLayout(False) @@ -1229,6 +1215,19 @@ Partial Class ABMEgresos Me.ToolStripContainerPapelera.ResumeLayout(False) Me.ToolStripContainerPapelera.PerformLayout() CType(Me.DGVPapelera, System.ComponentModel.ISupportInitialize).EndInit() + Me.ToolStripContainerModificar.ContentPanel.ResumeLayout(False) + Me.ToolStripContainerModificar.RightToolStripPanel.ResumeLayout(False) + Me.ToolStripContainerModificar.RightToolStripPanel.PerformLayout() + Me.ToolStripContainerModificar.ResumeLayout(False) + Me.ToolStripContainerModificar.PerformLayout() + Me.ToolStripModificar.ResumeLayout(False) + Me.ToolStripModificar.PerformLayout() + Me.SplitContainerModificar.Panel1.ResumeLayout(False) + Me.SplitContainerModificar.Panel2.ResumeLayout(False) + Me.SplitContainerModificar.Panel2.PerformLayout() + CType(Me.SplitContainerModificar, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerModificar.ResumeLayout(False) + CType(Me.DGVModificar, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub @@ -1253,73 +1252,20 @@ Partial Class ABMEgresos Friend WithEvents tbComentario As TextBox Friend WithEvents tbProveedor As TextBox Friend WithEvents TabPageModificar As TabPage - Friend WithEvents SplitContainerModificar As SplitContainer - Friend WithEvents ToolStripContainerModificar As ToolStripContainer - Friend WithEvents DGVModificar As DataGridView - Friend WithEvents TextBoxNroComprobante As TextBox - Friend WithEvents ComboBoxTipoComprobante As ComboBox - Friend WithEvents TextBoxPVenta As TextBox - Friend WithEvents Label4 As Label - Friend WithEvents Label5 As Label - Friend WithEvents TextBoxMonto As TextBox - Friend WithEvents ComboBoxCategGasto As ComboBox - Friend WithEvents ButtonGuardar As Button - Friend WithEvents Label6 As Label - Friend WithEvents TextBoxNombre As TextBox - Friend WithEvents Label7 As Label - Friend WithEvents Label8 As Label - Friend WithEvents Label9 As Label - Friend WithEvents Label10 As Label - Friend WithEvents Label11 As Label - Friend WithEvents Label12 As Label - Friend WithEvents TextBoxComentario As TextBox - Friend WithEvents TextBoxProveedor As TextBox - Friend WithEvents DateTimePickerFecha As DateTimePicker - Friend WithEvents Label1 As Label - Friend WithEvents LabelSeccional As Label - Friend WithEvents ComboBoxSeccional As ComboBox - Friend WithEvents DateTimePickerMesReintegro As DateTimePicker Friend WithEvents lbSeccional As Label Friend WithEvents lbFecha As Label Friend WithEvents dtpFecha As DateTimePicker Friend WithEvents dtpReintegro As DateTimePicker - Friend WithEvents ButtonEliminar As Button Friend WithEvents TabPagePapelera As TabPage Friend WithEvents SplitContainerPapelera As SplitContainer Friend WithEvents ToolStripContainerPapelera As ToolStripContainer Friend WithEvents DGVPapelera As DataGridView Friend WithEvents bPapeleraRestaurar As Button - Friend WithEvents ToolStripModificar As ToolStrip - Friend WithEvents TSLabelTrimestre As ToolStripLabel - Friend WithEvents TSComboBoxTrimestre As ToolStripComboBox - Friend WithEvents TSLabelAño As ToolStripLabel - Friend WithEvents TSTextBoxAño As ToolStripTextBox - Friend WithEvents TSButtonFiltrar As ToolStripButton - Friend WithEvents TSLabelFiltro1 As ToolStripLabel - Friend WithEvents TSComboBoxFiltro1 As ToolStripComboBox - Friend WithEvents TSTextBoxFiltro1 As ToolStripTextBox Friend WithEvents bPapeleraVaciarPapelera As Button Friend WithEvents bPapeleraEliminar As Button Friend WithEvents cbTGasto As ComboBox Friend WithEvents cbSeccional As ComboBox Friend WithEvents cbTComprobante As ComboBox - Friend WithEvents id As DataGridViewTextBoxColumn - Friend WithEvents seleccionado As DataGridViewCheckBoxColumn - Friend WithEvents nro_comprobante As DataGridViewTextBoxColumn - Friend WithEvents tipo_comprobante_id As DataGridViewTextBoxColumn - Friend WithEvents tipo_comprobante_nombre As DataGridViewTextBoxColumn - Friend WithEvents proveedor_id As DataGridViewTextBoxColumn - Friend WithEvents proveedor_nombre As DataGridViewTextBoxColumn - Friend WithEvents categoria_gasto_id As DataGridViewTextBoxColumn - Friend WithEvents categoria_nombre As DataGridViewTextBoxColumn - Friend WithEvents persona_id As DataGridViewTextBoxColumn - Friend WithEvents persona_nombre As DataGridViewTextBoxColumn - Friend WithEvents fecha As DataGridViewTextBoxColumn - Friend WithEvents seccional_id As DataGridViewTextBoxColumn - Friend WithEvents seccional_nombre As DataGridViewTextBoxColumn - Friend WithEvents mes_reintegro As DataGridViewTextBoxColumn - Friend WithEvents monto As DataGridViewTextBoxColumn - Friend WithEvents comentario As DataGridViewTextBoxColumn Friend WithEvents PapeleraId As DataGridViewTextBoxColumn Friend WithEvents PapeleraSeleccionado As DataGridViewCheckBoxColumn Friend WithEvents PapeleraNroComprobante As DataGridViewTextBoxColumn @@ -1337,10 +1283,63 @@ Partial Class ABMEgresos Friend WithEvents PapeleraReintegro As DataGridViewTextBoxColumn Friend WithEvents PapeleraMonto As DataGridViewTextBoxColumn Friend WithEvents PapeleraComentario As DataGridViewTextBoxColumn + Friend WithEvents ToolStripContainerModificar As ToolStripContainer + Friend WithEvents SplitContainerModificar As SplitContainer + Friend WithEvents DGVModificar As DataGridView + Friend WithEvents id As DataGridViewTextBoxColumn + Friend WithEvents seleccionado As DataGridViewCheckBoxColumn + Friend WithEvents nro_comprobante As DataGridViewTextBoxColumn + Friend WithEvents tipo_comprobante_id As DataGridViewTextBoxColumn + Friend WithEvents tipo_comprobante_nombre As DataGridViewTextBoxColumn + Friend WithEvents proveedor_id As DataGridViewTextBoxColumn + Friend WithEvents proveedor_nombre As DataGridViewTextBoxColumn + Friend WithEvents categoria_gasto_id As DataGridViewTextBoxColumn + Friend WithEvents categoria_nombre As DataGridViewTextBoxColumn + Friend WithEvents persona_id As DataGridViewTextBoxColumn + Friend WithEvents persona_nombre As DataGridViewTextBoxColumn + Friend WithEvents fecha As DataGridViewTextBoxColumn + Friend WithEvents seccional_id As DataGridViewTextBoxColumn + Friend WithEvents seccional_nombre As DataGridViewTextBoxColumn + Friend WithEvents mes_reintegro As DataGridViewTextBoxColumn + Friend WithEvents monto As DataGridViewTextBoxColumn + Friend WithEvents comentario As DataGridViewTextBoxColumn + Friend WithEvents ButtonEliminar As Button + Friend WithEvents LabelSeccional As Label + Friend WithEvents ComboBoxSeccional As ComboBox + Friend WithEvents DateTimePickerMesReintegro As DateTimePicker + Friend WithEvents Label1 As Label + Friend WithEvents DateTimePickerFecha As DateTimePicker + Friend WithEvents TextBoxNroComprobante As TextBox + Friend WithEvents ComboBoxTipoComprobante As ComboBox + Friend WithEvents TextBoxPVenta As TextBox + Friend WithEvents Label4 As Label + Friend WithEvents Label5 As Label + Friend WithEvents TextBoxMonto As TextBox + Friend WithEvents ComboBoxCategGasto As ComboBox + Friend WithEvents ButtonGuardar As Button + Friend WithEvents Label6 As Label + Friend WithEvents TextBoxNombre As TextBox + Friend WithEvents Label7 As Label + Friend WithEvents Label8 As Label + Friend WithEvents Label9 As Label + Friend WithEvents Label10 As Label + Friend WithEvents Label11 As Label + Friend WithEvents Label12 As Label + Friend WithEvents TextBoxComentario As TextBox + Friend WithEvents TextBoxProveedor As TextBox + Friend WithEvents ToolStripModificar As ToolStrip + Friend WithEvents TSLabelTrimestre As ToolStripLabel + Friend WithEvents TSComboBoxTrimestre As ToolStripComboBox + Friend WithEvents TSLabelAño As ToolStripLabel + Friend WithEvents TSTextBoxAño As ToolStripTextBox + Friend WithEvents TSLabelFiltro1 As ToolStripLabel + Friend WithEvents TSComboBoxFiltro1 As ToolStripComboBox Friend WithEvents TSComboBoxOpera1 As ToolStripComboBox + Friend WithEvents TSTextBoxFiltro1 As ToolStripTextBox + Friend WithEvents TSLabelFiltro2 As ToolStripLabel Friend WithEvents TSComboBoxFiltro2 As ToolStripComboBox Friend WithEvents TSComboBoxOpera2 As ToolStripComboBox Friend WithEvents TSTextBoxFiltro2 As ToolStripTextBox - Friend WithEvents TSLabelFiltro2 As ToolStripLabel + Friend WithEvents TSButtonFiltrar As ToolStripButton Friend WithEvents TSButtonQuitarFiltros As ToolStripButton End Class diff --git a/SireCu/Paneles/ABMEgresos.resx b/SireCu/Paneles/ABMEgresos.resx index 3e9b8bd..27cf808 100644 --- a/SireCu/Paneles/ABMEgresos.resx +++ b/SireCu/Paneles/ABMEgresos.resx @@ -253,106 +253,106 @@ True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True \ No newline at end of file From 47c3dd49fafa036670856a22187ee64be1111d22 Mon Sep 17 00:00:00 2001 From: Mauricio Parra Casado Date: Thu, 18 May 2017 21:24:25 -0300 Subject: [PATCH 27/27] Cambios UI + Filtro por Mes --- SireCu/Paneles/ABMEgresos.Designer.vb | 1296 +++++++++++++------------ SireCu/Paneles/ABMEgresos.resx | 68 +- SireCu/Paneles/ABMEgresos.vb | 30 +- SireCu/Principal.Designer.vb | 2 +- 4 files changed, 729 insertions(+), 667 deletions(-) diff --git a/SireCu/Paneles/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb index 4ff1f5a..31c571f 100644 --- a/SireCu/Paneles/ABMEgresos.Designer.vb +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -25,6 +25,7 @@ Partial Class ABMEgresos Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ABMEgresos)) Me.TabControl = New System.Windows.Forms.TabControl() Me.TabPageAgregar = New System.Windows.Forms.TabPage() + Me.GroupBoxAgregar = New System.Windows.Forms.GroupBox() Me.cbTComprobante = New System.Windows.Forms.ComboBox() Me.cbSeccional = New System.Windows.Forms.ComboBox() Me.cbTGasto = New System.Windows.Forms.ComboBox() @@ -33,7 +34,6 @@ Partial Class ABMEgresos Me.dtpReintegro = New System.Windows.Forms.DateTimePicker() Me.lbSeccional = New System.Windows.Forms.Label() Me.tbNComprobante = New System.Windows.Forms.TextBox() - Me.lb_Titulo = New System.Windows.Forms.Label() Me.tbPVenta = New System.Windows.Forms.TextBox() Me.lbSmonto = New System.Windows.Forms.Label() Me.lbTComprobante = New System.Windows.Forms.Label() @@ -49,48 +49,28 @@ Partial Class ABMEgresos Me.lbNComprobante = New System.Windows.Forms.Label() Me.tbComentario = New System.Windows.Forms.TextBox() Me.tbProveedor = New System.Windows.Forms.TextBox() + Me.lb_Titulo = New System.Windows.Forms.Label() Me.TabPageModificar = New System.Windows.Forms.TabPage() - Me.TabPagePapelera = New System.Windows.Forms.TabPage() - Me.SplitContainerPapelera = New System.Windows.Forms.SplitContainer() - Me.ToolStripContainerPapelera = New System.Windows.Forms.ToolStripContainer() - Me.DGVPapelera = New System.Windows.Forms.DataGridView() - Me.PapeleraId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraSeleccionado = New System.Windows.Forms.DataGridViewCheckBoxColumn() - Me.PapeleraNroComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraTComprobanteId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraTipoComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraProveedorId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraProveedor = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraCategoriaGastoId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraCategoriaGasto = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraPersonaId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraPersona = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraFecha = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraSeccionalId = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraSeccional = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraReintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraMonto = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PapeleraComentario = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.bPapeleraEliminar = New System.Windows.Forms.Button() - Me.bPapeleraVaciarPapelera = New System.Windows.Forms.Button() - Me.bPapeleraRestaurar = New System.Windows.Forms.Button() Me.ToolStripContainerModificar = New System.Windows.Forms.ToolStripContainer() - Me.ToolStripModificar = New System.Windows.Forms.ToolStrip() - Me.TSLabelTrimestre = New System.Windows.Forms.ToolStripLabel() - Me.TSComboBoxTrimestre = New System.Windows.Forms.ToolStripComboBox() - Me.TSLabelAño = New System.Windows.Forms.ToolStripLabel() - Me.TSTextBoxAño = New System.Windows.Forms.ToolStripTextBox() - Me.TSLabelFiltro1 = New System.Windows.Forms.ToolStripLabel() - Me.TSComboBoxFiltro1 = New System.Windows.Forms.ToolStripComboBox() - Me.TSComboBoxOpera1 = New System.Windows.Forms.ToolStripComboBox() - Me.TSTextBoxFiltro1 = New System.Windows.Forms.ToolStripTextBox() - Me.TSLabelFiltro2 = New System.Windows.Forms.ToolStripLabel() - Me.TSComboBoxFiltro2 = New System.Windows.Forms.ToolStripComboBox() - Me.TSComboBoxOpera2 = New System.Windows.Forms.ToolStripComboBox() - Me.TSTextBoxFiltro2 = New System.Windows.Forms.ToolStripTextBox() - Me.TSButtonFiltrar = New System.Windows.Forms.ToolStripButton() - Me.TSButtonQuitarFiltros = New System.Windows.Forms.ToolStripButton() Me.SplitContainerModificar = New System.Windows.Forms.SplitContainer() + Me.DGVModificar = New System.Windows.Forms.DataGridView() + Me.id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.seleccionado = New System.Windows.Forms.DataGridViewCheckBoxColumn() + Me.nro_comprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.tipo_comprobante_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.tipo_comprobante_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.proveedor_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.proveedor_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.categoria_gasto_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.categoria_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.persona_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.persona_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.fecha = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.seccional_id = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.seccional_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.mes_reintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.monto = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.comentario = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.ButtonEliminar = New System.Windows.Forms.Button() Me.LabelSeccional = New System.Windows.Forms.Label() Me.ComboBoxSeccional = New System.Windows.Forms.ComboBox() @@ -115,44 +95,68 @@ Partial Class ABMEgresos Me.Label12 = New System.Windows.Forms.Label() Me.TextBoxComentario = New System.Windows.Forms.TextBox() Me.TextBoxProveedor = New System.Windows.Forms.TextBox() - Me.DGVModificar = New System.Windows.Forms.DataGridView() - Me.id = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.seleccionado = New System.Windows.Forms.DataGridViewCheckBoxColumn() - Me.nro_comprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.tipo_comprobante_id = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.tipo_comprobante_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.proveedor_id = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.proveedor_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.categoria_gasto_id = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.categoria_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.persona_id = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.persona_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.fecha = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.seccional_id = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.seccional_nombre = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.mes_reintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.monto = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.comentario = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.ToolStripModificar = New System.Windows.Forms.ToolStrip() + Me.TSLabelTrimestre = New System.Windows.Forms.ToolStripLabel() + Me.TSComboBoxTrimestre = New System.Windows.Forms.ToolStripComboBox() + Me.TSLabelAño = New System.Windows.Forms.ToolStripLabel() + Me.TSTextBoxAño = New System.Windows.Forms.ToolStripTextBox() + Me.TSLabelFiltro1 = New System.Windows.Forms.ToolStripLabel() + Me.TSComboBoxFiltro1 = New System.Windows.Forms.ToolStripComboBox() + Me.TSComboBoxOpera1 = New System.Windows.Forms.ToolStripComboBox() + Me.TSTextBoxFiltro1 = New System.Windows.Forms.ToolStripTextBox() + Me.TSLabelFiltro2 = New System.Windows.Forms.ToolStripLabel() + Me.TSComboBoxFiltro2 = New System.Windows.Forms.ToolStripComboBox() + Me.TSComboBoxOpera2 = New System.Windows.Forms.ToolStripComboBox() + Me.TSTextBoxFiltro2 = New System.Windows.Forms.ToolStripTextBox() + Me.TSButtonFiltrar = New System.Windows.Forms.ToolStripButton() + Me.TSButtonQuitarFiltros = New System.Windows.Forms.ToolStripButton() + Me.TabPagePapelera = New System.Windows.Forms.TabPage() + Me.SplitContainerPapelera = New System.Windows.Forms.SplitContainer() + Me.ToolStripContainerPapelera = New System.Windows.Forms.ToolStripContainer() + Me.DGVPapelera = New System.Windows.Forms.DataGridView() + Me.PapeleraId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraSeleccionado = New System.Windows.Forms.DataGridViewCheckBoxColumn() + Me.PapeleraNroComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraTComprobanteId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraTipoComprobante = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraProveedorId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraProveedor = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraCategoriaGastoId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraCategoriaGasto = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraPersonaId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraPersona = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraFecha = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraSeccionalId = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraSeccional = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraReintegro = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraMonto = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PapeleraComentario = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.bPapeleraEliminar = New System.Windows.Forms.Button() + Me.bPapeleraVaciarPapelera = New System.Windows.Forms.Button() + Me.bPapeleraRestaurar = New System.Windows.Forms.Button() + Me.TSLabelMes = New System.Windows.Forms.ToolStripLabel() + Me.TSComboBoxMes = New System.Windows.Forms.ToolStripComboBox() Me.TabControl.SuspendLayout() Me.TabPageAgregar.SuspendLayout() + Me.GroupBoxAgregar.SuspendLayout() Me.TabPageModificar.SuspendLayout() - Me.TabPagePapelera.SuspendLayout() - CType(Me.SplitContainerPapelera, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SplitContainerPapelera.Panel1.SuspendLayout() - Me.SplitContainerPapelera.Panel2.SuspendLayout() - Me.SplitContainerPapelera.SuspendLayout() - Me.ToolStripContainerPapelera.ContentPanel.SuspendLayout() - Me.ToolStripContainerPapelera.SuspendLayout() - CType(Me.DGVPapelera, System.ComponentModel.ISupportInitialize).BeginInit() Me.ToolStripContainerModificar.ContentPanel.SuspendLayout() Me.ToolStripContainerModificar.RightToolStripPanel.SuspendLayout() Me.ToolStripContainerModificar.SuspendLayout() - Me.ToolStripModificar.SuspendLayout() CType(Me.SplitContainerModificar, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainerModificar.Panel1.SuspendLayout() Me.SplitContainerModificar.Panel2.SuspendLayout() Me.SplitContainerModificar.SuspendLayout() CType(Me.DGVModificar, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ToolStripModificar.SuspendLayout() + Me.TabPagePapelera.SuspendLayout() + CType(Me.SplitContainerPapelera, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerPapelera.Panel1.SuspendLayout() + Me.SplitContainerPapelera.Panel2.SuspendLayout() + Me.SplitContainerPapelera.SuspendLayout() + Me.ToolStripContainerPapelera.ContentPanel.SuspendLayout() + Me.ToolStripContainerPapelera.SuspendLayout() + CType(Me.DGVPapelera, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'TabControl @@ -171,30 +175,8 @@ Partial Class ABMEgresos ' 'TabPageAgregar ' - Me.TabPageAgregar.Controls.Add(Me.cbTComprobante) - Me.TabPageAgregar.Controls.Add(Me.cbSeccional) - Me.TabPageAgregar.Controls.Add(Me.cbTGasto) - Me.TabPageAgregar.Controls.Add(Me.lbFecha) - Me.TabPageAgregar.Controls.Add(Me.dtpFecha) - Me.TabPageAgregar.Controls.Add(Me.dtpReintegro) - Me.TabPageAgregar.Controls.Add(Me.lbSeccional) - Me.TabPageAgregar.Controls.Add(Me.tbNComprobante) + Me.TabPageAgregar.Controls.Add(Me.GroupBoxAgregar) Me.TabPageAgregar.Controls.Add(Me.lb_Titulo) - Me.TabPageAgregar.Controls.Add(Me.tbPVenta) - Me.TabPageAgregar.Controls.Add(Me.lbSmonto) - Me.TabPageAgregar.Controls.Add(Me.lbTComprobante) - Me.TabPageAgregar.Controls.Add(Me.tbMonto) - Me.TabPageAgregar.Controls.Add(Me.btnGuardar) - Me.TabPageAgregar.Controls.Add(Me.lbGasto) - Me.TabPageAgregar.Controls.Add(Me.tbNombre) - Me.TabPageAgregar.Controls.Add(Me.lbMes) - Me.TabPageAgregar.Controls.Add(Me.lbComentario) - Me.TabPageAgregar.Controls.Add(Me.lbMonto) - Me.TabPageAgregar.Controls.Add(Me.lbProveedor) - Me.TabPageAgregar.Controls.Add(Me.lbNombre) - Me.TabPageAgregar.Controls.Add(Me.lbNComprobante) - Me.TabPageAgregar.Controls.Add(Me.tbComentario) - Me.TabPageAgregar.Controls.Add(Me.tbProveedor) Me.TabPageAgregar.Location = New System.Drawing.Point(4, 25) Me.TabPageAgregar.Name = "TabPageAgregar" Me.TabPageAgregar.Padding = New System.Windows.Forms.Padding(3) @@ -203,53 +185,85 @@ Partial Class ABMEgresos Me.TabPageAgregar.Text = "Agregar" Me.TabPageAgregar.UseVisualStyleBackColor = True ' + 'GroupBoxAgregar + ' + Me.GroupBoxAgregar.Controls.Add(Me.cbTComprobante) + Me.GroupBoxAgregar.Controls.Add(Me.cbSeccional) + Me.GroupBoxAgregar.Controls.Add(Me.cbTGasto) + Me.GroupBoxAgregar.Controls.Add(Me.lbFecha) + Me.GroupBoxAgregar.Controls.Add(Me.dtpFecha) + Me.GroupBoxAgregar.Controls.Add(Me.dtpReintegro) + Me.GroupBoxAgregar.Controls.Add(Me.lbSeccional) + Me.GroupBoxAgregar.Controls.Add(Me.tbNComprobante) + Me.GroupBoxAgregar.Controls.Add(Me.tbPVenta) + Me.GroupBoxAgregar.Controls.Add(Me.lbSmonto) + Me.GroupBoxAgregar.Controls.Add(Me.lbTComprobante) + Me.GroupBoxAgregar.Controls.Add(Me.tbMonto) + Me.GroupBoxAgregar.Controls.Add(Me.btnGuardar) + Me.GroupBoxAgregar.Controls.Add(Me.lbGasto) + Me.GroupBoxAgregar.Controls.Add(Me.tbNombre) + Me.GroupBoxAgregar.Controls.Add(Me.lbMes) + Me.GroupBoxAgregar.Controls.Add(Me.lbComentario) + Me.GroupBoxAgregar.Controls.Add(Me.lbMonto) + Me.GroupBoxAgregar.Controls.Add(Me.lbProveedor) + Me.GroupBoxAgregar.Controls.Add(Me.lbNombre) + Me.GroupBoxAgregar.Controls.Add(Me.lbNComprobante) + Me.GroupBoxAgregar.Controls.Add(Me.tbComentario) + Me.GroupBoxAgregar.Controls.Add(Me.tbProveedor) + Me.GroupBoxAgregar.Location = New System.Drawing.Point(6, 43) + Me.GroupBoxAgregar.Name = "GroupBoxAgregar" + Me.GroupBoxAgregar.Size = New System.Drawing.Size(735, 378) + Me.GroupBoxAgregar.TabIndex = 92 + Me.GroupBoxAgregar.TabStop = False + Me.GroupBoxAgregar.Text = "Agregar Nuevo Egreso" + ' 'cbTComprobante ' Me.cbTComprobante.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend Me.cbTComprobante.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource Me.cbTComprobante.FormattingEnabled = True - Me.cbTComprobante.Location = New System.Drawing.Point(537, 126) + Me.cbTComprobante.Location = New System.Drawing.Point(539, 84) Me.cbTComprobante.Name = "cbTComprobante" Me.cbTComprobante.Size = New System.Drawing.Size(163, 24) - Me.cbTComprobante.TabIndex = 9 + Me.cbTComprobante.TabIndex = 464 ' 'cbSeccional ' Me.cbSeccional.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend Me.cbSeccional.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource Me.cbSeccional.FormattingEnabled = True - Me.cbSeccional.Location = New System.Drawing.Point(151, 261) + Me.cbSeccional.Location = New System.Drawing.Point(153, 219) Me.cbSeccional.Name = "cbSeccional" Me.cbSeccional.Size = New System.Drawing.Size(156, 24) - Me.cbSeccional.TabIndex = 7 + Me.cbSeccional.TabIndex = 462 ' 'cbTGasto ' Me.cbTGasto.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend Me.cbTGasto.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource Me.cbTGasto.FormattingEnabled = True - Me.cbTGasto.Location = New System.Drawing.Point(151, 126) + Me.cbTGasto.Location = New System.Drawing.Point(153, 84) Me.cbTGasto.Name = "cbTGasto" Me.cbTGasto.Size = New System.Drawing.Size(156, 24) - Me.cbTGasto.TabIndex = 2 + Me.cbTGasto.TabIndex = 459 ' 'lbFecha ' Me.lbFecha.AutoSize = True - Me.lbFecha.Location = New System.Drawing.Point(391, 87) + Me.lbFecha.Location = New System.Drawing.Point(393, 45) Me.lbFecha.Name = "lbFecha" Me.lbFecha.Size = New System.Drawing.Size(49, 16) - Me.lbFecha.TabIndex = 457 + Me.lbFecha.TabIndex = 480 Me.lbFecha.Text = "Fecha:" ' 'dtpFecha ' Me.dtpFecha.CustomFormat = "" Me.dtpFecha.Format = System.Windows.Forms.DateTimePickerFormat.[Short] - Me.dtpFecha.Location = New System.Drawing.Point(537, 82) + Me.dtpFecha.Location = New System.Drawing.Point(539, 40) Me.dtpFecha.Name = "dtpFecha" Me.dtpFecha.Size = New System.Drawing.Size(163, 22) - Me.dtpFecha.TabIndex = 8 + Me.dtpFecha.TabIndex = 463 Me.dtpFecha.Value = New Date(2017, 3, 4, 19, 31, 9, 0) ' 'dtpReintegro @@ -257,91 +271,81 @@ Partial Class ABMEgresos Me.dtpReintegro.Checked = False Me.dtpReintegro.CustomFormat = "MM/yyyy" Me.dtpReintegro.Format = System.Windows.Forms.DateTimePickerFormat.Custom - Me.dtpReintegro.Location = New System.Drawing.Point(151, 213) + Me.dtpReintegro.Location = New System.Drawing.Point(153, 171) Me.dtpReintegro.Name = "dtpReintegro" Me.dtpReintegro.ShowCheckBox = True Me.dtpReintegro.ShowUpDown = True Me.dtpReintegro.Size = New System.Drawing.Size(156, 22) - Me.dtpReintegro.TabIndex = 6 + Me.dtpReintegro.TabIndex = 461 Me.dtpReintegro.Value = New Date(2017, 3, 4, 19, 31, 9, 0) ' 'lbSeccional ' Me.lbSeccional.AutoSize = True - Me.lbSeccional.Location = New System.Drawing.Point(32, 264) + Me.lbSeccional.Location = New System.Drawing.Point(34, 222) Me.lbSeccional.Name = "lbSeccional" Me.lbSeccional.Size = New System.Drawing.Size(68, 16) - Me.lbSeccional.TabIndex = 93 + Me.lbSeccional.TabIndex = 479 Me.lbSeccional.Text = "Seccional" ' 'tbNComprobante ' - Me.tbNComprobante.Location = New System.Drawing.Point(603, 171) + Me.tbNComprobante.Location = New System.Drawing.Point(605, 129) Me.tbNComprobante.Name = "tbNComprobante" Me.tbNComprobante.Size = New System.Drawing.Size(97, 22) - Me.tbNComprobante.TabIndex = 11 - ' - 'lb_Titulo - ' - Me.lb_Titulo.AutoSize = True - Me.lb_Titulo.Font = New System.Drawing.Font("Comic Sans MS", 20.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lb_Titulo.Location = New System.Drawing.Point(284, 2) - Me.lb_Titulo.Name = "lb_Titulo" - Me.lb_Titulo.Size = New System.Drawing.Size(193, 38) - Me.lb_Titulo.TabIndex = 91 - Me.lb_Titulo.Text = "Nuevo Egreso" + Me.tbNComprobante.TabIndex = 466 ' 'tbPVenta ' - Me.tbPVenta.Location = New System.Drawing.Point(537, 171) + Me.tbPVenta.Location = New System.Drawing.Point(539, 129) Me.tbPVenta.Name = "tbPVenta" Me.tbPVenta.Size = New System.Drawing.Size(56, 22) - Me.tbPVenta.TabIndex = 10 + Me.tbPVenta.TabIndex = 465 ' 'lbSmonto ' Me.lbSmonto.AutoSize = True - Me.lbSmonto.Location = New System.Drawing.Point(516, 218) + Me.lbSmonto.Location = New System.Drawing.Point(518, 176) Me.lbSmonto.Name = "lbSmonto" Me.lbSmonto.Size = New System.Drawing.Size(15, 16) - Me.lbSmonto.TabIndex = 86 + Me.lbSmonto.TabIndex = 478 Me.lbSmonto.Text = "$" ' 'lbTComprobante ' Me.lbTComprobante.AutoSize = True - Me.lbTComprobante.Location = New System.Drawing.Point(391, 129) + Me.lbTComprobante.Location = New System.Drawing.Point(393, 87) Me.lbTComprobante.Name = "lbTComprobante" Me.lbTComprobante.Size = New System.Drawing.Size(140, 16) - Me.lbTComprobante.TabIndex = 85 + Me.lbTComprobante.TabIndex = 477 Me.lbTComprobante.Text = "Tipo de Comprobante" ' 'tbMonto ' - Me.tbMonto.Location = New System.Drawing.Point(537, 215) + Me.tbMonto.Location = New System.Drawing.Point(539, 173) Me.tbMonto.Name = "tbMonto" Me.tbMonto.Size = New System.Drawing.Size(163, 22) - Me.tbMonto.TabIndex = 12 + Me.tbMonto.TabIndex = 467 Me.tbMonto.Tag = "" ' 'btnGuardar ' Me.btnGuardar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnGuardar.ForeColor = System.Drawing.Color.Green - Me.btnGuardar.Location = New System.Drawing.Point(551, 320) + Me.btnGuardar.Location = New System.Drawing.Point(553, 278) Me.btnGuardar.Name = "btnGuardar" Me.btnGuardar.Size = New System.Drawing.Size(126, 61) - Me.btnGuardar.TabIndex = 14 + Me.btnGuardar.TabIndex = 469 Me.btnGuardar.Text = "Guardar" Me.btnGuardar.UseVisualStyleBackColor = True ' 'lbGasto ' Me.lbGasto.AutoSize = True - Me.lbGasto.Location = New System.Drawing.Point(28, 129) + Me.lbGasto.Location = New System.Drawing.Point(30, 87) Me.lbGasto.Name = "lbGasto" Me.lbGasto.Size = New System.Drawing.Size(63, 16) - Me.lbGasto.TabIndex = 84 + Me.lbGasto.TabIndex = 476 Me.lbGasto.Text = "Gasto de" ' 'tbNombre @@ -349,81 +353,91 @@ Partial Class ABMEgresos Me.tbNombre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend Me.tbNombre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource Me.tbNombre.BackColor = System.Drawing.SystemColors.Window - Me.tbNombre.Location = New System.Drawing.Point(151, 82) + Me.tbNombre.Location = New System.Drawing.Point(153, 40) Me.tbNombre.Name = "tbNombre" Me.tbNombre.Size = New System.Drawing.Size(197, 22) - Me.tbNombre.TabIndex = 1 + Me.tbNombre.TabIndex = 458 ' 'lbMes ' Me.lbMes.AutoSize = True - Me.lbMes.Location = New System.Drawing.Point(28, 218) + Me.lbMes.Location = New System.Drawing.Point(30, 176) Me.lbMes.Name = "lbMes" Me.lbMes.Size = New System.Drawing.Size(115, 16) - Me.lbMes.TabIndex = 83 + Me.lbMes.TabIndex = 475 Me.lbMes.Text = "Mes de Reintegro" ' 'lbComentario ' Me.lbComentario.AutoSize = True - Me.lbComentario.Location = New System.Drawing.Point(28, 311) + Me.lbComentario.Location = New System.Drawing.Point(30, 269) Me.lbComentario.Name = "lbComentario" Me.lbComentario.Size = New System.Drawing.Size(77, 16) - Me.lbComentario.TabIndex = 82 + Me.lbComentario.TabIndex = 474 Me.lbComentario.Text = "Comentario" ' 'lbMonto ' Me.lbMonto.AutoSize = True - Me.lbMonto.Location = New System.Drawing.Point(391, 218) + Me.lbMonto.Location = New System.Drawing.Point(393, 176) Me.lbMonto.Name = "lbMonto" Me.lbMonto.Size = New System.Drawing.Size(45, 16) - Me.lbMonto.TabIndex = 80 + Me.lbMonto.TabIndex = 473 Me.lbMonto.Text = "Monto" ' 'lbProveedor ' Me.lbProveedor.AutoSize = True - Me.lbProveedor.Location = New System.Drawing.Point(28, 174) + Me.lbProveedor.Location = New System.Drawing.Point(30, 132) Me.lbProveedor.Name = "lbProveedor" Me.lbProveedor.Size = New System.Drawing.Size(72, 16) - Me.lbProveedor.TabIndex = 79 + Me.lbProveedor.TabIndex = 472 Me.lbProveedor.Text = "Proveedor" ' 'lbNombre ' Me.lbNombre.AutoSize = True - Me.lbNombre.Location = New System.Drawing.Point(28, 85) + Me.lbNombre.Location = New System.Drawing.Point(30, 43) Me.lbNombre.Name = "lbNombre" Me.lbNombre.Size = New System.Drawing.Size(120, 16) - Me.lbNombre.TabIndex = 78 + Me.lbNombre.TabIndex = 471 Me.lbNombre.Text = "Nombre y Apellido" ' 'lbNComprobante ' Me.lbNComprobante.AutoSize = True - Me.lbNComprobante.Location = New System.Drawing.Point(391, 174) + Me.lbNComprobante.Location = New System.Drawing.Point(393, 132) Me.lbNComprobante.Name = "lbNComprobante" Me.lbNComprobante.Size = New System.Drawing.Size(107, 16) - Me.lbNComprobante.TabIndex = 77 + Me.lbNComprobante.TabIndex = 470 Me.lbNComprobante.Text = "N° Comprobante" ' 'tbComentario ' - Me.tbComentario.Location = New System.Drawing.Point(111, 308) + Me.tbComentario.Location = New System.Drawing.Point(113, 266) Me.tbComentario.Multiline = True Me.tbComentario.Name = "tbComentario" Me.tbComentario.Size = New System.Drawing.Size(387, 100) - Me.tbComentario.TabIndex = 13 + Me.tbComentario.TabIndex = 468 ' 'tbProveedor ' Me.tbProveedor.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend Me.tbProveedor.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.tbProveedor.Location = New System.Drawing.Point(151, 171) + Me.tbProveedor.Location = New System.Drawing.Point(153, 129) Me.tbProveedor.Name = "tbProveedor" Me.tbProveedor.Size = New System.Drawing.Size(156, 22) - Me.tbProveedor.TabIndex = 5 + Me.tbProveedor.TabIndex = 460 + ' + 'lb_Titulo + ' + Me.lb_Titulo.AutoSize = True + Me.lb_Titulo.Font = New System.Drawing.Font("Comic Sans MS", 20.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lb_Titulo.Location = New System.Drawing.Point(284, 2) + Me.lb_Titulo.Name = "lb_Titulo" + Me.lb_Titulo.Size = New System.Drawing.Size(193, 38) + Me.lb_Titulo.TabIndex = 91 + Me.lb_Titulo.Text = "Nuevo Egreso" ' 'TabPageModificar ' @@ -436,413 +450,194 @@ Partial Class ABMEgresos Me.TabPageModificar.Text = "Modificar" Me.TabPageModificar.UseVisualStyleBackColor = True ' - 'TabPagePapelera - ' - Me.TabPagePapelera.Controls.Add(Me.SplitContainerPapelera) - Me.TabPagePapelera.Location = New System.Drawing.Point(4, 25) - Me.TabPagePapelera.Name = "TabPagePapelera" - Me.TabPagePapelera.Padding = New System.Windows.Forms.Padding(3) - Me.TabPagePapelera.Size = New System.Drawing.Size(747, 427) - Me.TabPagePapelera.TabIndex = 2 - Me.TabPagePapelera.Text = "Papelera" - Me.TabPagePapelera.UseVisualStyleBackColor = True - ' - 'SplitContainerPapelera + 'ToolStripContainerModificar ' - Me.SplitContainerPapelera.Dock = System.Windows.Forms.DockStyle.Fill - Me.SplitContainerPapelera.Location = New System.Drawing.Point(3, 3) - Me.SplitContainerPapelera.Name = "SplitContainerPapelera" - Me.SplitContainerPapelera.Orientation = System.Windows.Forms.Orientation.Horizontal + Me.ToolStripContainerModificar.BottomToolStripPanelVisible = False ' - 'SplitContainerPapelera.Panel1 + 'ToolStripContainerModificar.ContentPanel ' - Me.SplitContainerPapelera.Panel1.Controls.Add(Me.ToolStripContainerPapelera) + Me.ToolStripContainerModificar.ContentPanel.Controls.Add(Me.SplitContainerModificar) + Me.ToolStripContainerModificar.ContentPanel.Size = New System.Drawing.Size(593, 421) + Me.ToolStripContainerModificar.Dock = System.Windows.Forms.DockStyle.Fill + Me.ToolStripContainerModificar.LeftToolStripPanelVisible = False + Me.ToolStripContainerModificar.Location = New System.Drawing.Point(3, 3) + Me.ToolStripContainerModificar.Name = "ToolStripContainerModificar" ' - 'SplitContainerPapelera.Panel2 + 'ToolStripContainerModificar.RightToolStripPanel ' - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraEliminar) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraVaciarPapelera) - Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraRestaurar) - Me.SplitContainerPapelera.Size = New System.Drawing.Size(741, 421) - Me.SplitContainerPapelera.SplitterDistance = 350 - Me.SplitContainerPapelera.TabIndex = 1 + Me.ToolStripContainerModificar.RightToolStripPanel.Controls.Add(Me.ToolStripModificar) + Me.ToolStripContainerModificar.Size = New System.Drawing.Size(741, 421) + Me.ToolStripContainerModificar.TabIndex = 1 + Me.ToolStripContainerModificar.Text = "ToolStripContainer1" + Me.ToolStripContainerModificar.TopToolStripPanelVisible = False ' - 'ToolStripContainerPapelera + 'SplitContainerModificar ' + Me.SplitContainerModificar.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainerModificar.Location = New System.Drawing.Point(0, 0) + Me.SplitContainerModificar.Name = "SplitContainerModificar" + Me.SplitContainerModificar.Orientation = System.Windows.Forms.Orientation.Horizontal ' - 'ToolStripContainerPapelera.ContentPanel + 'SplitContainerModificar.Panel1 ' - Me.ToolStripContainerPapelera.ContentPanel.Controls.Add(Me.DGVPapelera) - Me.ToolStripContainerPapelera.ContentPanel.Size = New System.Drawing.Size(741, 325) - Me.ToolStripContainerPapelera.Dock = System.Windows.Forms.DockStyle.Fill - Me.ToolStripContainerPapelera.Location = New System.Drawing.Point(0, 0) - Me.ToolStripContainerPapelera.Name = "ToolStripContainerPapelera" - Me.ToolStripContainerPapelera.Size = New System.Drawing.Size(741, 350) - Me.ToolStripContainerPapelera.TabIndex = 0 - Me.ToolStripContainerPapelera.Text = "ToolStripContainer1" + Me.SplitContainerModificar.Panel1.Controls.Add(Me.DGVModificar) ' - 'DGVPapelera + 'SplitContainerModificar.Panel2 ' - Me.DGVPapelera.AllowUserToAddRows = False - Me.DGVPapelera.AllowUserToDeleteRows = False - Me.DGVPapelera.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DGVPapelera.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.PapeleraId, Me.PapeleraSeleccionado, Me.PapeleraNroComprobante, Me.PapeleraTComprobanteId, Me.PapeleraTipoComprobante, Me.PapeleraProveedorId, Me.PapeleraProveedor, Me.PapeleraCategoriaGastoId, Me.PapeleraCategoriaGasto, Me.PapeleraPersonaId, Me.PapeleraPersona, Me.PapeleraFecha, Me.PapeleraSeccionalId, Me.PapeleraSeccional, Me.PapeleraReintegro, Me.PapeleraMonto, Me.PapeleraComentario}) - Me.DGVPapelera.Dock = System.Windows.Forms.DockStyle.Fill - Me.DGVPapelera.Location = New System.Drawing.Point(0, 0) - Me.DGVPapelera.Name = "DGVPapelera" - Me.DGVPapelera.ReadOnly = True - Me.DGVPapelera.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DGVPapelera.Size = New System.Drawing.Size(741, 325) - Me.DGVPapelera.TabIndex = 0 + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ButtonEliminar) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.LabelSeccional) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxSeccional) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.DateTimePickerMesReintegro) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label1) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.DateTimePickerFecha) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxNroComprobante) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxTipoComprobante) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxPVenta) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label4) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label5) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxMonto) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxCategGasto) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.ButtonGuardar) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label6) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxNombre) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label7) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label8) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label9) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label10) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label11) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label12) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxComentario) + Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxProveedor) + Me.SplitContainerModificar.Size = New System.Drawing.Size(593, 421) + Me.SplitContainerModificar.SplitterDistance = 201 + Me.SplitContainerModificar.TabIndex = 1 ' - 'PapeleraId + 'DGVModificar ' - Me.PapeleraId.HeaderText = "Id" - Me.PapeleraId.Name = "PapeleraId" - Me.PapeleraId.ReadOnly = True - Me.PapeleraId.Visible = False - ' - 'PapeleraSeleccionado - ' - Me.PapeleraSeleccionado.HeaderText = "Seleccionado" - Me.PapeleraSeleccionado.Name = "PapeleraSeleccionado" - Me.PapeleraSeleccionado.ReadOnly = True - ' - 'PapeleraNroComprobante - ' - Me.PapeleraNroComprobante.HeaderText = "Nro Comprobante" - Me.PapeleraNroComprobante.Name = "PapeleraNroComprobante" - Me.PapeleraNroComprobante.ReadOnly = True - ' - 'PapeleraTComprobanteId - ' - Me.PapeleraTComprobanteId.HeaderText = "tipo_comprobante_id" - Me.PapeleraTComprobanteId.Name = "PapeleraTComprobanteId" - Me.PapeleraTComprobanteId.ReadOnly = True - Me.PapeleraTComprobanteId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraTComprobanteId.Visible = False - ' - 'PapeleraTipoComprobante - ' - Me.PapeleraTipoComprobante.HeaderText = "Tipo Comprobante" - Me.PapeleraTipoComprobante.Name = "PapeleraTipoComprobante" - Me.PapeleraTipoComprobante.ReadOnly = True - ' - 'PapeleraProveedorId - ' - Me.PapeleraProveedorId.HeaderText = "proveedor_id" - Me.PapeleraProveedorId.Name = "PapeleraProveedorId" - Me.PapeleraProveedorId.ReadOnly = True - Me.PapeleraProveedorId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraProveedorId.Visible = False - ' - 'PapeleraProveedor - ' - Me.PapeleraProveedor.HeaderText = "Proveedor" - Me.PapeleraProveedor.Name = "PapeleraProveedor" - Me.PapeleraProveedor.ReadOnly = True - ' - 'PapeleraCategoriaGastoId - ' - Me.PapeleraCategoriaGastoId.HeaderText = "categoria_gasto_id" - Me.PapeleraCategoriaGastoId.Name = "PapeleraCategoriaGastoId" - Me.PapeleraCategoriaGastoId.ReadOnly = True - Me.PapeleraCategoriaGastoId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraCategoriaGastoId.Visible = False - ' - 'PapeleraCategoriaGasto - ' - Me.PapeleraCategoriaGasto.HeaderText = "Categoria Gasto" - Me.PapeleraCategoriaGasto.Name = "PapeleraCategoriaGasto" - Me.PapeleraCategoriaGasto.ReadOnly = True - ' - 'PapeleraPersonaId - ' - Me.PapeleraPersonaId.HeaderText = "persona_id" - Me.PapeleraPersonaId.Name = "PapeleraPersonaId" - Me.PapeleraPersonaId.ReadOnly = True - Me.PapeleraPersonaId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraPersonaId.Visible = False - ' - 'PapeleraPersona - ' - Me.PapeleraPersona.HeaderText = "Persona" - Me.PapeleraPersona.Name = "PapeleraPersona" - Me.PapeleraPersona.ReadOnly = True - ' - 'PapeleraFecha - ' - Me.PapeleraFecha.HeaderText = "Fecha" - Me.PapeleraFecha.Name = "PapeleraFecha" - Me.PapeleraFecha.ReadOnly = True - ' - 'PapeleraSeccionalId - ' - Me.PapeleraSeccionalId.HeaderText = "seccional_id" - Me.PapeleraSeccionalId.Name = "PapeleraSeccionalId" - Me.PapeleraSeccionalId.ReadOnly = True - Me.PapeleraSeccionalId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.PapeleraSeccionalId.Visible = False - ' - 'PapeleraSeccional - ' - Me.PapeleraSeccional.HeaderText = "Seccional" - Me.PapeleraSeccional.Name = "PapeleraSeccional" - Me.PapeleraSeccional.ReadOnly = True - ' - 'PapeleraReintegro - ' - Me.PapeleraReintegro.HeaderText = "Mes Reintegro" - Me.PapeleraReintegro.Name = "PapeleraReintegro" - Me.PapeleraReintegro.ReadOnly = True - ' - 'PapeleraMonto - ' - Me.PapeleraMonto.HeaderText = "Monto" - Me.PapeleraMonto.Name = "PapeleraMonto" - Me.PapeleraMonto.ReadOnly = True - ' - 'PapeleraComentario - ' - Me.PapeleraComentario.HeaderText = "Comentario" - Me.PapeleraComentario.Name = "PapeleraComentario" - Me.PapeleraComentario.ReadOnly = True - ' - 'bPapeleraEliminar - ' - Me.bPapeleraEliminar.Enabled = False - Me.bPapeleraEliminar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.bPapeleraEliminar.ForeColor = System.Drawing.Color.Red - Me.bPapeleraEliminar.Location = New System.Drawing.Point(289, 5) - Me.bPapeleraEliminar.Name = "bPapeleraEliminar" - Me.bPapeleraEliminar.Size = New System.Drawing.Size(163, 56) - Me.bPapeleraEliminar.TabIndex = 105 - Me.bPapeleraEliminar.Text = "Eliminar Permanetemente" - Me.bPapeleraEliminar.UseVisualStyleBackColor = True - ' - 'bPapeleraVaciarPapelera - ' - Me.bPapeleraVaciarPapelera.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.bPapeleraVaciarPapelera.ForeColor = System.Drawing.Color.Red - Me.bPapeleraVaciarPapelera.Location = New System.Drawing.Point(486, 5) - Me.bPapeleraVaciarPapelera.Name = "bPapeleraVaciarPapelera" - Me.bPapeleraVaciarPapelera.Size = New System.Drawing.Size(163, 56) - Me.bPapeleraVaciarPapelera.TabIndex = 104 - Me.bPapeleraVaciarPapelera.Text = "Vaciar Papelera" - Me.bPapeleraVaciarPapelera.UseVisualStyleBackColor = True - ' - 'bPapeleraRestaurar - ' - Me.bPapeleraRestaurar.Enabled = False - Me.bPapeleraRestaurar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.bPapeleraRestaurar.ForeColor = System.Drawing.Color.Red - Me.bPapeleraRestaurar.Location = New System.Drawing.Point(91, 5) - Me.bPapeleraRestaurar.Name = "bPapeleraRestaurar" - Me.bPapeleraRestaurar.Size = New System.Drawing.Size(163, 56) - Me.bPapeleraRestaurar.TabIndex = 103 - Me.bPapeleraRestaurar.Text = "Restaurar" - Me.bPapeleraRestaurar.UseVisualStyleBackColor = True - ' - 'ToolStripContainerModificar - ' - Me.ToolStripContainerModificar.BottomToolStripPanelVisible = False - ' - 'ToolStripContainerModificar.ContentPanel - ' - Me.ToolStripContainerModificar.ContentPanel.Controls.Add(Me.SplitContainerModificar) - Me.ToolStripContainerModificar.ContentPanel.Size = New System.Drawing.Size(614, 421) - Me.ToolStripContainerModificar.Dock = System.Windows.Forms.DockStyle.Fill - Me.ToolStripContainerModificar.LeftToolStripPanelVisible = False - Me.ToolStripContainerModificar.Location = New System.Drawing.Point(3, 3) - Me.ToolStripContainerModificar.Name = "ToolStripContainerModificar" - ' - 'ToolStripContainerModificar.RightToolStripPanel - ' - Me.ToolStripContainerModificar.RightToolStripPanel.Controls.Add(Me.ToolStripModificar) - Me.ToolStripContainerModificar.Size = New System.Drawing.Size(741, 421) - Me.ToolStripContainerModificar.TabIndex = 1 - Me.ToolStripContainerModificar.Text = "ToolStripContainer1" - Me.ToolStripContainerModificar.TopToolStripPanelVisible = False - ' - 'ToolStripModificar - ' - Me.ToolStripModificar.Dock = System.Windows.Forms.DockStyle.Fill - Me.ToolStripModificar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStripModificar.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TSLabelTrimestre, Me.TSComboBoxTrimestre, Me.TSLabelAño, Me.TSTextBoxAño, Me.TSLabelFiltro1, Me.TSComboBoxFiltro1, Me.TSComboBoxOpera1, Me.TSTextBoxFiltro1, Me.TSLabelFiltro2, Me.TSComboBoxFiltro2, Me.TSComboBoxOpera2, Me.TSTextBoxFiltro2, Me.TSButtonFiltrar, Me.TSButtonQuitarFiltros}) - Me.ToolStripModificar.Location = New System.Drawing.Point(0, 3) - Me.ToolStripModificar.Name = "ToolStripModificar" - Me.ToolStripModificar.Padding = New System.Windows.Forms.Padding(0) - Me.ToolStripModificar.Size = New System.Drawing.Size(127, 400) - Me.ToolStripModificar.TabIndex = 0 + Me.DGVModificar.AllowUserToAddRows = False + Me.DGVModificar.AllowUserToDeleteRows = False + Me.DGVModificar.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DGVModificar.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.id, Me.seleccionado, Me.nro_comprobante, Me.tipo_comprobante_id, Me.tipo_comprobante_nombre, Me.proveedor_id, Me.proveedor_nombre, Me.categoria_gasto_id, Me.categoria_nombre, Me.persona_id, Me.persona_nombre, Me.fecha, Me.seccional_id, Me.seccional_nombre, Me.mes_reintegro, Me.monto, Me.comentario}) + Me.DGVModificar.Dock = System.Windows.Forms.DockStyle.Fill + Me.DGVModificar.Location = New System.Drawing.Point(0, 0) + Me.DGVModificar.Name = "DGVModificar" + Me.DGVModificar.ReadOnly = True + Me.DGVModificar.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DGVModificar.Size = New System.Drawing.Size(593, 201) + Me.DGVModificar.TabIndex = 1 ' - 'TSLabelTrimestre + 'id ' - Me.TSLabelTrimestre.Margin = New System.Windows.Forms.Padding(3) - Me.TSLabelTrimestre.Name = "TSLabelTrimestre" - Me.TSLabelTrimestre.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) - Me.TSLabelTrimestre.Size = New System.Drawing.Size(143, 21) - Me.TSLabelTrimestre.Text = "Trimestre: " + Me.id.HeaderText = "Id" + Me.id.Name = "id" + Me.id.ReadOnly = True + Me.id.Visible = False ' - 'TSComboBoxTrimestre + 'seleccionado ' - Me.TSComboBoxTrimestre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.TSComboBoxTrimestre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems - Me.TSComboBoxTrimestre.FlatStyle = System.Windows.Forms.FlatStyle.Standard - Me.TSComboBoxTrimestre.Items.AddRange(New Object() {"Primero", "Segundo", "Tercero", "Cuarto"}) - Me.TSComboBoxTrimestre.Margin = New System.Windows.Forms.Padding(3) - Me.TSComboBoxTrimestre.Name = "TSComboBoxTrimestre" - Me.TSComboBoxTrimestre.Size = New System.Drawing.Size(143, 23) + Me.seleccionado.HeaderText = "Seleccionado" + Me.seleccionado.Name = "seleccionado" + Me.seleccionado.ReadOnly = True ' - 'TSLabelAño + 'nro_comprobante ' - Me.TSLabelAño.Margin = New System.Windows.Forms.Padding(3) - Me.TSLabelAño.Name = "TSLabelAño" - Me.TSLabelAño.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) - Me.TSLabelAño.Size = New System.Drawing.Size(143, 21) - Me.TSLabelAño.Text = "Año: " + Me.nro_comprobante.HeaderText = "Nro Comprobante" + Me.nro_comprobante.Name = "nro_comprobante" + Me.nro_comprobante.ReadOnly = True ' - 'TSTextBoxAño + 'tipo_comprobante_id ' - Me.TSTextBoxAño.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.TSTextBoxAño.Margin = New System.Windows.Forms.Padding(3) - Me.TSTextBoxAño.Name = "TSTextBoxAño" - Me.TSTextBoxAño.Size = New System.Drawing.Size(143, 23) + Me.tipo_comprobante_id.HeaderText = "tipo_comprobante_id" + Me.tipo_comprobante_id.Name = "tipo_comprobante_id" + Me.tipo_comprobante_id.ReadOnly = True + Me.tipo_comprobante_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.tipo_comprobante_id.Visible = False ' - 'TSLabelFiltro1 + 'tipo_comprobante_nombre ' - Me.TSLabelFiltro1.Margin = New System.Windows.Forms.Padding(3) - Me.TSLabelFiltro1.Name = "TSLabelFiltro1" - Me.TSLabelFiltro1.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) - Me.TSLabelFiltro1.Size = New System.Drawing.Size(143, 21) - Me.TSLabelFiltro1.Text = "Filtrar Por:" + Me.tipo_comprobante_nombre.HeaderText = "Tipo Comprobante" + Me.tipo_comprobante_nombre.Name = "tipo_comprobante_nombre" + Me.tipo_comprobante_nombre.ReadOnly = True ' - 'TSComboBoxFiltro1 + 'proveedor_id ' - Me.TSComboBoxFiltro1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.TSComboBoxFiltro1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems - Me.TSComboBoxFiltro1.FlatStyle = System.Windows.Forms.FlatStyle.Standard - Me.TSComboBoxFiltro1.Items.AddRange(New Object() {"Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario", "Seleccionado"}) - Me.TSComboBoxFiltro1.Margin = New System.Windows.Forms.Padding(3) - Me.TSComboBoxFiltro1.Name = "TSComboBoxFiltro1" - Me.TSComboBoxFiltro1.Size = New System.Drawing.Size(143, 23) - Me.TSComboBoxFiltro1.ToolTipText = "Seleccione columna por la cual desea filtrar" + Me.proveedor_id.HeaderText = "proveedor_id" + Me.proveedor_id.Name = "proveedor_id" + Me.proveedor_id.ReadOnly = True + Me.proveedor_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.proveedor_id.Visible = False ' - 'TSComboBoxOpera1 + 'proveedor_nombre ' - Me.TSComboBoxOpera1.FlatStyle = System.Windows.Forms.FlatStyle.Standard - Me.TSComboBoxOpera1.Items.AddRange(New Object() {"*", "="}) - Me.TSComboBoxOpera1.Margin = New System.Windows.Forms.Padding(3) - Me.TSComboBoxOpera1.Name = "TSComboBoxOpera1" - Me.TSComboBoxOpera1.Size = New System.Drawing.Size(143, 23) - Me.TSComboBoxOpera1.Text = "*" - Me.TSComboBoxOpera1.ToolTipText = "Elija entre buscar resultados apróximados o exactos" + Me.proveedor_nombre.HeaderText = "Proveedor" + Me.proveedor_nombre.Name = "proveedor_nombre" + Me.proveedor_nombre.ReadOnly = True ' - 'TSTextBoxFiltro1 + 'categoria_gasto_id ' - Me.TSTextBoxFiltro1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.TSTextBoxFiltro1.Margin = New System.Windows.Forms.Padding(3) - Me.TSTextBoxFiltro1.Name = "TSTextBoxFiltro1" - Me.TSTextBoxFiltro1.Size = New System.Drawing.Size(143, 23) - Me.TSTextBoxFiltro1.ToolTipText = "Ingresar valores por los cuales quiere filtrar la tabla." + Me.categoria_gasto_id.HeaderText = "categoria_gasto_id" + Me.categoria_gasto_id.Name = "categoria_gasto_id" + Me.categoria_gasto_id.ReadOnly = True + Me.categoria_gasto_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.categoria_gasto_id.Visible = False ' - 'TSLabelFiltro2 + 'categoria_nombre ' - Me.TSLabelFiltro2.Margin = New System.Windows.Forms.Padding(3) - Me.TSLabelFiltro2.Name = "TSLabelFiltro2" - Me.TSLabelFiltro2.Padding = New System.Windows.Forms.Padding(0, 6, 0, 0) - Me.TSLabelFiltro2.Size = New System.Drawing.Size(143, 21) - Me.TSLabelFiltro2.Text = "Filtro Adicional: " + Me.categoria_nombre.HeaderText = "Categoria Gasto" + Me.categoria_nombre.Name = "categoria_nombre" + Me.categoria_nombre.ReadOnly = True ' - 'TSComboBoxFiltro2 + 'persona_id ' - Me.TSComboBoxFiltro2.FlatStyle = System.Windows.Forms.FlatStyle.Standard - Me.TSComboBoxFiltro2.Items.AddRange(New Object() {"Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario", "Seleccionado"}) - Me.TSComboBoxFiltro2.Margin = New System.Windows.Forms.Padding(3) - Me.TSComboBoxFiltro2.Name = "TSComboBoxFiltro2" - Me.TSComboBoxFiltro2.Size = New System.Drawing.Size(143, 23) - Me.TSComboBoxFiltro2.ToolTipText = "Seleccione columna por la cual desea filtrar" + Me.persona_id.HeaderText = "persona_id" + Me.persona_id.Name = "persona_id" + Me.persona_id.ReadOnly = True + Me.persona_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.persona_id.Visible = False ' - 'TSComboBoxOpera2 + 'persona_nombre ' - Me.TSComboBoxOpera2.FlatStyle = System.Windows.Forms.FlatStyle.Standard - Me.TSComboBoxOpera2.Items.AddRange(New Object() {"*", "="}) - Me.TSComboBoxOpera2.Margin = New System.Windows.Forms.Padding(3) - Me.TSComboBoxOpera2.Name = "TSComboBoxOpera2" - Me.TSComboBoxOpera2.Size = New System.Drawing.Size(143, 23) - Me.TSComboBoxOpera2.Text = "*" - Me.TSComboBoxOpera2.ToolTipText = "Elija entre buscar resultados apróximados o exactos" + Me.persona_nombre.HeaderText = "Persona" + Me.persona_nombre.Name = "persona_nombre" + Me.persona_nombre.ReadOnly = True ' - 'TSTextBoxFiltro2 + 'fecha ' - Me.TSTextBoxFiltro2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.TSTextBoxFiltro2.Margin = New System.Windows.Forms.Padding(3) - Me.TSTextBoxFiltro2.Name = "TSTextBoxFiltro2" - Me.TSTextBoxFiltro2.Size = New System.Drawing.Size(143, 23) + Me.fecha.HeaderText = "Fecha" + Me.fecha.Name = "fecha" + Me.fecha.ReadOnly = True ' - 'TSButtonFiltrar + 'seccional_id ' - Me.TSButtonFiltrar.BackColor = System.Drawing.Color.LightGreen - Me.TSButtonFiltrar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text - Me.TSButtonFiltrar.Image = CType(resources.GetObject("TSButtonFiltrar.Image"), System.Drawing.Image) - Me.TSButtonFiltrar.ImageTransparentColor = System.Drawing.Color.Magenta - Me.TSButtonFiltrar.Margin = New System.Windows.Forms.Padding(3) - Me.TSButtonFiltrar.Name = "TSButtonFiltrar" - Me.TSButtonFiltrar.Padding = New System.Windows.Forms.Padding(10, 2, 10, 2) - Me.TSButtonFiltrar.Size = New System.Drawing.Size(120, 23) - Me.TSButtonFiltrar.Text = "Filtrar" + Me.seccional_id.HeaderText = "seccional_id" + Me.seccional_id.Name = "seccional_id" + Me.seccional_id.ReadOnly = True + Me.seccional_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.seccional_id.Visible = False ' - 'TSButtonQuitarFiltros + 'seccional_nombre ' - Me.TSButtonQuitarFiltros.BackColor = System.Drawing.Color.LightBlue - Me.TSButtonQuitarFiltros.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text - Me.TSButtonQuitarFiltros.Image = CType(resources.GetObject("TSButtonQuitarFiltros.Image"), System.Drawing.Image) - Me.TSButtonQuitarFiltros.ImageTransparentColor = System.Drawing.Color.Magenta - Me.TSButtonQuitarFiltros.Margin = New System.Windows.Forms.Padding(3) - Me.TSButtonQuitarFiltros.Name = "TSButtonQuitarFiltros" - Me.TSButtonQuitarFiltros.Padding = New System.Windows.Forms.Padding(10, 2, 10, 2) - Me.TSButtonQuitarFiltros.Size = New System.Drawing.Size(143, 23) - Me.TSButtonQuitarFiltros.Text = "Quitar Filtros" + Me.seccional_nombre.HeaderText = "Seccional" + Me.seccional_nombre.Name = "seccional_nombre" + Me.seccional_nombre.ReadOnly = True ' - 'SplitContainerModificar + 'mes_reintegro ' - Me.SplitContainerModificar.Dock = System.Windows.Forms.DockStyle.Fill - Me.SplitContainerModificar.Location = New System.Drawing.Point(0, 0) - Me.SplitContainerModificar.Name = "SplitContainerModificar" - Me.SplitContainerModificar.Orientation = System.Windows.Forms.Orientation.Horizontal + Me.mes_reintegro.HeaderText = "Mes Reintegro" + Me.mes_reintegro.Name = "mes_reintegro" + Me.mes_reintegro.ReadOnly = True ' - 'SplitContainerModificar.Panel1 + 'monto ' - Me.SplitContainerModificar.Panel1.Controls.Add(Me.DGVModificar) + Me.monto.HeaderText = "Monto" + Me.monto.Name = "monto" + Me.monto.ReadOnly = True ' - 'SplitContainerModificar.Panel2 + 'comentario ' - Me.SplitContainerModificar.Panel2.Controls.Add(Me.ButtonEliminar) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.LabelSeccional) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxSeccional) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.DateTimePickerMesReintegro) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label1) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.DateTimePickerFecha) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxNroComprobante) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxTipoComprobante) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxPVenta) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label4) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label5) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxMonto) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.ComboBoxCategGasto) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.ButtonGuardar) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label6) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxNombre) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label7) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label8) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label9) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label10) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label11) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.Label12) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxComentario) - Me.SplitContainerModificar.Panel2.Controls.Add(Me.TextBoxProveedor) - Me.SplitContainerModificar.Size = New System.Drawing.Size(614, 421) - Me.SplitContainerModificar.SplitterDistance = 201 - Me.SplitContainerModificar.TabIndex = 1 + Me.comentario.HeaderText = "Comentario" + Me.comentario.Name = "comentario" + Me.comentario.ReadOnly = True ' 'ButtonEliminar ' @@ -1067,132 +862,366 @@ Partial Class ABMEgresos Me.TextBoxProveedor.Size = New System.Drawing.Size(160, 22) Me.TextBoxProveedor.TabIndex = 93 ' - 'DGVModificar + 'ToolStripModificar + ' + Me.ToolStripModificar.Dock = System.Windows.Forms.DockStyle.None + Me.ToolStripModificar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStripModificar.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TSLabelTrimestre, Me.TSComboBoxTrimestre, Me.TSLabelAño, Me.TSTextBoxAño, Me.TSLabelMes, Me.TSComboBoxMes, Me.TSLabelFiltro1, Me.TSComboBoxFiltro1, Me.TSComboBoxOpera1, Me.TSTextBoxFiltro1, Me.TSLabelFiltro2, Me.TSComboBoxFiltro2, Me.TSComboBoxOpera2, Me.TSTextBoxFiltro2, Me.TSButtonFiltrar, Me.TSButtonQuitarFiltros}) + Me.ToolStripModificar.Location = New System.Drawing.Point(0, 3) + Me.ToolStripModificar.Name = "ToolStripModificar" + Me.ToolStripModificar.Padding = New System.Windows.Forms.Padding(0) + Me.ToolStripModificar.Size = New System.Drawing.Size(148, 417) + Me.ToolStripModificar.TabIndex = 0 + ' + 'TSLabelTrimestre + ' + Me.TSLabelTrimestre.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSLabelTrimestre.Name = "TSLabelTrimestre" + Me.TSLabelTrimestre.Size = New System.Drawing.Size(141, 15) + Me.TSLabelTrimestre.Text = "Trimestre: " + ' + 'TSComboBoxTrimestre + ' + Me.TSComboBoxTrimestre.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TSComboBoxTrimestre.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems + Me.TSComboBoxTrimestre.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxTrimestre.Items.AddRange(New Object() {"", "Primero", "Segundo", "Tercero", "Cuarto"}) + Me.TSComboBoxTrimestre.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSComboBoxTrimestre.Name = "TSComboBoxTrimestre" + Me.TSComboBoxTrimestre.Size = New System.Drawing.Size(141, 23) + ' + 'TSLabelAño + ' + Me.TSLabelAño.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSLabelAño.Name = "TSLabelAño" + Me.TSLabelAño.Size = New System.Drawing.Size(141, 15) + Me.TSLabelAño.Text = "Año: " + ' + 'TSTextBoxAño + ' + Me.TSTextBoxAño.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.TSTextBoxAño.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSTextBoxAño.Name = "TSTextBoxAño" + Me.TSTextBoxAño.Size = New System.Drawing.Size(141, 23) + ' + 'TSLabelFiltro1 + ' + Me.TSLabelFiltro1.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSLabelFiltro1.Name = "TSLabelFiltro1" + Me.TSLabelFiltro1.Size = New System.Drawing.Size(141, 15) + Me.TSLabelFiltro1.Text = "Filtrar Por:" + ' + 'TSComboBoxFiltro1 + ' + Me.TSComboBoxFiltro1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TSComboBoxFiltro1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems + Me.TSComboBoxFiltro1.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxFiltro1.Items.AddRange(New Object() {"", "Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario", "Seleccionado"}) + Me.TSComboBoxFiltro1.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSComboBoxFiltro1.Name = "TSComboBoxFiltro1" + Me.TSComboBoxFiltro1.Size = New System.Drawing.Size(141, 23) + Me.TSComboBoxFiltro1.ToolTipText = "Seleccione columna por la cual desea filtrar" + ' + 'TSComboBoxOpera1 + ' + Me.TSComboBoxOpera1.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxOpera1.Items.AddRange(New Object() {"*", "="}) + Me.TSComboBoxOpera1.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSComboBoxOpera1.Name = "TSComboBoxOpera1" + Me.TSComboBoxOpera1.Size = New System.Drawing.Size(141, 23) + Me.TSComboBoxOpera1.Text = "*" + Me.TSComboBoxOpera1.ToolTipText = "Elija entre buscar resultados apróximados o exactos" + ' + 'TSTextBoxFiltro1 + ' + Me.TSTextBoxFiltro1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.TSTextBoxFiltro1.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSTextBoxFiltro1.Name = "TSTextBoxFiltro1" + Me.TSTextBoxFiltro1.Size = New System.Drawing.Size(141, 23) + Me.TSTextBoxFiltro1.ToolTipText = "Ingresar valores por los cuales quiere filtrar la tabla." + ' + 'TSLabelFiltro2 + ' + Me.TSLabelFiltro2.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSLabelFiltro2.Name = "TSLabelFiltro2" + Me.TSLabelFiltro2.Size = New System.Drawing.Size(141, 15) + Me.TSLabelFiltro2.Text = "Filtro Adicional: " + ' + 'TSComboBoxFiltro2 + ' + Me.TSComboBoxFiltro2.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TSComboBoxFiltro2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems + Me.TSComboBoxFiltro2.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxFiltro2.Items.AddRange(New Object() {"", "Nro Comprobante", "Tipo Comprobante", "Proveedor", "Categoria Gasto", "Persona", "Fecha", "Seccional", "Mes Reintegro", "Monto", "Comentario", "Seleccionado"}) + Me.TSComboBoxFiltro2.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSComboBoxFiltro2.Name = "TSComboBoxFiltro2" + Me.TSComboBoxFiltro2.Size = New System.Drawing.Size(141, 23) + Me.TSComboBoxFiltro2.ToolTipText = "Seleccione columna por la cual desea filtrar" + ' + 'TSComboBoxOpera2 + ' + Me.TSComboBoxOpera2.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxOpera2.Items.AddRange(New Object() {"*", "="}) + Me.TSComboBoxOpera2.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSComboBoxOpera2.Name = "TSComboBoxOpera2" + Me.TSComboBoxOpera2.Size = New System.Drawing.Size(141, 23) + Me.TSComboBoxOpera2.Text = "*" + Me.TSComboBoxOpera2.ToolTipText = "Elija entre buscar resultados apróximados o exactos" + ' + 'TSTextBoxFiltro2 + ' + Me.TSTextBoxFiltro2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.TSTextBoxFiltro2.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSTextBoxFiltro2.Name = "TSTextBoxFiltro2" + Me.TSTextBoxFiltro2.Size = New System.Drawing.Size(141, 23) + ' + 'TSButtonFiltrar + ' + Me.TSButtonFiltrar.BackColor = System.Drawing.Color.LightGreen + Me.TSButtonFiltrar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text + Me.TSButtonFiltrar.Image = CType(resources.GetObject("TSButtonFiltrar.Image"), System.Drawing.Image) + Me.TSButtonFiltrar.ImageTransparentColor = System.Drawing.Color.Magenta + Me.TSButtonFiltrar.Margin = New System.Windows.Forms.Padding(3) + Me.TSButtonFiltrar.Name = "TSButtonFiltrar" + Me.TSButtonFiltrar.Padding = New System.Windows.Forms.Padding(10, 2, 10, 2) + Me.TSButtonFiltrar.Size = New System.Drawing.Size(141, 23) + Me.TSButtonFiltrar.Text = "Filtrar" + ' + 'TSButtonQuitarFiltros + ' + Me.TSButtonQuitarFiltros.BackColor = System.Drawing.Color.LightBlue + Me.TSButtonQuitarFiltros.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text + Me.TSButtonQuitarFiltros.Image = CType(resources.GetObject("TSButtonQuitarFiltros.Image"), System.Drawing.Image) + Me.TSButtonQuitarFiltros.ImageTransparentColor = System.Drawing.Color.Magenta + Me.TSButtonQuitarFiltros.Margin = New System.Windows.Forms.Padding(3) + Me.TSButtonQuitarFiltros.Name = "TSButtonQuitarFiltros" + Me.TSButtonQuitarFiltros.Padding = New System.Windows.Forms.Padding(10, 2, 10, 2) + Me.TSButtonQuitarFiltros.Size = New System.Drawing.Size(99, 23) + Me.TSButtonQuitarFiltros.Text = "Quitar Filtros" + ' + 'TabPagePapelera + ' + Me.TabPagePapelera.Controls.Add(Me.SplitContainerPapelera) + Me.TabPagePapelera.Location = New System.Drawing.Point(4, 25) + Me.TabPagePapelera.Name = "TabPagePapelera" + Me.TabPagePapelera.Padding = New System.Windows.Forms.Padding(3) + Me.TabPagePapelera.Size = New System.Drawing.Size(747, 427) + Me.TabPagePapelera.TabIndex = 2 + Me.TabPagePapelera.Text = "Papelera" + Me.TabPagePapelera.UseVisualStyleBackColor = True + ' + 'SplitContainerPapelera + ' + Me.SplitContainerPapelera.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainerPapelera.Location = New System.Drawing.Point(3, 3) + Me.SplitContainerPapelera.Name = "SplitContainerPapelera" + Me.SplitContainerPapelera.Orientation = System.Windows.Forms.Orientation.Horizontal + ' + 'SplitContainerPapelera.Panel1 + ' + Me.SplitContainerPapelera.Panel1.Controls.Add(Me.ToolStripContainerPapelera) + ' + 'SplitContainerPapelera.Panel2 + ' + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraEliminar) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraVaciarPapelera) + Me.SplitContainerPapelera.Panel2.Controls.Add(Me.bPapeleraRestaurar) + Me.SplitContainerPapelera.Size = New System.Drawing.Size(741, 421) + Me.SplitContainerPapelera.SplitterDistance = 350 + Me.SplitContainerPapelera.TabIndex = 1 + ' + 'ToolStripContainerPapelera + ' + ' + 'ToolStripContainerPapelera.ContentPanel + ' + Me.ToolStripContainerPapelera.ContentPanel.Controls.Add(Me.DGVPapelera) + Me.ToolStripContainerPapelera.ContentPanel.Size = New System.Drawing.Size(741, 325) + Me.ToolStripContainerPapelera.Dock = System.Windows.Forms.DockStyle.Fill + Me.ToolStripContainerPapelera.Location = New System.Drawing.Point(0, 0) + Me.ToolStripContainerPapelera.Name = "ToolStripContainerPapelera" + Me.ToolStripContainerPapelera.Size = New System.Drawing.Size(741, 350) + Me.ToolStripContainerPapelera.TabIndex = 0 + Me.ToolStripContainerPapelera.Text = "ToolStripContainer1" + ' + 'DGVPapelera + ' + Me.DGVPapelera.AllowUserToAddRows = False + Me.DGVPapelera.AllowUserToDeleteRows = False + Me.DGVPapelera.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DGVPapelera.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.PapeleraId, Me.PapeleraSeleccionado, Me.PapeleraNroComprobante, Me.PapeleraTComprobanteId, Me.PapeleraTipoComprobante, Me.PapeleraProveedorId, Me.PapeleraProveedor, Me.PapeleraCategoriaGastoId, Me.PapeleraCategoriaGasto, Me.PapeleraPersonaId, Me.PapeleraPersona, Me.PapeleraFecha, Me.PapeleraSeccionalId, Me.PapeleraSeccional, Me.PapeleraReintegro, Me.PapeleraMonto, Me.PapeleraComentario}) + Me.DGVPapelera.Dock = System.Windows.Forms.DockStyle.Fill + Me.DGVPapelera.Location = New System.Drawing.Point(0, 0) + Me.DGVPapelera.Name = "DGVPapelera" + Me.DGVPapelera.ReadOnly = True + Me.DGVPapelera.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DGVPapelera.Size = New System.Drawing.Size(741, 325) + Me.DGVPapelera.TabIndex = 0 + ' + 'PapeleraId + ' + Me.PapeleraId.HeaderText = "Id" + Me.PapeleraId.Name = "PapeleraId" + Me.PapeleraId.ReadOnly = True + Me.PapeleraId.Visible = False + ' + 'PapeleraSeleccionado + ' + Me.PapeleraSeleccionado.HeaderText = "Seleccionado" + Me.PapeleraSeleccionado.Name = "PapeleraSeleccionado" + Me.PapeleraSeleccionado.ReadOnly = True + ' + 'PapeleraNroComprobante + ' + Me.PapeleraNroComprobante.HeaderText = "Nro Comprobante" + Me.PapeleraNroComprobante.Name = "PapeleraNroComprobante" + Me.PapeleraNroComprobante.ReadOnly = True + ' + 'PapeleraTComprobanteId ' - Me.DGVModificar.AllowUserToAddRows = False - Me.DGVModificar.AllowUserToDeleteRows = False - Me.DGVModificar.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DGVModificar.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.id, Me.seleccionado, Me.nro_comprobante, Me.tipo_comprobante_id, Me.tipo_comprobante_nombre, Me.proveedor_id, Me.proveedor_nombre, Me.categoria_gasto_id, Me.categoria_nombre, Me.persona_id, Me.persona_nombre, Me.fecha, Me.seccional_id, Me.seccional_nombre, Me.mes_reintegro, Me.monto, Me.comentario}) - Me.DGVModificar.Dock = System.Windows.Forms.DockStyle.Fill - Me.DGVModificar.Location = New System.Drawing.Point(0, 0) - Me.DGVModificar.Name = "DGVModificar" - Me.DGVModificar.ReadOnly = True - Me.DGVModificar.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DGVModificar.Size = New System.Drawing.Size(614, 201) - Me.DGVModificar.TabIndex = 1 + Me.PapeleraTComprobanteId.HeaderText = "tipo_comprobante_id" + Me.PapeleraTComprobanteId.Name = "PapeleraTComprobanteId" + Me.PapeleraTComprobanteId.ReadOnly = True + Me.PapeleraTComprobanteId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraTComprobanteId.Visible = False ' - 'id + 'PapeleraTipoComprobante ' - Me.id.HeaderText = "Id" - Me.id.Name = "id" - Me.id.ReadOnly = True - Me.id.Visible = False + Me.PapeleraTipoComprobante.HeaderText = "Tipo Comprobante" + Me.PapeleraTipoComprobante.Name = "PapeleraTipoComprobante" + Me.PapeleraTipoComprobante.ReadOnly = True ' - 'seleccionado + 'PapeleraProveedorId ' - Me.seleccionado.HeaderText = "Seleccionado" - Me.seleccionado.Name = "seleccionado" - Me.seleccionado.ReadOnly = True + Me.PapeleraProveedorId.HeaderText = "proveedor_id" + Me.PapeleraProveedorId.Name = "PapeleraProveedorId" + Me.PapeleraProveedorId.ReadOnly = True + Me.PapeleraProveedorId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraProveedorId.Visible = False ' - 'nro_comprobante + 'PapeleraProveedor ' - Me.nro_comprobante.HeaderText = "Nro Comprobante" - Me.nro_comprobante.Name = "nro_comprobante" - Me.nro_comprobante.ReadOnly = True + Me.PapeleraProveedor.HeaderText = "Proveedor" + Me.PapeleraProveedor.Name = "PapeleraProveedor" + Me.PapeleraProveedor.ReadOnly = True ' - 'tipo_comprobante_id + 'PapeleraCategoriaGastoId ' - Me.tipo_comprobante_id.HeaderText = "tipo_comprobante_id" - Me.tipo_comprobante_id.Name = "tipo_comprobante_id" - Me.tipo_comprobante_id.ReadOnly = True - Me.tipo_comprobante_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.tipo_comprobante_id.Visible = False + Me.PapeleraCategoriaGastoId.HeaderText = "categoria_gasto_id" + Me.PapeleraCategoriaGastoId.Name = "PapeleraCategoriaGastoId" + Me.PapeleraCategoriaGastoId.ReadOnly = True + Me.PapeleraCategoriaGastoId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraCategoriaGastoId.Visible = False ' - 'tipo_comprobante_nombre + 'PapeleraCategoriaGasto ' - Me.tipo_comprobante_nombre.HeaderText = "Tipo Comprobante" - Me.tipo_comprobante_nombre.Name = "tipo_comprobante_nombre" - Me.tipo_comprobante_nombre.ReadOnly = True + Me.PapeleraCategoriaGasto.HeaderText = "Categoria Gasto" + Me.PapeleraCategoriaGasto.Name = "PapeleraCategoriaGasto" + Me.PapeleraCategoriaGasto.ReadOnly = True ' - 'proveedor_id + 'PapeleraPersonaId ' - Me.proveedor_id.HeaderText = "proveedor_id" - Me.proveedor_id.Name = "proveedor_id" - Me.proveedor_id.ReadOnly = True - Me.proveedor_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.proveedor_id.Visible = False + Me.PapeleraPersonaId.HeaderText = "persona_id" + Me.PapeleraPersonaId.Name = "PapeleraPersonaId" + Me.PapeleraPersonaId.ReadOnly = True + Me.PapeleraPersonaId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraPersonaId.Visible = False ' - 'proveedor_nombre + 'PapeleraPersona ' - Me.proveedor_nombre.HeaderText = "Proveedor" - Me.proveedor_nombre.Name = "proveedor_nombre" - Me.proveedor_nombre.ReadOnly = True + Me.PapeleraPersona.HeaderText = "Persona" + Me.PapeleraPersona.Name = "PapeleraPersona" + Me.PapeleraPersona.ReadOnly = True ' - 'categoria_gasto_id + 'PapeleraFecha ' - Me.categoria_gasto_id.HeaderText = "categoria_gasto_id" - Me.categoria_gasto_id.Name = "categoria_gasto_id" - Me.categoria_gasto_id.ReadOnly = True - Me.categoria_gasto_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.categoria_gasto_id.Visible = False + Me.PapeleraFecha.HeaderText = "Fecha" + Me.PapeleraFecha.Name = "PapeleraFecha" + Me.PapeleraFecha.ReadOnly = True ' - 'categoria_nombre + 'PapeleraSeccionalId ' - Me.categoria_nombre.HeaderText = "Categoria Gasto" - Me.categoria_nombre.Name = "categoria_nombre" - Me.categoria_nombre.ReadOnly = True + Me.PapeleraSeccionalId.HeaderText = "seccional_id" + Me.PapeleraSeccionalId.Name = "PapeleraSeccionalId" + Me.PapeleraSeccionalId.ReadOnly = True + Me.PapeleraSeccionalId.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.PapeleraSeccionalId.Visible = False ' - 'persona_id + 'PapeleraSeccional ' - Me.persona_id.HeaderText = "persona_id" - Me.persona_id.Name = "persona_id" - Me.persona_id.ReadOnly = True - Me.persona_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.persona_id.Visible = False + Me.PapeleraSeccional.HeaderText = "Seccional" + Me.PapeleraSeccional.Name = "PapeleraSeccional" + Me.PapeleraSeccional.ReadOnly = True ' - 'persona_nombre + 'PapeleraReintegro ' - Me.persona_nombre.HeaderText = "Persona" - Me.persona_nombre.Name = "persona_nombre" - Me.persona_nombre.ReadOnly = True + Me.PapeleraReintegro.HeaderText = "Mes Reintegro" + Me.PapeleraReintegro.Name = "PapeleraReintegro" + Me.PapeleraReintegro.ReadOnly = True ' - 'fecha + 'PapeleraMonto ' - Me.fecha.HeaderText = "Fecha" - Me.fecha.Name = "fecha" - Me.fecha.ReadOnly = True + Me.PapeleraMonto.HeaderText = "Monto" + Me.PapeleraMonto.Name = "PapeleraMonto" + Me.PapeleraMonto.ReadOnly = True ' - 'seccional_id + 'PapeleraComentario ' - Me.seccional_id.HeaderText = "seccional_id" - Me.seccional_id.Name = "seccional_id" - Me.seccional_id.ReadOnly = True - Me.seccional_id.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.seccional_id.Visible = False + Me.PapeleraComentario.HeaderText = "Comentario" + Me.PapeleraComentario.Name = "PapeleraComentario" + Me.PapeleraComentario.ReadOnly = True ' - 'seccional_nombre + 'bPapeleraEliminar ' - Me.seccional_nombre.HeaderText = "Seccional" - Me.seccional_nombre.Name = "seccional_nombre" - Me.seccional_nombre.ReadOnly = True + Me.bPapeleraEliminar.Enabled = False + Me.bPapeleraEliminar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.bPapeleraEliminar.ForeColor = System.Drawing.Color.Red + Me.bPapeleraEliminar.Location = New System.Drawing.Point(289, 5) + Me.bPapeleraEliminar.Name = "bPapeleraEliminar" + Me.bPapeleraEliminar.Size = New System.Drawing.Size(163, 56) + Me.bPapeleraEliminar.TabIndex = 105 + Me.bPapeleraEliminar.Text = "Eliminar Permanetemente" + Me.bPapeleraEliminar.UseVisualStyleBackColor = True ' - 'mes_reintegro + 'bPapeleraVaciarPapelera ' - Me.mes_reintegro.HeaderText = "Mes Reintegro" - Me.mes_reintegro.Name = "mes_reintegro" - Me.mes_reintegro.ReadOnly = True + Me.bPapeleraVaciarPapelera.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.bPapeleraVaciarPapelera.ForeColor = System.Drawing.Color.Red + Me.bPapeleraVaciarPapelera.Location = New System.Drawing.Point(486, 5) + Me.bPapeleraVaciarPapelera.Name = "bPapeleraVaciarPapelera" + Me.bPapeleraVaciarPapelera.Size = New System.Drawing.Size(163, 56) + Me.bPapeleraVaciarPapelera.TabIndex = 104 + Me.bPapeleraVaciarPapelera.Text = "Vaciar Papelera" + Me.bPapeleraVaciarPapelera.UseVisualStyleBackColor = True ' - 'monto + 'bPapeleraRestaurar ' - Me.monto.HeaderText = "Monto" - Me.monto.Name = "monto" - Me.monto.ReadOnly = True + Me.bPapeleraRestaurar.Enabled = False + Me.bPapeleraRestaurar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.bPapeleraRestaurar.ForeColor = System.Drawing.Color.Red + Me.bPapeleraRestaurar.Location = New System.Drawing.Point(91, 5) + Me.bPapeleraRestaurar.Name = "bPapeleraRestaurar" + Me.bPapeleraRestaurar.Size = New System.Drawing.Size(163, 56) + Me.bPapeleraRestaurar.TabIndex = 103 + Me.bPapeleraRestaurar.Text = "Restaurar" + Me.bPapeleraRestaurar.UseVisualStyleBackColor = True ' - 'comentario + 'TSLabelMes ' - Me.comentario.HeaderText = "Comentario" - Me.comentario.Name = "comentario" - Me.comentario.ReadOnly = True + Me.TSLabelMes.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSLabelMes.Name = "TSLabelMes" + Me.TSLabelMes.Size = New System.Drawing.Size(141, 15) + Me.TSLabelMes.Text = "Mes:" + ' + 'TSComboBoxMes + ' + Me.TSComboBoxMes.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.TSComboBoxMes.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems + Me.TSComboBoxMes.FlatStyle = System.Windows.Forms.FlatStyle.Standard + Me.TSComboBoxMes.Items.AddRange(New Object() {"", "01 - Enero", "02 - Febrero", "03 - Marzo", "04 - Abril", "05 - Mayo", "06 - Junio", "07 - Julio", "08 - Agosto", "09 - Septiembre", "10 - Octubre", "11 - Noviembre", "12 - Diciembre"}) + Me.TSComboBoxMes.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.TSComboBoxMes.Name = "TSComboBoxMes" + Me.TSComboBoxMes.Size = New System.Drawing.Size(141, 23) ' 'ABMEgresos ' @@ -1205,57 +1234,39 @@ Partial Class ABMEgresos Me.TabControl.ResumeLayout(False) Me.TabPageAgregar.ResumeLayout(False) Me.TabPageAgregar.PerformLayout() + Me.GroupBoxAgregar.ResumeLayout(False) + Me.GroupBoxAgregar.PerformLayout() Me.TabPageModificar.ResumeLayout(False) - Me.TabPagePapelera.ResumeLayout(False) - Me.SplitContainerPapelera.Panel1.ResumeLayout(False) - Me.SplitContainerPapelera.Panel2.ResumeLayout(False) - CType(Me.SplitContainerPapelera, System.ComponentModel.ISupportInitialize).EndInit() - Me.SplitContainerPapelera.ResumeLayout(False) - Me.ToolStripContainerPapelera.ContentPanel.ResumeLayout(False) - Me.ToolStripContainerPapelera.ResumeLayout(False) - Me.ToolStripContainerPapelera.PerformLayout() - CType(Me.DGVPapelera, System.ComponentModel.ISupportInitialize).EndInit() Me.ToolStripContainerModificar.ContentPanel.ResumeLayout(False) Me.ToolStripContainerModificar.RightToolStripPanel.ResumeLayout(False) Me.ToolStripContainerModificar.RightToolStripPanel.PerformLayout() Me.ToolStripContainerModificar.ResumeLayout(False) Me.ToolStripContainerModificar.PerformLayout() - Me.ToolStripModificar.ResumeLayout(False) - Me.ToolStripModificar.PerformLayout() Me.SplitContainerModificar.Panel1.ResumeLayout(False) Me.SplitContainerModificar.Panel2.ResumeLayout(False) Me.SplitContainerModificar.Panel2.PerformLayout() CType(Me.SplitContainerModificar, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerModificar.ResumeLayout(False) CType(Me.DGVModificar, System.ComponentModel.ISupportInitialize).EndInit() + Me.ToolStripModificar.ResumeLayout(False) + Me.ToolStripModificar.PerformLayout() + Me.TabPagePapelera.ResumeLayout(False) + Me.SplitContainerPapelera.Panel1.ResumeLayout(False) + Me.SplitContainerPapelera.Panel2.ResumeLayout(False) + CType(Me.SplitContainerPapelera, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerPapelera.ResumeLayout(False) + Me.ToolStripContainerPapelera.ContentPanel.ResumeLayout(False) + Me.ToolStripContainerPapelera.ResumeLayout(False) + Me.ToolStripContainerPapelera.PerformLayout() + CType(Me.DGVPapelera, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub Friend WithEvents TabControl As TabControl Friend WithEvents TabPageAgregar As TabPage - Friend WithEvents tbNComprobante As TextBox Friend WithEvents lb_Titulo As Label - Friend WithEvents tbPVenta As TextBox - Friend WithEvents lbSmonto As Label - Friend WithEvents lbTComprobante As Label - Friend WithEvents tbMonto As TextBox - Friend WithEvents btnGuardar As Button - Friend WithEvents lbGasto As Label - Friend WithEvents tbNombre As TextBox - Friend WithEvents lbMes As Label - Friend WithEvents lbComentario As Label - Friend WithEvents lbMonto As Label - Friend WithEvents lbProveedor As Label - Friend WithEvents lbNombre As Label - Friend WithEvents lbNComprobante As Label - Friend WithEvents tbComentario As TextBox - Friend WithEvents tbProveedor As TextBox Friend WithEvents TabPageModificar As TabPage - Friend WithEvents lbSeccional As Label - Friend WithEvents lbFecha As Label - Friend WithEvents dtpFecha As DateTimePicker - Friend WithEvents dtpReintegro As DateTimePicker Friend WithEvents TabPagePapelera As TabPage Friend WithEvents SplitContainerPapelera As SplitContainer Friend WithEvents ToolStripContainerPapelera As ToolStripContainer @@ -1263,9 +1274,6 @@ Partial Class ABMEgresos Friend WithEvents bPapeleraRestaurar As Button Friend WithEvents bPapeleraVaciarPapelera As Button Friend WithEvents bPapeleraEliminar As Button - Friend WithEvents cbTGasto As ComboBox - Friend WithEvents cbSeccional As ComboBox - Friend WithEvents cbTComprobante As ComboBox Friend WithEvents PapeleraId As DataGridViewTextBoxColumn Friend WithEvents PapeleraSeleccionado As DataGridViewCheckBoxColumn Friend WithEvents PapeleraNroComprobante As DataGridViewTextBoxColumn @@ -1342,4 +1350,30 @@ Partial Class ABMEgresos Friend WithEvents TSTextBoxFiltro2 As ToolStripTextBox Friend WithEvents TSButtonFiltrar As ToolStripButton Friend WithEvents TSButtonQuitarFiltros As ToolStripButton + Friend WithEvents GroupBoxAgregar As GroupBox + Friend WithEvents cbTComprobante As ComboBox + Friend WithEvents cbSeccional As ComboBox + Friend WithEvents cbTGasto As ComboBox + Friend WithEvents lbFecha As Label + Friend WithEvents dtpFecha As DateTimePicker + Friend WithEvents dtpReintegro As DateTimePicker + Friend WithEvents lbSeccional As Label + Friend WithEvents tbNComprobante As TextBox + Friend WithEvents tbPVenta As TextBox + Friend WithEvents lbSmonto As Label + Friend WithEvents lbTComprobante As Label + Friend WithEvents tbMonto As TextBox + Friend WithEvents btnGuardar As Button + Friend WithEvents lbGasto As Label + Friend WithEvents tbNombre As TextBox + Friend WithEvents lbMes As Label + Friend WithEvents lbComentario As Label + Friend WithEvents lbMonto As Label + Friend WithEvents lbProveedor As Label + Friend WithEvents lbNombre As Label + Friend WithEvents lbNComprobante As Label + Friend WithEvents tbComentario As TextBox + Friend WithEvents tbProveedor As TextBox + Friend WithEvents TSLabelMes As ToolStripLabel + Friend WithEvents TSComboBoxMes As ToolStripComboBox End Class diff --git a/SireCu/Paneles/ABMEgresos.resx b/SireCu/Paneles/ABMEgresos.resx index 27cf808..fce0394 100644 --- a/SireCu/Paneles/ABMEgresos.resx +++ b/SireCu/Paneles/ABMEgresos.resx @@ -202,55 +202,55 @@ TgDQASA1MVpwzwAAAABJRU5ErkJggg== - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True @@ -304,55 +304,55 @@ True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True \ No newline at end of file diff --git a/SireCu/Paneles/ABMEgresos.vb b/SireCu/Paneles/ABMEgresos.vb index d370574..aee77e2 100644 --- a/SireCu/Paneles/ABMEgresos.vb +++ b/SireCu/Paneles/ABMEgresos.vb @@ -90,7 +90,7 @@ Public Class ABMEgresos tbComentario.Text ) - limpiarForm(TabPageAgregar) + limpiarForm(GroupBoxAgregar) dtpReintegro.Checked = False CargardDGV(DGVModificar) ActualizarSaldo() @@ -268,6 +268,10 @@ Public Class ABMEgresos filtros.Add(New KeyValuePair(Of String, String)("año", TSTextBoxAño.Text)) End If + If Not TSComboBoxMes.SelectedItem = "" Then + filtros.Add(New KeyValuePair(Of String, String)("mes", TSComboBoxMes.SelectedItem.ToString.Split(" ")(0))) + End If + If Not (TSComboBoxFiltro1.SelectedItem = "" Or TSTextBoxFiltro1.Text = "") Then filtros.Add(New KeyValuePair(Of String, String)(TSComboBoxFiltro1.SelectedItem & TSComboBoxOpera1.SelectedItem, TSTextBoxFiltro1.Text)) End If @@ -325,6 +329,11 @@ Public Class ABMEgresos ' Filtrar por año sql += " AND DATEPART(year, [fecha]) = " & keyv.Value + ElseIf keyv.Key = "mes" Then + + ' Filtrar por mes + sql += " AND DATEPART(month, [fecha]) = " & keyv.Value + Else ' Filtros adicionales @@ -930,6 +939,25 @@ Public Class ABMEgresos TSComboBoxFiltro1.BackColor = Color.MistyRose End If End Sub + + Private Sub TSComboBoxFiltro1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TSComboBoxFiltro1.SelectedIndexChanged + TSTextBoxFiltro1.Text = "" + End Sub + + Private Sub TSComboBoxFiltro2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TSComboBoxFiltro2.SelectedIndexChanged + TSTextBoxFiltro2.Text = "" + End Sub + + Private Sub TSComboBoxMes_Validating(sender As Object, e As CancelEventArgs) Handles TSComboBoxMes.Validating + If TSComboBoxMes.Items.Contains(TSComboBoxMes.Text) Or TSComboBoxMes.Text = "" Then + TSComboBoxMes.BackColor = SystemColors.Window + Else + TSComboBoxMes.SelectedIndex = -1 + TSComboBoxMes.Text = "" + System.Media.SystemSounds.Beep.Play() + TSComboBoxMes.BackColor = Color.MistyRose + End If + End Sub #End Region End Class \ No newline at end of file diff --git a/SireCu/Principal.Designer.vb b/SireCu/Principal.Designer.vb index 4b95be7..a92cf1d 100644 --- a/SireCu/Principal.Designer.vb +++ b/SireCu/Principal.Designer.vb @@ -197,7 +197,7 @@ Partial Class Principal 'SalirToolStripMenuItem ' Me.SalirToolStripMenuItem.Name = "SalirToolStripMenuItem" - Me.SalirToolStripMenuItem.Size = New System.Drawing.Size(152, 22) + Me.SalirToolStripMenuItem.Size = New System.Drawing.Size(96, 22) Me.SalirToolStripMenuItem.Text = "&Salir" ' 'ErrorProvider