client/Reportes/frmChequeCaja_Detalle.vb

390 lines
18 KiB
VB.net

Public Class frmChequeCaja_Detalle
Public valIndex As String
Public _BlockControls As Boolean
Private Sub frmChequeCaja_Detalle_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
' Cargar los datos en los textbox
CargarForma()
'BlockControls
'If _BlockControls = False Then
' BlockControls()
'End If
'txtPaisExt.Enabled = False
txtClvOrgReg.Enabled = False
txtFolCons.Enabled = False
'txtClvSucursal.Enabled = False
txtFolioPrevio.Enabled = False
txtEntidad.Enabled = False
'txtFecha_Op.Enabled = False
End Sub
Private Sub CargarForma()
Try
Dim consultar As New clsComplejo
Dim ds As New DataSet
Dim ctrl As Control
ds = consultar.fdtDataSetTabla("SELECT * FROM FCC WHERE idFCC = " & valIndex.ToString & "")
If ds.Tables(0).Rows.Count > 0 Then
'TRIMESTRE REPORTADO
lblTrimReportadoVal.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(1)), "", ds.Tables(0).Rows(0).Item(1))
'ENTIDAD
txtClvOrgReg.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(2)), "", ds.Tables(0).Rows(0).Item(2))
txtEntidad.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(3)), "", ds.Tables(0).Rows(0).Item(3))
'OPERACION
txtFolCons.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(4)), "", ds.Tables(0).Rows(0).Item(4))
txtFecha_Op.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(6)), "", ds.Tables(0).Rows(0).Item(6))
txtClvSucursal.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(7)), "", ds.Tables(0).Rows(0).Item(7))
txtFolioPrevio.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(5)), "", ds.Tables(0).Rows(0).Item(5))
'CHEQUE
txtNumCheque.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(8)), "", ds.Tables(0).Rows(0).Item(8))
txtMoneda.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(9)), "", ds.Tables(0).Rows(0).Item(9))
txtMonto.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(10)), "", ds.Tables(0).Rows(0).Item(10))
'EXPEDICION
txtNombre_Benefi.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(11)), "", ds.Tables(0).Rows(0).Item(11))
txtMedio.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(12)), "", ds.Tables(0).Rows(0).Item(12))
txtNumCuenta.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(13)), "", ds.Tables(0).Rows(0).Item(13))
txtMonedaLiq.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(14)), "", ds.Tables(0).Rows(0).Item(14))
txtMontoLiq.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(15)), "", ds.Tables(0).Rows(0).Item(15))
'COBRO
txtEmisoraCobro.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(16)), "", ds.Tables(0).Rows(0).Item(16))
txtMedioCobro.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(17)), "", ds.Tables(0).Rows(0).Item(17))
txtNumCuentaCobro.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(18)), "", ds.Tables(0).Rows(0).Item(18))
txtMonedaCobro.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(19)), "", ds.Tables(0).Rows(0).Item(19))
txtMontoCobro.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(20)), "", ds.Tables(0).Rows(0).Item(20))
'USUARIO PERSONA FISICA
txtNomUsuPF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(21)), "", ds.Tables(0).Rows(0).Item(21))
txtApPatUsuPF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(22)), "", ds.Tables(0).Rows(0).Item(22))
txtApMatUsuPF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(23)), "", ds.Tables(0).Rows(0).Item(23))
txtFechaUsuPF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(24)), "", ds.Tables(0).Rows(0).Item(24))
txtCurpUsuPF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(25)), "", ds.Tables(0).Rows(0).Item(25))
txtRfcUsuPF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(26)), "", ds.Tables(0).Rows(0).Item(26))
txtPaisNacUsuPF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(27)), "", ds.Tables(0).Rows(0).Item(27))
txtCorreoElecUsuPF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(28)), "", ds.Tables(0).Rows(0).Item(28))
'USUARIO PERSONA MORAL
txtDenomRazonUsuMR.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(29)), "", ds.Tables(0).Rows(0).Item(29))
txtFechaConsUsuMR.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(30)), "", ds.Tables(0).Rows(0).Item(30))
txtRfcUsuMR.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(31)), "", ds.Tables(0).Rows(0).Item(31))
txtPaisNacUsuMR.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(32)), "", ds.Tables(0).Rows(0).Item(32))
txtCorreoElectUsuMR.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(33)), "", ds.Tables(0).Rows(0).Item(33))
'CLIENTE PERSONA FISICA
txtNomClientePF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(34)), "", ds.Tables(0).Rows(0).Item(34))
txtApPatClientePF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(35)), "", ds.Tables(0).Rows(0).Item(35))
txtApMatClientePF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(36)), "", ds.Tables(0).Rows(0).Item(36))
txtFechaNacClientePF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(37)), "", ds.Tables(0).Rows(0).Item(37))
txtCurpClientePF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(38)), "", ds.Tables(0).Rows(0).Item(38))
txtRfcClientePF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(39)), "", ds.Tables(0).Rows(0).Item(39))
txtPaisNacimientoClientePF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(40)), "", ds.Tables(0).Rows(0).Item(40))
txtPaisNacionalidadClientePF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(41)), "", ds.Tables(0).Rows(0).Item(41))
txtActEconomicaClientePF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(42)), "", ds.Tables(0).Rows(0).Item(42))
txtCorreoElecClientePF.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(43)), "", ds.Tables(0).Rows(0).Item(43))
'CLIENTE PERSONA MORAL
txtDenomRazonClientPM.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(44)), "", ds.Tables(0).Rows(0).Item(44))
txtFechaConstClientPM.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(45)), "", ds.Tables(0).Rows(0).Item(45))
txtRfcClientPM.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(46)), "", ds.Tables(0).Rows(0).Item(46))
txtPaisNacionalidadClientPM.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(47)), "", ds.Tables(0).Rows(0).Item(47))
txtGiroMercClientPM.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(48)), "", ds.Tables(0).Rows(0).Item(48))
txtCorreoElecClientPM.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(49)), "", ds.Tables(0).Rows(0).Item(49))
txtApodLegalClientPM.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(50)), "", ds.Tables(0).Rows(0).Item(50))
'NACIONAL UNIFICADO
txtDomicilioNacUN.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(51)), "", ds.Tables(0).Rows(0).Item(51))
txtCiudaPoblNacUN.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(52)), "", ds.Tables(0).Rows(0).Item(52))
txtColoniaNacUN.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(53)), "", ds.Tables(0).Rows(0).Item(53))
txtCodPosNacUN.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(54)), "", ds.Tables(0).Rows(0).Item(54))
'NACIONAL SEPARADO
'txtEntFedNacSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(55)), "", ds.Tables(0).Rows(0).Item(55))
'txtCodPostNacSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(56)), "", ds.Tables(0).Rows(0).Item(56))
'txtCiudadPoblNacSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(57)), "", ds.Tables(0).Rows(0).Item(57))
'txtDelMunNacSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(58)), "", ds.Tables(0).Rows(0).Item(58))
'txtColoniaNacSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(59)), "", ds.Tables(0).Rows(0).Item(59))
'txtCalleNacSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(60)), "", ds.Tables(0).Rows(0).Item(60))
'txtNumExtNacSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(61)), "", ds.Tables(0).Rows(0).Item(61))
'txtNumIntNacSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(62)), "", ds.Tables(0).Rows(0).Item(62))
'EXTRANJERO
txtPaisExt.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(63)), "", ds.Tables(0).Rows(0).Item(63))
'EXTRANJERO UNIFICADO
txtDomicExtUN.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(64)), "", ds.Tables(0).Rows(0).Item(64))
txtCiudaPoblExtUN.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(65)), "", ds.Tables(0).Rows(0).Item(65))
txtColoniaExtUN.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(66)), "", ds.Tables(0).Rows(0).Item(66))
txtCodPostalExtUN.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(67)), "", ds.Tables(0).Rows(0).Item(67))
'ENTRANJERO SEPARADO
'txtEntFedExtSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(68)), "", ds.Tables(0).Rows(0).Item(68))
'txtCodPostExtSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(69)), "", ds.Tables(0).Rows(0).Item(69))
'txtCiudaPoblExtSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(70)), "", ds.Tables(0).Rows(0).Item(70))
'txtColoniaExtSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(71)), "", ds.Tables(0).Rows(0).Item(71))
'txtCalleExtSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(72)), "", ds.Tables(0).Rows(0).Item(72))
'txtNumExtExtSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(73)), "", ds.Tables(0).Rows(0).Item(73))
'txtNumIntExtSP.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(74)), "", ds.Tables(0).Rows(0).Item(74))
'TELEFONO
txtClavePais.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(75)), "", ds.Tables(0).Rows(0).Item(75))
txtNumTelefono.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(76)), "", ds.Tables(0).Rows(0).Item(76))
txtExtension.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(77)), "", ds.Tables(0).Rows(0).Item(77))
txtIdTransaccion.Text = IIf(IsDBNull(ds.Tables(0).Rows(0).Item(78)), "", ds.Tables(0).Rows(0).Item(78))
End If
Catch ex As Exception
MsgBox("Error al cargar los datos:" & ex.Message, MsgBoxStyle.Information, "Aviso")
End Try
End Sub
Private Sub SaveRow()
Try
Dim clCmp As clsComplejo = New clsComplejo
Dim formatTrimestre As String = String.Empty
'Dim fecha As DateTime = Now 'Convert.ToDateTime(txtFechaHora.Text)
Dim trimestre As Int16
Dim CadSQL As String
Select Case Now.Month
Case 1, 2, 3
formatTrimestre = Now.Year & "-1"
trimestre = 1
Case 4, 5, 6
formatTrimestre = Now.Year & "-2"
trimestre = 2
Case 7, 8, 9
formatTrimestre = Now.Year & "-3"
trimestre = 3
Case 10, 11, 12
formatTrimestre = Now.Year & "-4"
trimestre = 4
End Select
'fecha = fecha.AddMonths(3)
CadSQL = "sp_InsertaFCC " & trimestre & ", " & Now.Year & ",'" & formatTrimestre & "','" &
txtClvOrgReg.Text & "', '" &
txtEntidad.Text & "', '" &
txtFolCons.Text & "', '" &
txtFecha_Op.Text & "', '" &
txtClvSucursal.Text & "', '" &
txtNumCheque.Text & "', '" &
txtMoneda.Text & "', '" &
txtMonto.Text & "', '" &
txtNombre_Benefi.Text & "', '" &
txtMedio.Text & "', '" &
txtNumCuenta.Text & "', '" &
txtMonedaLiq.Text & "', '" &
txtMontoLiq.Text & "', '" &
txtEmisoraCobro.Text & "', '" &
txtMedioCobro.Text & "', '" &
txtNumCuentaCobro.Text & "', '" &
txtMonedaCobro.Text & "', '" &
txtMontoCobro.Text & "', '" &
txtNomUsuPF.Text & "', '" &
txtApPatUsuPF.Text & "', '" &
txtApMatUsuPF.Text & "', '" &
txtFechaUsuPF.Text & "', '" &
txtCurpUsuPF.Text & "', '" &
txtRfcUsuPF.Text & "', '" &
txtPaisNacUsuPF.Text & "', '" &
txtCorreoElecUsuPF.Text & "', '" &
txtDenomRazonUsuMR.Text & "', '" &
txtFechaConsUsuMR.Text & "', '" &
txtRfcUsuMR.Text & "', '" &
txtPaisNacUsuMR.Text & "', '" &
txtCorreoElectUsuMR.Text & "', '" &
txtNomClientePF.Text & "', '" &
txtApPatClientePF.Text & "', '" &
txtApMatClientePF.Text & "', '" &
txtFechaNacClientePF.Text & "', '" &
txtCurpClientePF.Text & "', '" &
txtRfcClientePF.Text & "', '" &
txtPaisNacimientoClientePF.Text & "', '" &
txtPaisNacionalidadClientePF.Text & "', '" &
txtActEconomicaClientePF.Text & "', '" &
txtCorreoElecClientePF.Text & "', '" &
txtDenomRazonClientPM.Text & "', '" &
txtFechaConstClientPM.Text & "', '" &
txtRfcClientPM.Text & "', '" &
txtPaisNacionalidadClientPM.Text & "', '" &
txtGiroMercClientPM.Text & "', '" &
txtCorreoElecClientPM.Text & "', '" &
txtApodLegalClientPM.Text & "', '" &
txtDomicilioNacUN.Text & "', '" &
txtCiudaPoblNacUN.Text & "', '" &
txtColoniaNacUN.Text & "', '" &
txtCodPosNacUN.Text & "', '" &
txtPaisExt.Text & "', '" &
txtDomicExtUN.Text & "', '" &
txtCiudaPoblExtUN.Text & "', '" &
txtColoniaExtUN.Text & "', '" &
txtCodPostalExtUN.Text & "', '" &
txtClavePais.Text & "', '" &
txtNumTelefono.Text & "', '" &
txtExtension.Text & "', " &
txtIdTransaccion.Text
clCmp.fdtDataSetTabla(CadSQL)
Catch ex As Exception
MsgBox("Error al cargar los datos:" & ex.Message, MsgBoxStyle.Information, "Aviso")
End Try
End Sub
Private Sub btnGuardar_Click(sender As System.Object, e As System.EventArgs) Handles btnGuardar.Click
Try
Dim Auditoria As New ClassMyUtils
'Guardar Registro
SaveRow()
'Bitacora
Auditoria.RT_Auditoria(clsVaribles.varUsuario, 130, 29, "Creacion de registro modificatorio del folio: " & valIndex.ToString() & "")
'Bloquear controles
BlockControls()
MsgBox("Se actualizaron los datos", vbInformation, "Aviso")
Catch ex As Exception
MsgBox("Error al guardar en auditoria:" & ex.Message, MsgBoxStyle.Information, "Aviso")
End Try
End Sub
Protected Sub BlockControls()
Dim ctl As New Control
btnGuardar.Enabled = False
For Each tp As TabPage In TabControl1.TabPages
For Each ctl In tp.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = False
End If
Next
Next
For Each ctl In gb_Beneficiario.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = False
End If
Next
For Each ctl In gb_Liquidacion.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = False
End If
Next
For Each ctl In gb_PerFisCL.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = False
End If
Next
For Each ctl In gb_PerMoral.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = False
End If
Next
For Each ctl In gb_PersonaFisica.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = False
End If
Next
For Each ctl In gbInstEmisoraCobro.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = False
End If
Next
For Each ctl In gbLiquidacionCobro.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = False
End If
Next
For Each ctl In gbPerMoral.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = False
End If
Next
For Each ctl In gbSeparado.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = False
End If
Next
For Each ctl In gbSeparadoExt.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = False
End If
Next
For Each ctl In gbUnificado.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = False
End If
Next
For Each ctl In gbUnificadoExt.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = False
End If
Next
End Sub
Private Sub cmdSalir_Click(sender As System.Object, e As System.EventArgs) Handles cmdSalir.Click
Me.Close()
End Sub
'Private Function ValidateDate() As String
' Dim trimestre As String = String.Empty
' Dim _Trimestre As String = String.Empty
' Dim año As Integer
' trimestre = lblTrimReportadoVal.Text.Trim
' trimestre = trimestre.Substring(5, 1)
' año = Convert.ToInt32(lblTrimReportadoVal.Text.Substring(0, 4))
' Select Case trimestre
' Case "1"
' _Trimestre = "2"
' Case "2"
' _Trimestre = "3"
' Case "3"
' _Trimestre = "4"
' Case "4"
' _Trimestre = "1"
' año += 1
' End Select
' trimestre = año & "-" & _Trimestre
' Return trimestre
'End Function
End Class