diff --git a/SireCu/Clases/Egreso.vb b/SireCu/Clases/Egreso.vb index a68b068..ad6d9ee 100644 --- a/SireCu/Clases/Egreso.vb +++ b/SireCu/Clases/Egreso.vb @@ -1,128 +1,233 @@ -Public Class Egreso - - Private nComp As String - Private provee As String - Private cGasto As String - Private gasta As String - Private fecha As DateTime - Private tipComp As String - Private uda As String - Private reintegro As Integer - Private mont As Double - Private comen As String - - 'Constructor - Public Sub New(ByVal numComprobante As String, ByVal proveedor As String, ByVal catGasto As String, _ - ByVal gastador As String, ByVal fechaEgreso As DateTime, ByVal tipoComprobante As String, _ - ByVal uda As String, ByVal mesReintegro As Integer, ByVal monto As Double, ByVal comentario As String) - Me.nComp = numComprobante - Me.provee = proveedor - Me.cGasto = catGasto - Me.gasta = gastador - Me.fecha = fechaEgreso - Me.tipComp = tipocomprobante - Me.uda = uda - Me.reintegro = mesReintegro - Me.mont = monto - Me.comen = comentario +Imports System.Data.SqlServerCe +Module Egreso + + Public Sub nuevo_egreso(ByVal compro As String, ByVal proveedor As String, ByVal categoria As String, ByVal persona As String, + 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, seleccionado)" & + "VALUES (@nro_comprobante, @proveedor, @cat_gasto, @persona, @fecha, @t_comprobante, " & + "@seccional, @reintegro, @monto, @comentario, 0, 0)" + 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) + + consultarNQ(Principal.query, Principal.command) End Sub - 'Get & Set - Public Property numcomprobante() As String - Get - Return nComp - End Get - Set(ByVal value As String) - nComp = value - End Set - End Property - Public Property proveedor() As String - Get - Return provee - End Get - Set(ByVal value As String) - provee = value - End Set - End Property - Public Property catGasto() As String - Get - Return cGasto - End Get - Set(ByVal value As String) - cGasto = value - End Set - End Property - Public Property gastador() As String - Get - Return gasta - End Get - Set(ByVal value As String) - gasta = value - End Set - End Property - Public Property fechaEgreso() As DateTime - Get - Return fecha - End Get - Set(ByVal value As DateTime) - fecha = value - End Set - End Property - Public Property tipoComprobante() As String - Get - Return tipComp - End Get - Set(ByVal value As String) - tipComp = value - End Set - End Property - Public Property seccionalUDA() As String - Get - Return uda - End Get - Set(ByVal value As String) - uda = value - End Set - End Property - Public Property mesReintegro() As Integer - Get - Return reintegro - End Get - Set(ByVal value As Integer) - reintegro = value - End Set - End Property - Public Property monto() As Double - Get - Return mont - End Get - Set(ByVal value As Double) - mont = value - End Set - End Property - Public Property comentario() As String - Get - Return comen - End Get - Set(ByVal value As String) - comen = value - End Set - End Property - - Public Sub cargar_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 modificar_egreso() + 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) + 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 eliminar_egreso() + 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 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" + + 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 + 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 = "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, + 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 + 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 & " 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 = "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 - Public Sub filtrar_datos() + 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 + 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 = "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 -End Class + Public Function comprobante_repetido(ByVal nComprobante As String, ByVal proveedorID As Integer) + + 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 1dcb104..3f4e877 100644 --- a/SireCu/Clases/Ingreso.vb +++ b/SireCu/Clases/Ingreso.vb @@ -17,60 +17,23 @@ Module Ingreso End Sub - Public Function mostrar_ingreso(ByVal mes As Integer, ByVal año As Integer) + 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.adapter = New SqlCeDataAdapter(Principal.command) - ClearDataset(Principal.dataset) - Principal.adapter.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 - - End Function + Dim dt As DataTable = consultarReader(Principal.query) - Public Function ultimoaño() - - Principal.query = "SELECT fecha FROM ingresos ORDER BY fecha DESC" - consultarNQ(Principal.query, Principal.command) - ClearDataset(Principal.dataset) - - Principal.adapter = New SqlCeDataAdapter(Principal.command) - Principal.adapter.Fill(Principal.dataset.Tables("ingresos")) - - If (Principal.dataset.Tables("ingresos").Rows.Count() = 0) Then - Return ("2000") - Else : Return (DatePart(DateInterval.Year, Principal.dataset.Tables("ingresos").Rows.Item(0).Item("fecha"))) - End If + Return dt End Function Public Function verificar_año(ByVal año As Integer) 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")) - - If (Principal.dataset.Tables("ingresos").Rows.Count = 0) Then - Return (False) - Else - Return (True) - End If + Dim dt As DataTable = consultarReader(Principal.query) + + Return IIf(dt.Rows.Count > 0, True, False) End Function diff --git a/SireCu/Conexion.vb b/SireCu/Conexion.vb index 4a5b9f8..dbae4cd 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,48 @@ Module Conexion Return resultado End Function + 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 dt + 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 + 'Limpiamos la tabla + Principal.dataset.Tables(tabla).Clear() + + 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 + + 'Refrescamos el contenido + Principal.tableadapters(tabla).Fill(Principal.dataset.Tables.Item(tabla)) + + End Sub + End Module diff --git a/SireCu/DBSireCu.sdf b/SireCu/DBSireCu.sdf index 707ded7..3da8fab 100644 Binary files a/SireCu/DBSireCu.sdf and b/SireCu/DBSireCu.sdf differ diff --git a/SireCu/Egresos/ABMEgresos.Designer.vb b/SireCu/Egresos/ABMEgresos.Designer.vb deleted file mode 100644 index 4b9f5a0..0000000 --- a/SireCu/Egresos/ABMEgresos.Designer.vb +++ /dev/null @@ -1,395 +0,0 @@ - _ -Partial Class ABMEgresos - 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.tbTComprobante = New System.Windows.Forms.ComboBox() - Me.bttnConsultar = New System.Windows.Forms.Button() - 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() - Me.tbGasto = New System.Windows.Forms.ComboBox() - Me.btnGuardar = New System.Windows.Forms.Button() - Me.lbGasto = New System.Windows.Forms.Label() - Me.ckCentral = New System.Windows.Forms.CheckBox() - Me.ckLarioja = New System.Windows.Forms.CheckBox() - Me.tbNombre = New System.Windows.Forms.TextBox() - Me.lbMes = New System.Windows.Forms.Label() - Me.lbComentario = New System.Windows.Forms.Label() - Me.lbMonto = New System.Windows.Forms.Label() - Me.lbProveedor = New System.Windows.Forms.Label() - Me.lbNombre = New System.Windows.Forms.Label() - 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.tbNComprobante = New System.Windows.Forms.TextBox() - Me.SuspendLayout() - ' - 'tbTComprobante - ' - Me.tbTComprobante.AutoCompleteCustomSource.AddRange(New String() {"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.tbTComprobante.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.tbTComprobante.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.tbTComprobante.FormattingEnabled = True - Me.tbTComprobante.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.tbTComprobante.Location = New System.Drawing.Point(524, 133) - Me.tbTComprobante.Name = "tbTComprobante" - Me.tbTComprobante.Size = New System.Drawing.Size(163, 21) - Me.tbTComprobante.TabIndex = 7 - ' - '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(561, 378) - Me.bttnConsultar.Name = "bttnConsultar" - Me.bttnConsultar.Size = New System.Drawing.Size(126, 59) - Me.bttnConsultar.TabIndex = 60 - Me.bttnConsultar.TabStop = False - Me.bttnConsultar.Text = "Consultar" - Me.bttnConsultar.UseVisualStyleBackColor = True - ' - 'tbPVenta - ' - Me.tbPVenta.Location = New System.Drawing.Point(524, 180) - Me.tbPVenta.Name = "tbPVenta" - Me.tbPVenta.Size = New System.Drawing.Size(59, 20) - Me.tbPVenta.TabIndex = 8 - ' - 'tbReintegro - ' - Me.tbReintegro.Location = New System.Drawing.Point(155, 228) - Me.tbReintegro.MaxLength = 2 - Me.tbReintegro.Name = "tbReintegro" - Me.tbReintegro.Size = New System.Drawing.Size(156, 20) - Me.tbReintegro.TabIndex = 6 - ' - '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(682, 60) - Me.lbYear.Name = "lbYear" - Me.lbYear.Size = New System.Drawing.Size(22, 12) - Me.lbYear.TabIndex = 59 - 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(625, 60) - Me.lbMonth.Name = "lbMonth" - Me.lbMonth.Size = New System.Drawing.Size(24, 12) - Me.lbMonth.TabIndex = 58 - 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(582, 60) - Me.lbDay.Name = "lbDay" - Me.lbDay.Size = New System.Drawing.Size(19, 12) - Me.lbDay.TabIndex = 57 - Me.lbDay.Text = "Dia" - ' - 'tbYear - ' - Me.tbYear.Enabled = False - Me.tbYear.Location = New System.Drawing.Point(668, 73) - Me.tbYear.MaxLength = 4 - Me.tbYear.Name = "tbYear" - Me.tbYear.Size = New System.Drawing.Size(54, 20) - Me.tbYear.TabIndex = 45 - Me.tbYear.TabStop = False - ' - 'tbMonth - ' - Me.tbMonth.Location = New System.Drawing.Point(621, 73) - Me.tbMonth.MaxLength = 2 - Me.tbMonth.Name = "tbMonth" - Me.tbMonth.Size = New System.Drawing.Size(34, 20) - Me.tbMonth.TabIndex = 3 - ' - 'tbDay - ' - Me.tbDay.Location = New System.Drawing.Point(577, 73) - Me.tbDay.MaxLength = 2 - Me.tbDay.Name = "tbDay" - Me.tbDay.Size = New System.Drawing.Size(33, 20) - Me.tbDay.TabIndex = 2 - ' - 'lbSmonto - ' - Me.lbSmonto.AutoSize = True - Me.lbSmonto.Location = New System.Drawing.Point(505, 231) - Me.lbSmonto.Name = "lbSmonto" - Me.lbSmonto.Size = New System.Drawing.Size(13, 13) - Me.lbSmonto.TabIndex = 55 - Me.lbSmonto.Text = "$" - ' - 'lbTComprobante - ' - Me.lbTComprobante.AutoSize = True - Me.lbTComprobante.Location = New System.Drawing.Point(403, 136) - Me.lbTComprobante.Name = "lbTComprobante" - Me.lbTComprobante.Size = New System.Drawing.Size(109, 13) - Me.lbTComprobante.TabIndex = 54 - Me.lbTComprobante.Text = "Tipo de Comprobante" - ' - 'tbMonto - ' - Me.tbMonto.Location = New System.Drawing.Point(524, 228) - Me.tbMonto.Name = "tbMonto" - Me.tbMonto.Size = New System.Drawing.Size(163, 20) - Me.tbMonto.TabIndex = 10 - Me.tbMonto.Tag = "" - ' - 'tbGasto - ' - Me.tbGasto.AutoCompleteCustomSource.AddRange(New String() {"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"}) - Me.tbGasto.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.tbGasto.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.tbGasto.FormattingEnabled = True - Me.tbGasto.Items.AddRange(New Object() {"Administrativos", "Alquileres", "Aplicables a Coparticipación", "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"}) - Me.tbGasto.Location = New System.Drawing.Point(155, 135) - Me.tbGasto.Name = "tbGasto" - Me.tbGasto.Size = New System.Drawing.Size(156, 21) - Me.tbGasto.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)) - Me.btnGuardar.ForeColor = System.Drawing.Color.Green - Me.btnGuardar.Location = New System.Drawing.Point(561, 291) - Me.btnGuardar.Name = "btnGuardar" - Me.btnGuardar.Size = New System.Drawing.Size(126, 61) - Me.btnGuardar.TabIndex = 14 - Me.btnGuardar.Text = "Guardar" - Me.btnGuardar.UseVisualStyleBackColor = True - ' - 'lbGasto - ' - Me.lbGasto.AutoSize = True - Me.lbGasto.Location = New System.Drawing.Point(55, 138) - Me.lbGasto.Name = "lbGasto" - Me.lbGasto.Size = New System.Drawing.Size(50, 13) - Me.lbGasto.TabIndex = 53 - Me.lbGasto.Text = "Gasto de" - ' - 'ckCentral - ' - Me.ckCentral.AutoSize = True - Me.ckCentral.Location = New System.Drawing.Point(263, 291) - Me.ckCentral.Name = "ckCentral" - Me.ckCentral.Size = New System.Drawing.Size(85, 17) - Me.ckCentral.TabIndex = 12 - Me.ckCentral.Text = "UDA Central" - Me.ckCentral.UseVisualStyleBackColor = True - ' - 'ckLarioja - ' - Me.ckLarioja.AutoSize = True - Me.ckLarioja.BackColor = System.Drawing.SystemColors.Control - Me.ckLarioja.Location = New System.Drawing.Point(96, 291) - Me.ckLarioja.Name = "ckLarioja" - Me.ckLarioja.Size = New System.Drawing.Size(91, 17) - Me.ckLarioja.TabIndex = 11 - Me.ckLarioja.Text = "UDA La Rioja" - Me.ckLarioja.UseVisualStyleBackColor = False - ' - 'tbNombre - ' - 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(44, 85) - Me.tbNombre.Name = "tbNombre" - Me.tbNombre.Size = New System.Drawing.Size(197, 20) - Me.tbNombre.TabIndex = 1 - ' - 'lbMes - ' - Me.lbMes.AutoSize = True - Me.lbMes.Location = New System.Drawing.Point(42, 231) - Me.lbMes.Name = "lbMes" - Me.lbMes.Size = New System.Drawing.Size(91, 13) - Me.lbMes.TabIndex = 48 - Me.lbMes.Text = "Mes de Reintegro" - ' - 'lbComentario - ' - Me.lbComentario.AutoSize = True - Me.lbComentario.Location = New System.Drawing.Point(32, 378) - Me.lbComentario.Name = "lbComentario" - Me.lbComentario.Size = New System.Drawing.Size(60, 13) - Me.lbComentario.TabIndex = 46 - Me.lbComentario.Text = "Comentario" - ' - 'lbMonto - ' - Me.lbMonto.AutoSize = True - Me.lbMonto.Location = New System.Drawing.Point(453, 231) - Me.lbMonto.Name = "lbMonto" - Me.lbMonto.Size = New System.Drawing.Size(37, 13) - Me.lbMonto.TabIndex = 44 - Me.lbMonto.Text = "Monto" - ' - 'lbProveedor - ' - Me.lbProveedor.AutoSize = True - Me.lbProveedor.Location = New System.Drawing.Point(55, 183) - Me.lbProveedor.Name = "lbProveedor" - Me.lbProveedor.Size = New System.Drawing.Size(56, 13) - Me.lbProveedor.TabIndex = 42 - Me.lbProveedor.Text = "Proveedor" - ' - 'lbNombre - ' - Me.lbNombre.AutoSize = True - Me.lbNombre.Location = New System.Drawing.Point(41, 60) - Me.lbNombre.Name = "lbNombre" - Me.lbNombre.Size = New System.Drawing.Size(92, 13) - Me.lbNombre.TabIndex = 40 - Me.lbNombre.Text = "Nombre y Apellido" - ' - 'lbNComprobante - ' - Me.lbNComprobante.AutoSize = True - Me.lbNComprobante.Location = New System.Drawing.Point(425, 183) - Me.lbNComprobante.Name = "lbNComprobante" - Me.lbNComprobante.Size = New System.Drawing.Size(85, 13) - Me.lbNComprobante.TabIndex = 37 - Me.lbNComprobante.Text = "N° Comprobante" - ' - 'tbComentario - ' - Me.tbComentario.Location = New System.Drawing.Point(114, 357) - Me.tbComentario.Multiline = True - Me.tbComentario.Name = "tbComentario" - Me.tbComentario.Size = New System.Drawing.Size(317, 60) - Me.tbComentario.TabIndex = 13 - ' - 'tbProveedor - ' - Me.tbProveedor.Location = New System.Drawing.Point(155, 180) - Me.tbProveedor.Name = "tbProveedor" - Me.tbProveedor.Size = New System.Drawing.Size(156, 20) - Me.tbProveedor.TabIndex = 5 - ' - '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(288, 11) - Me.lb_Titulo.Name = "lb_Titulo" - Me.lb_Titulo.Size = New System.Drawing.Size(193, 38) - Me.lb_Titulo.TabIndex = 62 - Me.lb_Titulo.Text = "Nuevo Egreso" - ' - 'tbNComprobante - ' - Me.tbNComprobante.Location = New System.Drawing.Point(590, 180) - Me.tbNComprobante.Name = "tbNComprobante" - Me.tbNComprobante.Size = New System.Drawing.Size(97, 20) - Me.tbNComprobante.TabIndex = 9 - ' - 'ABMEgresos - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.AutoSize = True - Me.Controls.Add(Me.tbNComprobante) - Me.Controls.Add(Me.lb_Titulo) - Me.Controls.Add(Me.tbTComprobante) - Me.Controls.Add(Me.bttnConsultar) - Me.Controls.Add(Me.tbPVenta) - Me.Controls.Add(Me.tbReintegro) - Me.Controls.Add(Me.lbYear) - Me.Controls.Add(Me.lbMonth) - Me.Controls.Add(Me.lbDay) - Me.Controls.Add(Me.tbYear) - Me.Controls.Add(Me.tbMonth) - Me.Controls.Add(Me.tbDay) - Me.Controls.Add(Me.lbSmonto) - Me.Controls.Add(Me.lbTComprobante) - Me.Controls.Add(Me.tbMonto) - Me.Controls.Add(Me.tbGasto) - Me.Controls.Add(Me.btnGuardar) - Me.Controls.Add(Me.lbGasto) - Me.Controls.Add(Me.ckCentral) - Me.Controls.Add(Me.ckLarioja) - Me.Controls.Add(Me.tbNombre) - Me.Controls.Add(Me.lbMes) - Me.Controls.Add(Me.lbComentario) - Me.Controls.Add(Me.lbMonto) - Me.Controls.Add(Me.lbProveedor) - Me.Controls.Add(Me.lbNombre) - Me.Controls.Add(Me.lbNComprobante) - Me.Controls.Add(Me.tbComentario) - Me.Controls.Add(Me.tbProveedor) - Me.Name = "ABMEgresos" - Me.Size = New System.Drawing.Size(755, 456) - Me.ResumeLayout(False) - Me.PerformLayout() - - End Sub - Friend WithEvents tbTComprobante As System.Windows.Forms.ComboBox - Friend WithEvents bttnConsultar As System.Windows.Forms.Button - Friend WithEvents tbPVenta As System.Windows.Forms.TextBox - Friend WithEvents tbReintegro As System.Windows.Forms.TextBox - Friend WithEvents lbYear As System.Windows.Forms.Label - Friend WithEvents lbMonth As System.Windows.Forms.Label - Friend WithEvents lbDay As System.Windows.Forms.Label - Friend WithEvents tbYear As System.Windows.Forms.TextBox - Friend WithEvents tbMonth As System.Windows.Forms.TextBox - Friend WithEvents tbDay As System.Windows.Forms.TextBox - Friend WithEvents lbSmonto As System.Windows.Forms.Label - Friend WithEvents lbTComprobante As System.Windows.Forms.Label - Friend WithEvents tbMonto As System.Windows.Forms.TextBox - Friend WithEvents tbGasto As System.Windows.Forms.ComboBox - Friend WithEvents btnGuardar As System.Windows.Forms.Button - Friend WithEvents lbGasto As System.Windows.Forms.Label - Friend WithEvents ckCentral As System.Windows.Forms.CheckBox - Friend WithEvents ckLarioja As System.Windows.Forms.CheckBox - Friend WithEvents tbNombre As System.Windows.Forms.TextBox - Friend WithEvents lbMes As System.Windows.Forms.Label - Friend WithEvents lbComentario As System.Windows.Forms.Label - Friend WithEvents lbMonto As System.Windows.Forms.Label - Friend WithEvents lbProveedor As System.Windows.Forms.Label - Friend WithEvents lbNombre As System.Windows.Forms.Label - Friend WithEvents lbNComprobante As System.Windows.Forms.Label - Friend WithEvents tbComentario As System.Windows.Forms.TextBox - Friend WithEvents tbProveedor As System.Windows.Forms.TextBox - Friend WithEvents lb_Titulo As System.Windows.Forms.Label - Friend WithEvents tbNComprobante As System.Windows.Forms.TextBox - -End Class diff --git a/SireCu/Egresos/ABMEgresos.vb b/SireCu/Egresos/ABMEgresos.vb deleted file mode 100644 index 5773901..0000000 --- a/SireCu/Egresos/ABMEgresos.vb +++ /dev/null @@ -1,359 +0,0 @@ -Imports System.Data.SqlServerCe - -Public Class ABMEgresos - - Private Sub ABMEgresos_Load(sender As Object, e As EventArgs) Handles MyBase.Load - tbYear.Text = ultimoaño() - tbNombre.Focus() - End Sub - - Private Sub btnGuardar_Click(sender As Object, e As EventArgs) Handles btnGuardar.Click - - Dim chkFecha As String = "" - - 'Campos requeridos que están vacios - If (camposVacios() = True) Then - Exit Sub - Else - 'Fechas inválidas - If (fechainvalida(chkFecha) = True) Then - Exit Sub - Else - 'Comprobante repetido - If (esrepetido() = True) Then - Exit Sub - Else - 'Ingresos disponibles - If (hayingresos() = False) Then - 'No cuenta con ingresos - Else - 'GUARDAR - If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Guardar?") = MsgBoxResult.Ok) Then - - Dim sql As String = "" - sql = "INSERT INTO egresos (num_comprobante, pventa, proveedor, tipo_gasto, nombre, " + _ - "fecha, tipo_comprobante, mes, uda, comentario, monto, dia) VALUES " + _ - "(@ncomp,@pventa,@provee,@tgasto,@nombre,@fecha,@tcompr,@mes,@uda,@comen,@monto,@dia)" - Dim command As New SqlCeCommand - command.Parameters.AddWithValue("@ncomp", tbNComprobante.Text) - command.Parameters.AddWithValue("@pventa", tbPVenta.Text) - command.Parameters.AddWithValue("@provee", tbProveedor.Text) - command.Parameters.AddWithValue("@tgasto", tbGasto.Text) - command.Parameters.AddWithValue("@nombre", tbNombre.Text) - command.Parameters.AddWithValue("@fecha", chkFecha) - command.Parameters.AddWithValue("@tcompr", tbTComprobante.Text) - command.Parameters.AddWithValue("@mes", tbReintegro.Text) - If ckCentral.Checked = True Then - command.Parameters.AddWithValue("@uda", ckCentral.Text) - Else : command.Parameters.AddWithValue("@uda", ckLarioja.Text) - End If - command.Parameters.AddWithValue("@comen", tbComentario.Text) - command.Parameters.AddWithValue("@monto", tbMonto.Text) - command.Parameters.AddWithValue("@dia", Now) - 'Consultamos - consultarNQ(sql, command) - 'Desconectamos - - - 'Actualizamos tabla de saldos - 'saldosUpdate() - End If - End If - End If - End If - End If - - End Sub - - - 'Verificación de ingresos disponibles - Private Function hayingresos() - - 'Solamente consultamos el saldo disponible del trimestre que se quiere cargar - Dim command As New SqlCeCommand - Dim adapter As SqlCeDataAdapter - Dim dataset As New DataSet - dataset.Tables.Add("saldos") - Dim sql As String = "SELECT saldo FROM saldos WHERE trimestre=@trim" - Dim trimestre As String = "" - - If ((tbMonth.Text = "01") Or (tbMonth.Text = "1") Or (tbMonth.Text = "02") Or (tbMonth.Text = "2") Or _ - (tbMonth.Text = "03") Or (tbMonth.Text = "3")) Then - trimestre = "Primero" - ElseIf ((tbMonth.Text = "04") Or (tbMonth.Text = "4") Or (tbMonth.Text = "05") Or (tbMonth.Text = "5") Or _ - (tbMonth.Text = "06") Or (tbMonth.Text = "6")) Then - trimestre = "Segundo" - ElseIf ((tbMonth.Text = "07") Or (tbMonth.Text = "7") Or (tbMonth.Text = "08") Or (tbMonth.Text = "8") Or _ - (tbMonth.Text = "09") Or (tbMonth.Text = "9")) Then - trimestre = "Tercero" - ElseIf ((tbMonth.Text = "10") Or (tbMonth.Text = "11") Or (tbMonth.Text = "12")) Then - trimestre = "Cuarto" - End If - command.Parameters.AddWithValue("@trim", trimestre) - - 'Consultamos la BD - - consultarNQ(sql, command) - - 'Sacamos el resultado - adapter = New SqlCeDataAdapter(command) - adapter.Fill(dataset.Tables("saldos")) - - If (dataset.Tables("saldos").Rows.Count() <> 0) Then - 'Comparamos saldo disponible vs monto ingresado - If (Val(tbMonto.Text) <= Val(dataset.Tables("egresos").Rows.Item(0).Item("monto"))) Then - Return (True) - Else - MsgBox("Su saldo será NEGATIVO", MsgBoxStyle.Critical, "Warning") - Return (False) - End If - Else - MsgBox("No se cargaron ingresos para el trimestre: " + trimestre + " Año: " + tbYear.Text, _ - MsgBoxStyle.Critical, "Warning") - Return (False) - End If - - - End Function - 'Verificación de comprobante repetido - Private Function esrepetido() - - Dim command As New SqlCeCommand - Dim adapter As SqlCeDataAdapter - Dim query As String = "SELECT num_comprobante, proveedor FROM egresos WHERE (num_comprobante=@compro) AND (pventa=@pventa) AND (proveedor=@provee)" - Dim dataset As DataSet = New DataSet - dataset.Tables.Add("egresos") - command.Parameters.AddWithValue("@compro", tbNComprobante.Text) - command.Parameters.AddWithValue("@provee", tbProveedor.Text) - command.Parameters.AddWithValue("@pventa", tbPVenta.Text) - - 'Consultamos la BD - - consultarNQ(query, command) - - adapter = New SqlCeDataAdapter(command) - adapter.Fill(dataset.Tables("egresos")) - - If (dataset.Tables("egresos").Rows.Count() <> 0) Then - MsgBox("Ese comprobante ya fue cargado", MsgBoxStyle.Critical, "Error") - Return True - Else - Return False - End If - - End Function - 'Verificación de campos obligatorios - Private Function camposVacios() - 'NOMBRE - If (tbNombre.Text = Nothing) Then - MsgBox("Ingrese un Nombre", MsgBoxStyle.Exclamation, "Error") - tbNombre.BackColor = Color.LightSalmon - tbNombre.Focus() - Return (True) - Else : tbNombre.BackColor = Color.White - End If - 'TIPO DE GASTO - If (tbGasto.Text = Nothing) Then - MsgBox("Ingrese un tipo de Gasto", MsgBoxStyle.Exclamation, "Error") - tbGasto.BackColor = Color.LightSalmon - tbGasto.Focus() - Return (True) - Else : tbGasto.BackColor = Color.White - End If - 'PROVEEDOR - If (tbProveedor.Text = Nothing) Then - MsgBox("Ingrese un Proveedor", MsgBoxStyle.Exclamation, "Error") - tbProveedor.BackColor = Color.LightSalmon - tbProveedor.Focus() - Return (True) - Else : tbProveedor.BackColor = Color.White - End If - 'MES DE REINTEGRO - If (tbReintegro.Text = "") Then - tbReintegro.Text = "00" - End If - If (tbReintegro.Text > 12) Then - MsgBox("Mes de Reintegro Erroneo (Mayor a 12)", MsgBoxStyle.Exclamation, "Error") - tbReintegro.BackColor = Color.LightSalmon - tbReintegro.Focus() - Return (True) - Else : tbReintegro.BackColor = Color.White - End If - 'UDA LA RIOJA O CENTRAL - If (ckCentral.Checked = False) And (ckLarioja.Checked = False) Then - MsgBox("Seleccione UDA Central o LR", MsgBoxStyle.Exclamation, "Error") - ckCentral.BackColor = Color.LightSalmon - ckLarioja.BackColor = Color.LightSalmon - Return (True) - Else - ckCentral.BackColor = Color.FromArgb(240, 240, 240) - ckLarioja.BackColor = Color.FromArgb(240, 240, 240) - End If - 'Tipo de Comprobante - If (tbTComprobante.Text = Nothing) Then - MsgBox("Ingrese un Tipo de Comprobante", MsgBoxStyle.Exclamation, "Error") - tbTComprobante.BackColor = Color.LightSalmon - tbTComprobante.Focus() - Return (True) - Else : tbTComprobante.BackColor = Color.White - End If - 'NUMERO DE COMPROBANTE - If (tbNComprobante.Text = Nothing) Then - MsgBox("Ingrese un Número de Comprobante", MsgBoxStyle.Exclamation, "Error") - tbNComprobante.BackColor = Color.LightSalmon - tbPVenta.BackColor = Color.LightSalmon - tbPVenta.Focus() - Return (True) - Else - tbNComprobante.BackColor = Color.White - tbPVenta.BackColor = Color.White - End If - 'MONTO - If (tbMonto.Text = Nothing) Then - MsgBox("Ingrese el Monto", MsgBoxStyle.Exclamation, "Error") - tbMonto.BackColor = Color.LightSalmon - tbMonto.Focus() - Return (True) - Else : tbMonto.BackColor = Color.White - End If - - 'Si no hay error - Return (False) - - End Function - 'Verificación de fechas inválidas - Private Function fechainvalida(ByRef chkFecha As String) - chkFecha = tbDay.Text & "/" & tbMonth.Text & "/" & tbYear.Text - - 'Box vacio - If (chkFecha = Nothing) Then - MsgBox("Ingrese una Fecha", MsgBoxStyle.Exclamation, "Error") - tbDay.BackColor = Color.LightSalmon - tbMonth.BackColor = Color.LightSalmon - tbDay.Focus() - Return (True) - Else - tbDay.BackColor = Color.White - tbMonth.BackColor = Color.White - End If - - 'Fecha tipo Datetime - If (IsDate(chkFecha) = False) Then - MsgBox("Fecha iválida", MsgBoxStyle.Exclamation, "Error") - tbDay.BackColor = Color.LightSalmon - tbMonth.BackColor = Color.LightSalmon - tbDay.Focus() - Return (True) - Else - tbDay.BackColor = Color.White - tbMonth.BackColor = Color.White - End If - - 'Si no hay error - Return (False) - - End Function - Private Sub saldosUpdate(ByVal saldo As Double, ByVal trimestre As String) - Dim sql As String = "UPDATE saldos SET saldo=@saldo WHERE trimestre = @trimestre" - Dim command As New SqlCeCommand - command.Parameters.AddWithValue("@ncomp", tbNComprobante.Text) - command.Parameters.AddWithValue("@trimestre", trimestre) - command.Parameters.AddWithValue("@saldo", saldo) - - consultarNQ(sql, command) - - End Sub - - - 'Cambiar el año con doble click - Private Sub ABMIngresos_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles Me.MouseDoubleClick - If e.X > tbYear.Location.X And e.X < tbYear.Location.X + tbYear.Width And _ - e.Y > tbYear.Location.Y And e.Y < tbYear.Location.Y + tbYear.Height Then - tbYear.Enabled = True - Else - End If - tbYear.Focus() - End Sub - 'Al perder el foco el año - Private Sub tbYear_LostFocus(sender As Object, e As EventArgs) Handles tbYear.LostFocus - tbYear.Enabled = False - End Sub - 'Ver el último año cargado - Private Function ultimoaño() - - Dim command As New SqlCeCommand - Dim adapter As SqlCeDataAdapter - Dim query As String = "SELECT año FROM ingresos ORDER BY año DESC" - Dim dataset As DataSet = New DataSet - dataset.Tables.Add("ingresos") - - 'Consultamos la BD - - consultarNQ(query, command) - - adapter = New SqlCeDataAdapter(command) - adapter.Fill(dataset.Tables("ingresos")) - - If (dataset.Tables("ingresos").Rows.Count() = 0) Then - Return (0) - Else : Return (dataset.Tables("ingresos").Rows.Item(0).Item("año")) - End If - - End Function - - - 'No se pueden checkear los dos al mismo tiempo - Private Sub ckLarioja_CheckedChanged(sender As Object, e As EventArgs) Handles ckLarioja.CheckedChanged - If ckCentral.Checked = True Then - ckLarioja.CheckState = CheckState.Unchecked - End If - End Sub - Private Sub ckCentral_CheckedChanged(sender As Object, e As EventArgs) Handles ckCentral.CheckedChanged - If ckLarioja.Checked = True Then - ckCentral.CheckState = CheckState.Unchecked - End If - End Sub - - - 'Verificación de entrada de numeros - Private Sub chkKey(ByVal e As System.Windows.Forms.KeyPressEventArgs) - If Char.IsLetter(e.KeyChar) Then 'Letras -> no - e.Handled = True - ElseIf Char.IsControl(e.KeyChar) Then 'Caracter de control -> si - e.Handled = False - ElseIf Char.IsSeparator(e.KeyChar) Then 'Espacio en blanco -> no - e.Handled = True - ElseIf Char.IsDigit(e.KeyChar) Then 'Numeros -> si - e.Handled = False - Else : e.Handled = True - End If - End Sub - Private Sub tbReintegro_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbReintegro.KeyPress - chkKey(e) - End Sub - Private Sub tbDay_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbDay.KeyPress - chkKey(e) - End Sub - Private Sub tbMonth_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbMonth.KeyPress - chkKey(e) - End Sub - Private Sub tbYear_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbYear.KeyPress - chkKey(e) - If e.KeyChar = ChrW(Keys.Enter) Then - tbYear.Enabled = False - End If - End Sub - Private Sub tbNComprobante_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbNComprobante.KeyPress - chkKey(e) - End Sub - Private Sub tbPVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbPVenta.KeyPress - chkKey(e) - End Sub - Private Sub tbMonto_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbMonto.KeyPress - chkKey(e) - If (e.KeyChar = ",") Then 'Comas -> si - e.Handled = False - End If - End Sub - -End Class diff --git a/SireCu/OtrasFunciones.vb b/SireCu/OtrasFunciones.vb index 750eb5f..fec164a 100644 --- a/SireCu/OtrasFunciones.vb +++ b/SireCu/OtrasFunciones.vb @@ -9,64 +9,165 @@ Module OtrasFunciones ' 3) Restamos lo obtenido con el total de Egresos del trimestre actual Dim trimAnterior As String = "" - Dim trimAnteriorAño As Integer = año + Dim añoAnterior As Integer = año - 1 Dim queryEgresos As String = "" Dim queryIngresos As String = "" - Dim saldoAnterior As Decimal = 0 - Dim ingresos As Decimal = 0 - Dim egresos As Decimal = 0 + Dim saldoAnterior As Double = 0 + Dim ingresos As Double = 0 + Dim egresos As Double = 0 Select Case trimestre Case "Primero" trimAnterior = "Cuarto" - trimAnteriorAño -= 1 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ño + " 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 + 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 + " 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 + 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 + " 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 + 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 + "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 + 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) - Principal.query = "SELECT [saldo_final] FROM [ReportesTrimestrales] INNER JOIN [Trimestres] ON [Trimestres.nombre] =" & - trimAnterior & " AND año=" & trimAnteriorAño + Select Case trimestre + Case "Primero" + Principal.query = "SELECT [saldo_final] FROM [ReportesTrimestrales] INNER JOIN [Trimestres] ON [nombre] = '" & + trimAnterior & "' AND año= '" & añoAnterior & "'" + Case Else + Principal.query = "SELECT [saldo_final] FROM [ReportesTrimestrales] INNER JOIN [Trimestres] ON [nombre] = '" & + trimAnterior & "' AND año= '" & año & "'" + End Select + saldoAnterior = consultarES(Principal.query, Principal.command) ' 2) - ingresos = consultarES(queryIngresos, Principal.command) + Dim resultadoConsulta = consultarES(queryIngresos, Principal.command) + ingresos = IIf(IsDBNull(resultadoConsulta), 0, resultadoConsulta) + ' 3) - egresos = consultarES(queryEgresos, Principal.command) + resultadoConsulta = Nothing + resultadoConsulta = consultarES(queryEgresos, Principal.command) + egresos = IIf(IsDBNull(resultadoConsulta), 0, resultadoConsulta) Return (saldoAnterior + ingresos - egresos) End Function - Public Sub ClearDataset(ByVal dataset As DataSet) - Principal.dataset.Tables("Ingresos").Clear() - Principal.dataset.Tables("Egresos").Clear() - Principal.dataset.Tables("Saldos").Clear() + Public Sub keyverify(ByVal e As System.Windows.Forms.KeyPressEventArgs, + Optional ByVal letras As Boolean = False, + Optional ByVal numeros As Boolean = False, + Optional ByVal comas As Boolean = False, + Optional ByVal puntosAComas As Boolean = False, + Optional ByVal espacios As Boolean = False, + Optional ByVal control As Boolean = True, + Optional ByVal otros As Boolean = False) + + If Char.IsLetter(e.KeyChar) Then ' Permite o cancela ingreso de letras + e.Handled = Not letras + ElseIf Char.IsDigit(e.KeyChar) Then ' Permite o cancela ingreso de numeros + e.Handled = Not numeros + ElseIf e.KeyChar = "," Then ' Permite o cancela ingreso de comas + e.Handled = Not comas + ElseIf comas And e.KeyChar = "." Then ' Si se permiten comas y el caracter es un punto + If puntosAComas Then ' Permite o cancela la sustitución de punto por coma + e.KeyChar = "," + e.Handled = False + Else + e.Handled = True + End If + ElseIf Char.IsSeparator(e.KeyChar) Then ' Permite o cancela ingreso de espacios + e.Handled = Not espacios + ElseIf Char.IsControl(e.KeyChar) Then ' Permite o cancela ingreso caracteres de control + e.Handled = Not control + Else + e.Handled = Not otros ' Permite o cancela ingreso de otros caracteres + End If + + End Sub + + Public Function ultimoaño(ByVal tabla As String) + + Principal.query = "SELECT fecha FROM " & tabla & " ORDER BY fecha DESC" + + Dim data As DataTable = consultarReader(Principal.query) + + If (data.Rows.Count() = 0) Then + Return (Now.Date.Year.ToString) + Else : Return (DatePart(DateInterval.Year, data.Rows.Item(0).Item("fecha"))) + End If + + End Function + + Public Function exist(ByVal tabla As String, ByVal campo As String, ByVal comparar As String) + + 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 + + Return flag + + End Function + + Public Function autocomplete(ByVal tabla As String, ByVal Campo_a_Mostrar As String) + + Dim coleccion As New AutoCompleteStringCollection + + cargarTablaEnDataSet(tabla) + + For Each row As DataRow In Principal.dataset.Tables(tabla).Rows + coleccion.Add(Convert.ToString(row.Item(Campo_a_Mostrar))) + Next + + Return (coleccion) + + 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/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/Egresos/ABMEgresos.resx b/SireCu/Paneles/ABMAdmin.resx similarity index 100% rename from SireCu/Egresos/ABMEgresos.resx rename to SireCu/Paneles/ABMAdmin.resx 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/Paneles/ABMEgresos.Designer.vb b/SireCu/Paneles/ABMEgresos.Designer.vb new file mode 100644 index 0000000..31c571f --- /dev/null +++ b/SireCu/Paneles/ABMEgresos.Designer.vb @@ -0,0 +1,1379 @@ + _ +Partial Class ABMEgresos + 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() + 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() + 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.tbNComprobante = New System.Windows.Forms.TextBox() + 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.btnGuardar = New System.Windows.Forms.Button() + Me.lbGasto = New System.Windows.Forms.Label() + Me.tbNombre = New System.Windows.Forms.TextBox() + Me.lbMes = New System.Windows.Forms.Label() + Me.lbComentario = New System.Windows.Forms.Label() + Me.lbMonto = New System.Windows.Forms.Label() + Me.lbProveedor = New System.Windows.Forms.Label() + Me.lbNombre = New System.Windows.Forms.Label() + 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.ToolStripContainerModificar = New System.Windows.Forms.ToolStripContainer() + 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() + 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() + 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.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.ToolStripContainerModificar.ContentPanel.SuspendLayout() + Me.ToolStripContainerModificar.RightToolStripPanel.SuspendLayout() + Me.ToolStripContainerModificar.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 + ' + 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) + Me.TabControl.Name = "TabControl" + Me.TabControl.SelectedIndex = 0 + Me.TabControl.Size = New System.Drawing.Size(755, 456) + Me.TabControl.TabIndex = 0 + Me.TabControl.TabStop = False + ' + 'TabPageAgregar + ' + Me.TabPageAgregar.Controls.Add(Me.GroupBoxAgregar) + Me.TabPageAgregar.Controls.Add(Me.lb_Titulo) + Me.TabPageAgregar.Location = New System.Drawing.Point(4, 25) + Me.TabPageAgregar.Name = "TabPageAgregar" + Me.TabPageAgregar.Padding = New System.Windows.Forms.Padding(3) + Me.TabPageAgregar.Size = New System.Drawing.Size(747, 427) + Me.TabPageAgregar.TabIndex = 0 + 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(539, 84) + Me.cbTComprobante.Name = "cbTComprobante" + Me.cbTComprobante.Size = New System.Drawing.Size(163, 24) + 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(153, 219) + Me.cbSeccional.Name = "cbSeccional" + Me.cbSeccional.Size = New System.Drawing.Size(156, 24) + 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(153, 84) + Me.cbTGasto.Name = "cbTGasto" + Me.cbTGasto.Size = New System.Drawing.Size(156, 24) + Me.cbTGasto.TabIndex = 459 + ' + 'lbFecha + ' + Me.lbFecha.AutoSize = True + 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 = 480 + Me.lbFecha.Text = "Fecha:" + ' + 'dtpFecha + ' + Me.dtpFecha.CustomFormat = "" + Me.dtpFecha.Format = System.Windows.Forms.DateTimePickerFormat.[Short] + 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 = 463 + Me.dtpFecha.Value = New Date(2017, 3, 4, 19, 31, 9, 0) + ' + '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(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 = 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(34, 222) + Me.lbSeccional.Name = "lbSeccional" + Me.lbSeccional.Size = New System.Drawing.Size(68, 16) + Me.lbSeccional.TabIndex = 479 + Me.lbSeccional.Text = "Seccional" + ' + 'tbNComprobante + ' + 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 = 466 + ' + 'tbPVenta + ' + 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 = 465 + ' + 'lbSmonto + ' + Me.lbSmonto.AutoSize = True + 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 = 478 + Me.lbSmonto.Text = "$" + ' + 'lbTComprobante + ' + Me.lbTComprobante.AutoSize = True + 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 = 477 + Me.lbTComprobante.Text = "Tipo de Comprobante" + ' + 'tbMonto + ' + 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 = 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(553, 278) + Me.btnGuardar.Name = "btnGuardar" + Me.btnGuardar.Size = New System.Drawing.Size(126, 61) + Me.btnGuardar.TabIndex = 469 + Me.btnGuardar.Text = "Guardar" + Me.btnGuardar.UseVisualStyleBackColor = True + ' + 'lbGasto + ' + Me.lbGasto.AutoSize = True + 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 = 476 + Me.lbGasto.Text = "Gasto de" + ' + 'tbNombre + ' + 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(153, 40) + Me.tbNombre.Name = "tbNombre" + Me.tbNombre.Size = New System.Drawing.Size(197, 22) + Me.tbNombre.TabIndex = 458 + ' + 'lbMes + ' + Me.lbMes.AutoSize = True + 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 = 475 + Me.lbMes.Text = "Mes de Reintegro" + ' + 'lbComentario + ' + Me.lbComentario.AutoSize = True + 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 = 474 + Me.lbComentario.Text = "Comentario" + ' + 'lbMonto + ' + Me.lbMonto.AutoSize = True + 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 = 473 + Me.lbMonto.Text = "Monto" + ' + 'lbProveedor + ' + Me.lbProveedor.AutoSize = True + 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 = 472 + Me.lbProveedor.Text = "Proveedor" + ' + 'lbNombre + ' + Me.lbNombre.AutoSize = True + 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 = 471 + Me.lbNombre.Text = "Nombre y Apellido" + ' + 'lbNComprobante + ' + Me.lbNComprobante.AutoSize = True + 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 = 470 + Me.lbNComprobante.Text = "N° Comprobante" + ' + 'tbComentario + ' + 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 = 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(153, 129) + Me.tbProveedor.Name = "tbProveedor" + Me.tbProveedor.Size = New System.Drawing.Size(156, 22) + 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 + ' + 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) + Me.TabPageModificar.Size = New System.Drawing.Size(747, 427) + Me.TabPageModificar.TabIndex = 1 + Me.TabPageModificar.Text = "Modificar" + Me.TabPageModificar.UseVisualStyleBackColor = True + ' + 'ToolStripContainerModificar + ' + Me.ToolStripContainerModificar.BottomToolStripPanelVisible = False + ' + 'ToolStripContainerModificar.ContentPanel + ' + 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" + ' + '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 + ' + '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 + ' + 'SplitContainerModificar.Panel1 + ' + Me.SplitContainerModificar.Panel1.Controls.Add(Me.DGVModificar) + ' + 'SplitContainerModificar.Panel2 + ' + 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 + ' + 'DGVModificar + ' + 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 + ' + '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 + ' + 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 + ' + '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(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 + ' + 'LabelSeccional + ' + 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" + ' + '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(133, 127) + Me.ComboBoxSeccional.Name = "ComboBoxSeccional" + Me.ComboBoxSeccional.Size = New System.Drawing.Size(160, 24) + Me.ComboBoxSeccional.TabIndex = 95 + ' + 'DateTimePickerMesReintegro + ' + 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 + ' + 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:" + ' + 'DateTimePickerFecha + ' + 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) + ' + 'TextBoxNroComprobante + ' + 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 + ' + 'ComboBoxTipoComprobante + ' + 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 + ' + 'TextBoxPVenta + ' + 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 + ' + 'Label4 + ' + 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 = "$" + ' + 'Label5 + ' + 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" + ' + 'TextBoxMonto + ' + 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 = "" + ' + '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(133, 41) + Me.ComboBoxCategGasto.Name = "ComboBoxCategGasto" + Me.ComboBoxCategGasto.Size = New System.Drawing.Size(160, 24) + Me.ComboBoxCategGasto.TabIndex = 92 + ' + '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(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 + ' + 'Label6 + ' + 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" + ' + '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(133, 13) + Me.TextBoxNombre.Name = "TextBoxNombre" + Me.TextBoxNombre.Size = New System.Drawing.Size(160, 22) + Me.TextBoxNombre.TabIndex = 91 + ' + 'Label7 + ' + 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" + ' + 'Label8 + ' + 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" + ' + 'Label9 + ' + 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" + ' + 'Label10 + ' + 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" + ' + 'Label11 + ' + 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" + ' + 'Label12 + ' + 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" + ' + 'TextBoxComentario + ' + 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 + ' + 'TextBoxProveedor + ' + 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 + ' + '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.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 + ' + 'TSLabelMes + ' + 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 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.AutoSize = True + Me.Controls.Add(Me.TabControl) + Me.Name = "ABMEgresos" + Me.Size = New System.Drawing.Size(755, 456) + Me.TabControl.ResumeLayout(False) + Me.TabPageAgregar.ResumeLayout(False) + Me.TabPageAgregar.PerformLayout() + Me.GroupBoxAgregar.ResumeLayout(False) + Me.GroupBoxAgregar.PerformLayout() + Me.TabPageModificar.ResumeLayout(False) + Me.ToolStripContainerModificar.ContentPanel.ResumeLayout(False) + Me.ToolStripContainerModificar.RightToolStripPanel.ResumeLayout(False) + Me.ToolStripContainerModificar.RightToolStripPanel.PerformLayout() + Me.ToolStripContainerModificar.ResumeLayout(False) + Me.ToolStripContainerModificar.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 lb_Titulo As Label + Friend WithEvents TabPageModificar As TabPage + 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 bPapeleraVaciarPapelera As Button + Friend WithEvents bPapeleraEliminar As Button + 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 + 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 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 new file mode 100644 index 0000000..fce0394 --- /dev/null +++ b/SireCu/Paneles/ABMEgresos.resx @@ -0,0 +1,358 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + 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== + + + + + 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 + + + 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 new file mode 100644 index 0000000..aee77e2 --- /dev/null +++ b/SireCu/Paneles/ABMEgresos.vb @@ -0,0 +1,963 @@ +Imports System.ComponentModel +Imports System.Data.SqlServerCe + +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 + Dim idPapelera As Integer = 0 + + +#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") + Exit Sub + End If + + 'Verificar Saldo Disponible + Dim saldo As Double + Select Case DatePart(DateInterval.Month, dtpFecha.Value) + Case 1 To 3 + saldo = SaldoActual("Primero", DatePart(DateInterval.Year, dtpFecha.Value)) + Case 4 To 6 + saldo = SaldoActual("Segundo", DatePart(DateInterval.Year, dtpFecha.Value)) + Case 7 To 9 + saldo = SaldoActual("Tercero", DatePart(DateInterval.Year, dtpFecha.Value)) + Case 10 To 12 + 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 + 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 + + Dim comprobante As String + If (tbPVenta.Text = "0") Or (tbPVenta.Text = "") Then + comprobante = tbNComprobante.Text + Else + comprobante = tbPVenta.Text & "-" & tbNComprobante.Text + End If + Dim reintegro As Date + If dtpReintegro.Checked Then + reintegro = dtpReintegro.Value.Date + Else reintegro = dtpFecha.Value.Date + End If + + + ' GUARDAR + If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Guardar?") = MsgBoxResult.Ok) Then + + nuevo_egreso( + comprobante, + obtenerID(tbProveedor.Text, "Proveedores"), + cbTGasto.SelectedValue, + obtenerID(tbNombre.Text, "Personas"), + dtpFecha.Value.Date, + cbTComprobante.SelectedValue, + cbSeccional.SelectedValue, + reintegro, + CDbl(tbMonto.Text), + tbComentario.Text + ) + + limpiarForm(GroupBoxAgregar) + dtpReintegro.Checked = False + CargardDGV(DGVModificar) + ActualizarSaldo() + End If + + End Sub + +#End Region + +#Region "TAB Modificar - Eventos" + + 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 + 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) + DateTimePickerMesReintegro.Checked = False + Else + DateTimePickerMesReintegro.Value = CDate(DGVModificar.Rows(e.RowIndex).Cells("mes_reintegro").Value) + DateTimePickerMesReintegro.Checked = True + 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 + + activarModificar(True) + End If + + End Sub + + Private Sub DGVModificar_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DGVModificar.CellContentClick + 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 + 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 DGVModificar_RowPostPaint(sender As Object, e As DataGridViewRowPostPaintEventArgs) Handles DGVModificar.RowPostPaint + + Dim dgvRow As DataGridViewRow = DGVModificar.Rows(e.RowIndex) + + If dgvRow.Cells(1).Value = True Then + dgvRow.DefaultCellStyle.BackColor = Color.Honeydew + Else + dgvRow.DefaultCellStyle.BackColor = Color.White + 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 + If ControlesConErroresModificar.Count > 0 Then + MsgBox("Por favor revise los campos ingresados", MsgBoxStyle.Exclamation, "Error") + Exit Sub + End If + + 'Verificar Saldo Disponible + 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 + + 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 + + Dim comprobante As String + If (TextBoxPVenta.Text = 0) Or (TextBoxPVenta.Text = "") Then + comprobante = TextBoxNroComprobante.Text + Else + comprobante = TextBoxPVenta.Text & "-" & TextBoxNroComprobante.Text + End If + Dim reintegro As Date + If DateTimePickerMesReintegro.Checked Then + reintegro = DateTimePickerMesReintegro.Value.Date + Else reintegro = DateTimePickerFecha.Value.Date + End If + + + ' MODIFICAR + If (MsgBox("Está seguro?", MsgBoxStyle.OkCancel, "Guardar?") = MsgBoxResult.Ok) Then + + modificar_egreso( + idModificando, + comprobante, + obtenerID(TextBoxProveedor.Text, "Proveedores"), + ComboBoxCategGasto.SelectedValue, + obtenerID(TextBoxNombre.Text, "Personas"), + DateTimePickerFecha.Value.Date, + ComboBoxTipoComprobante.SelectedValue, + ComboBoxSeccional.SelectedValue, + reintegro, + CDec(TextBoxMonto.Text), + TextBoxComentario.Text + ) + + idModificando = 0 + limpiarForm(SplitContainerModificar.Panel2) + activarModificar(False) + CargardDGV(DGVModificar) + ActualizarSaldo() + End If + + 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_soft(idModificando) + + idModificando = 0 + limpiarForm(SplitContainerModificar.Panel2) + activarModificar(False) + CargardDGV(DGVModificar) + CargardDGV(DGVPapelera, 1, "Egresos_Papelera") + ActualizarSaldo() + 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 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 + + 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 + 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, + 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 + 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 + + ElseIf keyv.Key = "mes" Then + + ' Filtrar por mes + sql += " AND DATEPART(month, [fecha]) = " & keyv.Value + + Else + + ' Filtros adicionales + Select Case keyv.Key + Case "Nro Comprobante=" + sql += " AND E.nro_comprobante = '" & keyv.Value & "'" + Case "Nro Comprobante*" + sql += " AND E.nro_comprobante LIKE '%" & keyv.Value & "%'" + + Case "Tipo Comprobante=" + sql += " AND Comp.nombre = '" & keyv.Value & "'" + Case "Tipo Comprobante*" + sql += " AND Comp.nombre LIKE '%" & keyv.Value & "%'" + + Case "Proveedor=" + sql += " AND Pro.nombre = '" & keyv.Value & "'" + Case "Proveedor*" + sql += " AND Pro.nombre LIKE '%" & keyv.Value & "%'" + + Case "Categoria Gasto=" + sql += " AND Gastos.nombre = '" & keyv.Value & "'" + Case "Categoria Gasto*" + sql += " AND Gastos.nombre LIKE '%" & keyv.Value & "%'" + + Case "Persona=" + sql += " AND Per.nombre = '" & keyv.Value & "'" + 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 "Seccional*" + sql += " AND Secc.nombre LIKE '%" & keyv.Value & "%'" + + 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 & "'" + 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 "Comentario*" + sql += " AND E.comentario LIKE '%" & keyv.Value & "%'" + + Case "Seleccionado=", "Seleccionado*" + sql += " AND E.seleccionado = " & keyv.Value + Case Else + Exit Select + End Select + End If + Next + + sql += " ORDER BY E.id DESC" + + FiltrarDGV(DGVModificar, sql) + + 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" + Private Sub DGVPapelera_CellMouseDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DGVPapelera.CellMouseDoubleClick + ' Asignar el id a restaurar + idPapelera = CInt(DGVPapelera.Rows(e.RowIndex).Cells("PapeleraId").Value) + bPapeleraRestaurar.Enabled = True + bPapeleraEliminar.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 + CargardDGV(DGVPapelera, 1, "Egresos_Papelera") + 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 + + 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 + bPapeleraEliminar.Enabled = False + End If + End Sub + +#End Region + +#Region "Eventos" + + Private Sub ABMEgresos_Load(sender As Object, e As EventArgs) Handles MyBase.Load + + ' ######################################## TAB Agregar + + ' Campos Obligatorios + CamposObligatios.AddRange({tbNombre, + cbTGasto, + cbTComprobante, + tbProveedor, + tbNComprobante, + tbMonto, + cbSeccional}) + + dtpFecha.Value = Now + dtpReintegro.Value = Now + dtpReintegro.Checked = False + ' Autocomplete al escribir + tbProveedor.AutoCompleteCustomSource = autocomplete("Proveedores", "nombre") + tbNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") + cbTGasto.AutoCompleteCustomSource = autocomplete("CategoriasGastos", "nombre") + cbTComprobante.AutoCompleteCustomSource = autocomplete("TiposComprobantes", "nombre") + cbSeccional.AutoCompleteCustomSource = autocomplete("Seccionales", "nombre") + ' Colección de Items + 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 + + activarModificar(False) + CargardDGV(DGVModificar) + + ' Autocomplete al escribir + TextBoxNombre.AutoCompleteCustomSource = autocomplete("Personas", "nombre") + ComboBoxCategGasto.AutoCompleteCustomSource = autocomplete("CategoriasGastos", "nombre") + TextBoxProveedor.AutoCompleteCustomSource = autocomplete("Proveedores", "nombre") + 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" + ComboBoxTipoComprobante.ValueMember = "id" + ComboBoxTipoComprobante.DisplayMember = "nombre" + ' Setup Panel + DateTimePickerMesReintegro.Value = Now + DateTimePickerFecha.Value = Now + + + ' ######################################## TAB Papelera + CargardDGV(DGVPapelera, 1, "Egresos_Papelera") + + End Sub + +#End Region + +#Region "Helpers" + + Private Function obtenerID(ByVal Campo_a_comparar As String, ByVal tabla As String) As Integer + Dim id As Integer = -1 + + 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 Or TypeOf control Is DateTimePicker Then + control.Enabled = True + 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 + control.Enabled = False + End If + Next + ButtonGuardar.Enabled = False + ButtonEliminar.Enabled = False + 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 = "" + control.text = "" + End If + Next + End Sub + +#End Region + +#Region "Validaciones TAB Agregar" + + '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) + keyverify(e, letras:=True) + End Sub + 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 + keyverify(e, numeros:=True, comas:=True, puntosAComas:=True) + End Sub + Private Sub tbNComprobante_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbNComprobante.KeyPress + 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, espacios:=True) + End Sub + Private Sub tbProveedor_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbProveedor.KeyPress + 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) + End Sub + 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) + keyverify(e, letras:=True, espacios:=True) + End Sub + Private Sub tbSeccional_KeyPress(sender As Object, e As KeyPressEventArgs) + 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 & + "Puede agregar una nueva en el menú Editar") + ControlesConErroresAgregar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresAgregar.Remove(sender) + End If + End Sub + Private Sub cbTGasto_Validating(sender As Object, e As CancelEventArgs) Handles cbTGasto.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") + ControlesConErroresAgregar.Add(sender) + Else + Principal.ErrorProvider.SetError(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") + ControlesConErroresAgregar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresAgregar.Remove(sender) + End If + End Sub + Private Sub cbTComprobante_Validating(sender As Object, e As CancelEventArgs) Handles cbTComprobante.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") + ControlesConErroresAgregar.Add(sender) + Else + Principal.ErrorProvider.SetError(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") + ControlesConErroresAgregar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresAgregar.Remove(sender) + End If + End Sub + Private Sub cbSeccional_Validating(sender As Object, e As CancelEventArgs) Handles cbSeccional.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") + ControlesConErroresAgregar.Add(sender) + Else + Principal.ErrorProvider.SetError(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 + 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") + 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") + 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") + ControlesConErroresAgregar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresAgregar.Remove(sender) + End If + End Sub + +#End Region + +#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 + 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 + 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 = "") 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 cero") + ControlesConErroresModificar.Add(sender) + Else + Principal.ErrorProvider.SetError(sender, "") + ControlesConErroresModificar.Remove(sender) + End If + End Sub + 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 + + Private Sub TSTextBoxFiltro1_Validating(sender As Object, e As CancelEventArgs) Handles TSTextBoxFiltro1.Validating + 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 + + 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/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 84% rename from SireCu/Ingresos/ABMIngresos.vb rename to SireCu/Paneles/ABMIngresos.vb index cfeffe2..5d95c6f 100644 --- a/SireCu/Ingresos/ABMIngresos.vb +++ b/SireCu/Paneles/ABMIngresos.vb @@ -10,7 +10,7 @@ Public Class ABMIngresos Private Sub ABMIngresos_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'usamos el año mas grande de la base de datos - tb_Año.Text = ultimoaño() + tb_Año.Text = ultimoaño("Ingresos") End Sub @@ -68,6 +68,7 @@ Public Class ABMIngresos End Select activarEdicion(False) + ActualizarSaldo() End If @@ -95,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" @@ -111,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 @@ -172,39 +174,6 @@ Public Class ABMIngresos End If 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, - Optional ByVal comas As Boolean = False, - Optional ByVal puntosAComas As Boolean = False, - Optional ByVal espacios As Boolean = False, - Optional ByVal control As Boolean = True, - Optional ByVal otros As Boolean = False) - - If Char.IsLetter(e.KeyChar) Then ' Permite o cancela ingreso de letras - e.Handled = Not letras - ElseIf Char.IsDigit(e.KeyChar) Then ' Permite o cancela ingreso de numeros - e.Handled = Not numeros - ElseIf e.KeyChar = "," Then ' Permite o cancela ingreso de comas - e.Handled = Not comas - ElseIf comas And e.KeyChar = "." Then ' Si se permiten comas y el caracter es un punto - If puntosAComas Then ' Permite o cancela la sustitución de punto por coma - e.KeyChar = "," - e.Handled = False - Else - e.Handled = True - End If - ElseIf Char.IsSeparator(e.KeyChar) Then ' Permite o cancela ingreso de espacios - e.Handled = Not espacios - ElseIf Char.IsControl(e.KeyChar) Then ' Permite o cancela ingreso caracteres de control - e.Handled = Not control - Else - e.Handled = Not otros ' Permite o cancela ingreso de otros caracteres - End If - - End Sub - Private Sub validarIngresos(sender As Object, e As EventArgs) If Not IsNumeric(sender.Text) Or IsDBNull(sender.Text) Then Principal.ErrorProvider.SetError(sender, "Debe ingresar un valor numérico o 0") diff --git a/SireCu/Principal.Designer.vb b/SireCu/Principal.Designer.vb index be19935..a92cf1d 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,7 +28,10 @@ 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.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() @@ -74,7 +77,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.ToolStripStatusLabel1}) Me.StatusStripPrincipal.Location = New System.Drawing.Point(0, 0) Me.StatusStripPrincipal.Name = "StatusStripPrincipal" Me.StatusStripPrincipal.Size = New System.Drawing.Size(982, 22) @@ -83,8 +86,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(928, 17) + Me.stat_Label.Spring = True Me.stat_Label.Text = "Conectado" + Me.stat_Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' 'stat_Bar ' @@ -92,6 +97,19 @@ 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:" + ' + '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 @@ -104,6 +122,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) @@ -111,15 +130,30 @@ 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 Me.RadioButtonEgresos.AutoSize = True Me.RadioButtonEgresos.BackColor = System.Drawing.SystemColors.Control - Me.RadioButtonEgresos.Enabled = False 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) @@ -211,5 +245,7 @@ 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 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 0edb734..ebf6207 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 @@ -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") @@ -53,10 +61,16 @@ 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") + 'Cargar Tablas en Dataset + cargarTablaEnDataSet("Ingresos") + cargarTablaEnDataSet("Egresos") + cargarTablaEnDataSet("Proveedores") + cargarTablaEnDataSet("Personas") + cargarTablaEnDataSet("CategoriasGastos") + cargarTablaEnDataSet("TiposComprobantes") + cargarTablaEnDataSet("Seccionales") + + ActualizarSaldo() End Sub End Class diff --git a/SireCu/SireCu.vbproj b/SireCu/SireCu.vbproj index f039514..7385351 100644 --- a/SireCu/SireCu.vbproj +++ b/SireCu/SireCu.vbproj @@ -125,16 +125,22 @@ - + + ABMAdmin.vb + + + UserControl + + ABMEgresos.vb - + UserControl - + ABMIngresos.vb - + UserControl @@ -162,10 +168,13 @@ - + + ABMAdmin.vb + + ABMEgresos.vb - + ABMIngresos.vb