754 lines
36 KiB
VB.net
754 lines
36 KiB
VB.net
|
Imports System.IO
|
|||
|
Imports System.Text
|
|||
|
Imports System.Xml
|
|||
|
Imports System.Xml.Serialization
|
|||
|
Imports System.IO.File
|
|||
|
Imports System.Text.RegularExpressions
|
|||
|
|
|||
|
Public Class frmTInternacional
|
|||
|
|
|||
|
Dim notAuditoria As ClassMyUtils
|
|||
|
Dim dsGral As DataSet
|
|||
|
|
|||
|
Private Sub c1GridDatos_DoubleClick(sender As Object, e As System.EventArgs)
|
|||
|
|
|||
|
'If Me.cgDatosTransInter.RowCount > 0 Then
|
|||
|
|
|||
|
' Dim objTransfe As New transferenciaInternacional(cgDatosTransInter.Columns("IDTRANSFERENCIA").Value,
|
|||
|
' cgDatosTransInter.Columns("FECHA").Value,
|
|||
|
' cgDatosTransInter.Columns("CAMPO1").Value,
|
|||
|
' cgDatosTransInter.Columns("CAMPO2").Value,
|
|||
|
' cgDatosTransInter.Columns("CAMPO3").Value)
|
|||
|
|
|||
|
|
|||
|
' Dim frmActualizarDatos As New frmModificarTI
|
|||
|
' frmActualizarDatos.Text = "Modificar Datos de Transferencia Internacional"
|
|||
|
' frmActualizarDatos.objTransferenciaInt = objTransfe
|
|||
|
' frmActualizarDatos.txtC1.Text = objTransfe.campo1
|
|||
|
' frmActualizarDatos.txtC2.Text = objTransfe.campo2
|
|||
|
' frmActualizarDatos.txtC3.Text = objTransfe.campo3
|
|||
|
|
|||
|
' frmActualizarDatos.ShowDialog()
|
|||
|
|
|||
|
|
|||
|
'End If
|
|||
|
|
|||
|
End Sub
|
|||
|
|
|||
|
Private Sub frmTInternacional_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|||
|
|
|||
|
notAuditoria = New ClassMyUtils
|
|||
|
notAuditoria.RT_Auditoria(clsVaribles.varUsuario, 125, 28, "Entrada Reporte Transferencia Internacional")
|
|||
|
notAuditoria = Nothing
|
|||
|
|
|||
|
cboMes.Items.Add("Enero")
|
|||
|
cboMes.Items.Add("Febrero")
|
|||
|
cboMes.Items.Add("Marzo")
|
|||
|
cboMes.Items.Add("Abril")
|
|||
|
cboMes.Items.Add("Mayo")
|
|||
|
cboMes.Items.Add("Junio")
|
|||
|
cboMes.Items.Add("Julio")
|
|||
|
cboMes.Items.Add("Agosto")
|
|||
|
cboMes.Items.Add("Septiembre")
|
|||
|
cboMes.Items.Add("Octubre")
|
|||
|
cboMes.Items.Add("Noviembre")
|
|||
|
cboMes.Items.Add("Diciembre")
|
|||
|
|
|||
|
Dim aYear As Integer = Year(Now)
|
|||
|
|
|||
|
For i As Integer = 0 To 6
|
|||
|
cboYear.Items.Add(aYear + 3 - i)
|
|||
|
Next
|
|||
|
|
|||
|
'Inicializa los comboBox en posicion 0
|
|||
|
cboMes.SelectedIndex = 0
|
|||
|
cboYear.SelectedIndex = 0
|
|||
|
|
|||
|
End Sub
|
|||
|
|
|||
|
Private Function llenarGrid() As Boolean
|
|||
|
llenarGrid = False
|
|||
|
Try
|
|||
|
Dim ClassCatalogos As New ClassCatalogos
|
|||
|
Dim mes As String = cboMes.SelectedIndex + 1 ' IIf(cboMes.SelectedIndex <> -1, Format(cboMes.SelectedIndex + 1, "00"), "NULL")
|
|||
|
Dim year As String = IIf(cboYear.SelectedIndex <> -1, cboYear.Text, "NULL")
|
|||
|
|
|||
|
'mes = "0" & mes
|
|||
|
'mes = Strings.Right(mes, 2)
|
|||
|
|
|||
|
Dim Classcom As New clsComplejo
|
|||
|
Dim SQL As String = String.Empty
|
|||
|
|
|||
|
SQL = "sp_ConsultaFTI '" & cboYear.Text & "-" & IIf(mes < 10, "0" & mes.ToString(), mes.ToString()) & "'"
|
|||
|
'SQL = "sp_ConsultaFDE '" & cboYear.Text & "-" & cboMes.SelectedValue & "', " &
|
|||
|
'IIf(cboTipoOperacion.SelectedIndex = 0, "NULL", cboTipoOperacion.SelectedValue)
|
|||
|
|
|||
|
dsGral = Classcom.fdtDataSet(Sql)
|
|||
|
|
|||
|
gridFTI.SetDataBinding(dsGral, "Table")
|
|||
|
|
|||
|
Me.gridFTI.Splits(0).DisplayColumns("IdFTI").Visible = False
|
|||
|
|
|||
|
'ClassCatalogos.LlenaGrid(SQL, Me.GridMaster)
|
|||
|
|
|||
|
lblRegistros.Text = "Total de Registros " & gridFTI.RowCount
|
|||
|
|
|||
|
|
|||
|
'gridFTI.AllowUpdate = False
|
|||
|
'ClassCatalogos.LlenaGrid("spS_FTI '" & year & "-" & mes & "'", Me.gridFTI)
|
|||
|
'ClassCatalogos.LlenaGrid("sp_ConsultaFTI '" & year & "-" & mes & "'", Me.gridFTI)
|
|||
|
|
|||
|
'gridFTI.Splits(0).DisplayColumns(0).AutoSize()
|
|||
|
'gridFTI.Splits(0).DisplayColumns(1).AutoSize()
|
|||
|
'GridMaster.Splits(0).DisplayColumns(2).AutoSize()
|
|||
|
Catch ex As Exception
|
|||
|
MessageBox.Show(ex.Message)
|
|||
|
End Try
|
|||
|
llenarGrid = True
|
|||
|
End Function
|
|||
|
|
|||
|
Private Sub btnConsultar_Click(sender As System.Object, e As System.EventArgs) Handles btnConsultar.Click
|
|||
|
llenarGrid()
|
|||
|
End Sub
|
|||
|
|
|||
|
Private Sub btnGenerarReporte_Click(sender As Object, e As EventArgs) Handles btnGenerarReporte.Click
|
|||
|
|
|||
|
'Dim cls As New clsComplejo
|
|||
|
'Dim FileName As String = String.Empty
|
|||
|
'Dim path As String = String.Empty
|
|||
|
'Dim mes As Integer
|
|||
|
'Dim ds As New DataSet
|
|||
|
|
|||
|
'mes = cboMes.SelectedIndex + 1
|
|||
|
'FileName = "\FTI_" & cboYear.Text & "_" & cboMes.Text & ".xml"
|
|||
|
|
|||
|
'Cursor = Cursors.WaitCursor
|
|||
|
|
|||
|
''Obtiene la ruta
|
|||
|
'path = GetPath(FileName)
|
|||
|
|
|||
|
'Try
|
|||
|
' 'Obtiene los datos que se van a escribir en el archivo xml
|
|||
|
' ds = cls.fdtDataSet("[spGeneraXMLFTI] " & mes & ", " & cboYear.SelectedItem & "")
|
|||
|
|
|||
|
' If Not File.Exists(path) Then
|
|||
|
' ' Create a file to write to.
|
|||
|
' Using sw As StreamWriter = File.CreateText(path)
|
|||
|
' sw.WriteLine(ds.Tables(0).Rows(0).Item(0).ToString())
|
|||
|
' End Using
|
|||
|
' End If
|
|||
|
|
|||
|
' ' Open the file to read from.
|
|||
|
' Using sr As StreamReader = File.OpenText(path)
|
|||
|
' Do While sr.Peek() >= 0
|
|||
|
' Console.WriteLine(sr.ReadLine())
|
|||
|
' Loop
|
|||
|
' End Using
|
|||
|
|
|||
|
' MsgBox("Generado correctamente", MsgBoxStyle.Information, "Aviso")
|
|||
|
'Catch ex As Exception
|
|||
|
' MsgBox("Ocurrio un error al generar el reporte: " & ex.Message & "", MsgBoxStyle.Information, "Aviso")
|
|||
|
'End Try
|
|||
|
'Cursor = Cursors.Default
|
|||
|
|
|||
|
Dim SINREGISTROS As Boolean = False
|
|||
|
|
|||
|
If dsGral Is Nothing Then
|
|||
|
SINREGISTROS = True
|
|||
|
Else
|
|||
|
If dsGral.Tables(0).Rows.Count = 0 Then
|
|||
|
SINREGISTROS = True
|
|||
|
End If
|
|||
|
End If
|
|||
|
|
|||
|
If SINREGISTROS = False Then
|
|||
|
Dim fileSave As New SaveFileDialog
|
|||
|
Dim File As String = Nothing
|
|||
|
Dim Dia As String
|
|||
|
Dim Anio As String
|
|||
|
|
|||
|
'"\FTI_" & cboYear.Text & "_" & cboMes.Text & ".xml"
|
|||
|
fileSave.Filter = "Archivos XML | *.XML"
|
|||
|
fileSave.FileName = "FTI_" & cboYear.Text & "_" & cboMes.Text & ".xml"
|
|||
|
fileSave.Title = "Guardar Archivo"
|
|||
|
File = fileSave.ShowDialog()
|
|||
|
If File = 1 Then
|
|||
|
AddData(fileSave.FileName)
|
|||
|
MsgBox("El archivo de transferencias internacionales se ha generado correctamente", MsgBoxStyle.OkOnly, "Mensaje")
|
|||
|
End If
|
|||
|
Else
|
|||
|
If MsgBox("No existen registros, ¿Está seguro de generar un reporte en ceros?", MsgBoxStyle.OkCancel, "Mensaje") = MsgBoxResult.Ok Then
|
|||
|
Dim fileSave As New SaveFileDialog
|
|||
|
Dim File As String = Nothing
|
|||
|
Dim Dia As String
|
|||
|
Dim Anio As String
|
|||
|
|
|||
|
'"\FTI_" & cboYear.Text & "_" & cboMes.Text & ".xml"
|
|||
|
fileSave.Filter = "Archivos XML | *.XML"
|
|||
|
fileSave.FileName = "FTI_" & cboYear.Text & "_" & cboMes.Text & ".xml"
|
|||
|
fileSave.Title = "Guardar Archivo"
|
|||
|
File = fileSave.ShowDialog()
|
|||
|
If File = 1 Then
|
|||
|
|
|||
|
Dim StrMFile As System.IO.FileStream
|
|||
|
Dim StrMRead As System.IO.StreamWriter
|
|||
|
|
|||
|
StrMFile = New System.IO.FileStream(fileSave.FileName, IO.FileMode.OpenOrCreate, IO.FileAccess.Write)
|
|||
|
StrMRead = New System.IO.StreamWriter(StrMFile)
|
|||
|
|
|||
|
Dim strCadenaIN As String = "<?xml version=""1.0"" encoding=""UTF-8""?>" & vbCrLf &
|
|||
|
"<reporte xmlns=""http://www.uif.shcp.gob.mx/recepcion/fti"" xsi:schemaLocation=""http://www.uif.shcp.gob.mx/recepcion/fti fti.xsd"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">" & vbCrLf & _
|
|||
|
"<mes_reportado>" & cboYear.Text & "-" & (cboMes.SelectedIndex + 1).ToString() & "</mes_reportado>" & vbCrLf & _
|
|||
|
"<entidad>" & vbCrLf & _
|
|||
|
"<clave_organo_regulador>01-002</clave_organo_regulador>" & vbCrLf & _
|
|||
|
"<clave_entidad>40-060</clave_entidad>" & vbCrLf & _
|
|||
|
"</entidad>" & vbCrLf & _
|
|||
|
"<operaciones/>" & vbCrLf & _
|
|||
|
"</reporte>"
|
|||
|
|
|||
|
StrMRead.WriteLine(strCadenaIN)
|
|||
|
|
|||
|
StrMRead.Close()
|
|||
|
|
|||
|
MsgBox("El archivo transferencias internacionales se ha generado correctamente", MsgBoxStyle.OkOnly, "Mensaje")
|
|||
|
End If
|
|||
|
End If
|
|||
|
End If
|
|||
|
|
|||
|
|
|||
|
End Sub
|
|||
|
|
|||
|
Private Sub btnSalir_Click(sender As System.Object, e As System.EventArgs) Handles btnSalir.Click
|
|||
|
Close()
|
|||
|
End Sub
|
|||
|
|
|||
|
Private Sub gridFTI_DoubleClick(sender As System.Object, e As System.EventArgs) Handles gridFTI.DoubleClick
|
|||
|
'If gridFTI.RowCount > 0 Then
|
|||
|
' abrirDetalle()
|
|||
|
'End If
|
|||
|
End Sub
|
|||
|
|
|||
|
Private Function abrirDetalle() As Boolean
|
|||
|
Dim detalleFTI As frmDetalleFTI = New frmDetalleFTI
|
|||
|
detalleFTI.idFTI = gridFTI.Columns(0).CellValue(gridFTI.Row)
|
|||
|
|
|||
|
'Valida mes
|
|||
|
detalleFTI.ValidaMes = ValidaMes()
|
|||
|
|
|||
|
'abre formulario detalle
|
|||
|
detalleFTI.ShowDialog()
|
|||
|
|
|||
|
'actualiza grid
|
|||
|
llenarGrid()
|
|||
|
|
|||
|
abrirDetalle = False
|
|||
|
End Function
|
|||
|
|
|||
|
Protected Function ValidaMes() As Boolean
|
|||
|
Dim strPeriodo As String = String.Empty
|
|||
|
Dim strAnio As String = String.Empty
|
|||
|
Dim mes As String = String.Empty
|
|||
|
Dim mesActual As String = String.Empty
|
|||
|
|
|||
|
'Get Periodo
|
|||
|
strPeriodo = gridFTI.Columns(1).CellValue(gridFTI.Row())
|
|||
|
strAnio = strPeriodo.Substring(0, 4)
|
|||
|
mesActual = Date.Now.Month
|
|||
|
|
|||
|
If (strPeriodo.Length = 6) Then
|
|||
|
mes = strPeriodo.Substring(5, 1)
|
|||
|
Else
|
|||
|
mes = strPeriodo.Substring(5, 2)
|
|||
|
End If
|
|||
|
|
|||
|
If mesActual = 1 Then
|
|||
|
mesActual = 12
|
|||
|
Else
|
|||
|
mesActual = mesActual - 1
|
|||
|
End If
|
|||
|
|
|||
|
|
|||
|
If (Int(mes) = mesActual) Then
|
|||
|
Return True
|
|||
|
Else
|
|||
|
Return False
|
|||
|
End If
|
|||
|
End Function
|
|||
|
|
|||
|
Private Function GetPath(ByVal FileName As String) As String
|
|||
|
Dim cls1 As New clsComplejo
|
|||
|
Dim path As String
|
|||
|
Dim ds2 As New DataSet
|
|||
|
|
|||
|
ds2 = cls1.fdtDataSet("select top 1 rutarelevantes from paramrep")
|
|||
|
path = ds2.Tables(0).Rows(0).Item(0).ToString() & FileName
|
|||
|
|
|||
|
ds2.Clear()
|
|||
|
ds2.Dispose()
|
|||
|
|
|||
|
Return path
|
|||
|
End Function
|
|||
|
|
|||
|
Private Sub AddData(NombreArchivo As String)
|
|||
|
Dim dsData As New DataSet
|
|||
|
Dim dsPersonas As New DataSet
|
|||
|
Dim dsPersonasE As New DataSet
|
|||
|
Dim NomArchivoXml As String
|
|||
|
Dim claveSujeto As String
|
|||
|
Dim apoderado As String
|
|||
|
Dim tipoPersona As String
|
|||
|
Dim recorrido As Integer
|
|||
|
Dim domicilioNacionalUnificado As String
|
|||
|
Dim domicilioNacionalSeparado As String
|
|||
|
Dim domicilioExtranjeroUnificado As String
|
|||
|
Dim domicilioExtranjeroSeparado As String
|
|||
|
Dim nombre_corresponsal_envio As String
|
|||
|
Dim nombre_corresponsal_recepcion As String
|
|||
|
Dim nombre_corresponsal_vostro As String
|
|||
|
Dim nombre_pf As String
|
|||
|
Dim razon_social_pm As String
|
|||
|
Dim pais_extranjero As String
|
|||
|
Dim consecutivo As String
|
|||
|
Dim anio As String
|
|||
|
Dim mes As String
|
|||
|
Dim mesReportado As String
|
|||
|
Dim destinatarioVostro As String
|
|||
|
Dim nombreEntidadDestino As String
|
|||
|
Dim operacionOrigen As String
|
|||
|
Dim operacionDestino As String
|
|||
|
Dim mensaje As String
|
|||
|
Dim folioPrevio As String
|
|||
|
NomArchivoXml = NombreArchivo
|
|||
|
Dim myXmlTextWriter As New XmlTextWriter(NomArchivoXml, System.Text.Encoding.UTF8)
|
|||
|
myXmlTextWriter.Formatting = System.Xml.Formatting.Indented
|
|||
|
myXmlTextWriter.WriteStartDocument()
|
|||
|
myXmlTextWriter.WriteStartElement("reporte") 'reporte abre 1
|
|||
|
myXmlTextWriter.WriteAttributeString("xmlns", "xsi", Nothing, "http://www.w3.org/2001/XMLSchema-instance")
|
|||
|
myXmlTextWriter.WriteAttributeString("xsi", "schemaLocation", Nothing, "http://www.uif.shcp.gob.mx/recepcion/fti fti.xsd")
|
|||
|
myXmlTextWriter.WriteAttributeString("xmlns", "http://www.uif.shcp.gob.mx/recepcion/fti")
|
|||
|
'dsData = GetData()
|
|||
|
dsData = dsGral
|
|||
|
mesReportado = dsData.Tables(0).Rows(0).Item("mes_reportado")
|
|||
|
If Len(mesReportado) = 6 Then
|
|||
|
anio = Mid(mesReportado, 1, 4)
|
|||
|
mes = "0" & Mid(mesReportado, 6, 6)
|
|||
|
mesReportado = anio & "-" & mes
|
|||
|
End If
|
|||
|
myXmlTextWriter.WriteElementString("mes_reportado", mesReportado)
|
|||
|
|
|||
|
myXmlTextWriter.WriteStartElement("entidad") 'abre entidad 3
|
|||
|
myXmlTextWriter.WriteElementString("clave_organo_regulador", dsData.Tables(0).Rows(0).Item("clave_organo_regulador"))
|
|||
|
myXmlTextWriter.WriteElementString("clave_entidad", dsData.Tables(0).Rows(0).Item("clave_entidad"))
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra entidad 3
|
|||
|
Dim BICABA As String
|
|||
|
myXmlTextWriter.WriteStartElement("operaciones") 'abre operaciones
|
|||
|
For Each row As DataRow In dsData.Tables(0).Rows '------COMIENZA RECORRIDO
|
|||
|
|
|||
|
folioPrevio = row("folio_Previo")
|
|||
|
consecutivo = row("folio_consecutivo") 'Now.Year & "-" & "MT103" & "-" & row("folio_consecutivo")
|
|||
|
'If folioPrevio.Trim = "" Then
|
|||
|
' folioPrevio = "0000-MT000-0"
|
|||
|
'Else
|
|||
|
' folioPrevio = Now.Year & "-" & "MT103" & "-" & folioPrevio
|
|||
|
'End If
|
|||
|
|
|||
|
myXmlTextWriter.WriteStartElement("operacion") 'abre operacion
|
|||
|
myXmlTextWriter.WriteElementString("folio_consecutivo", consecutivo)
|
|||
|
|
|||
|
If folioPrevio <> "" Then
|
|||
|
myXmlTextWriter.WriteStartElement("modificatorio") 'abre modificatorio
|
|||
|
myXmlTextWriter.WriteElementString("folio_previo", folioPrevio)
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra modificatorio
|
|||
|
End If
|
|||
|
|
|||
|
myXmlTextWriter.WriteElementString("fecha", row("fecha"))
|
|||
|
myXmlTextWriter.WriteElementString("referencia", row("referencia"))
|
|||
|
|
|||
|
myXmlTextWriter.WriteStartElement("transferencia") 'abre transferencia
|
|||
|
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|||
|
'+++++++++++++++++++++condicionando el tipo de transferencia envio+++++++++++++++++++++++++++++++++++++++++++++++++
|
|||
|
'nombre_corresponsal_envio = row("nombre_corresponsal_envio")
|
|||
|
|
|||
|
|
|||
|
If row("bic_aba_envio") <> "" Then
|
|||
|
myXmlTextWriter.WriteStartElement("transferencia_envio") 'abre tranferencia_envio
|
|||
|
|
|||
|
'-------------myXmlTextWriter.WriteStartElement("entidades_participantes_envio") 'abre entidades_participantes_envio
|
|||
|
|
|||
|
'-------------myXmlTextWriter.WriteStartElement("nombre_participante_envio") 'abre nombre_participante_envio
|
|||
|
'myXmlTextWriter.WriteElementString("nombre_corresponsal", row("nombre_corresponsal_envio"))
|
|||
|
'nombreEntidadDestino = row("nombre_entidad_destino_envio")
|
|||
|
|
|||
|
'If nombreEntidadDestino.Trim = "" Then
|
|||
|
' nombreEntidadDestino = " "
|
|||
|
'-------------myXmlTextWriter.WriteElementString("nombre_entidad_destino", row("nombre_entidad_destino_envio"))
|
|||
|
'Else
|
|||
|
' myXmlTextWriter.WriteElementString("nombre_entidad_destino", nombreEntidadDestino)
|
|||
|
' nombreEntidadDestino = ""
|
|||
|
'End If
|
|||
|
'-------------myXmlTextWriter.WriteEndElement() 'cierra nombre_participante_envio
|
|||
|
'-------------myXmlTextWriter.WriteEndElement() 'cierra entidades_participantes_envio
|
|||
|
myXmlTextWriter.WriteElementString("bic_aba", row("bic_aba_envio"))
|
|||
|
myXmlTextWriter.WriteElementString("datos_destinatario", row("datos_destinatario_envio"))
|
|||
|
|
|||
|
operacionOrigen = row("operacion_origen_envio")
|
|||
|
|
|||
|
If operacionOrigen = "" Then
|
|||
|
'operacionOrigen = " "
|
|||
|
'myXmlTextWriter.WriteElementString("operacion_origen", operacionOrigen)
|
|||
|
Else
|
|||
|
myXmlTextWriter.WriteElementString("operacion_origen", operacionOrigen)
|
|||
|
operacionOrigen = ""
|
|||
|
End If
|
|||
|
|
|||
|
operacionDestino = row("operacion_destino_envio")
|
|||
|
|
|||
|
If operacionDestino = "" Then
|
|||
|
'operacionDestino = " "
|
|||
|
'myXmlTextWriter.WriteElementString("operacion_destino", operacionDestino)
|
|||
|
Else
|
|||
|
myXmlTextWriter.WriteElementString("operacion_destino", operacionDestino)
|
|||
|
operacionDestino = ""
|
|||
|
End If
|
|||
|
|
|||
|
myXmlTextWriter.WriteStartElement("instrumentos_origen") 'abre instrumentos_origen
|
|||
|
myXmlTextWriter.WriteStartElement("instrumento_origen") 'abre instrumentos_origen
|
|||
|
myXmlTextWriter.WriteElementString("instrumento_monetario_origen", row("instrumento_monetario_origen_envio"))
|
|||
|
myXmlTextWriter.WriteElementString("moneda_origen", row("moneda_origen_envio"))
|
|||
|
myXmlTextWriter.WriteElementString("monto_instrumento_origen", row("monto_instrumento_origen_envio"))
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra instrumento_origen
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra instrumentos_origen
|
|||
|
mensaje = row("mensaje_envio")
|
|||
|
'myXmlTextWriter.WriteStartElement("memo_envio") 'abre memo_envio
|
|||
|
'If mensaje = "" Then
|
|||
|
' mensaje = " "
|
|||
|
' myXmlTextWriter.WriteElementString("mensaje", mensaje)
|
|||
|
' mensaje = ""
|
|||
|
'Else
|
|||
|
' myXmlTextWriter.WriteElementString("mensaje", mensaje)
|
|||
|
' mensaje = ""
|
|||
|
'End If
|
|||
|
'myXmlTextWriter.WriteEndElement() 'cierra memo_envio
|
|||
|
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra transferencia_envio
|
|||
|
End If
|
|||
|
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|||
|
'+++++++++++++++++++++condicionando el tipo de transferencia envio+++++++++++++++++++++++++++++++++++++++++++++++++
|
|||
|
'Aqui comienza tag transferencia recepcion
|
|||
|
'nombre_corresponsal_recepcion = row("nombre_corresponsal_recepcion")
|
|||
|
|
|||
|
|
|||
|
If row("bic_aba_recepcion") <> "" Then
|
|||
|
myXmlTextWriter.WriteStartElement("transferencia_recepcion") 'abre transferencia_recepcion
|
|||
|
'--myXmlTextWriter.WriteStartElement("entidades_participantes_recepcion") 'abre entidades_participantes_recepcion
|
|||
|
'--myXmlTextWriter.WriteStartElement("nombre_participante_recepcion") 'abre nombre_participante_recepcion
|
|||
|
'myXmlTextWriter.WriteElementString("nombre_corresponsal", row("nombre_corresponsal_recepcion"))
|
|||
|
'nombreEntidadDestino = row("nombre_entidad_origen_recepcion")
|
|||
|
|
|||
|
'--myXmlTextWriter.WriteElementString("nombre_entidad_origen", row("nombre_entidad_origen_recepcion"))
|
|||
|
|
|||
|
'--myXmlTextWriter.WriteEndElement() 'cierra nombre_participante_recepcion
|
|||
|
'--myXmlTextWriter.WriteEndElement() 'cierra entidades_participantes_recepcion
|
|||
|
myXmlTextWriter.WriteElementString("bic_aba", row("bic_aba_recepcion"))
|
|||
|
'myXmlTextWriter.WriteElementString("datos_ordenante", CleanInput(row("datos_ordenante_recepcion")))
|
|||
|
myXmlTextWriter.WriteElementString("datos_ordenante", row("datos_ordenante_recepcion"))
|
|||
|
|
|||
|
operacionOrigen = row("operacion_origen_recepcion")
|
|||
|
If operacionOrigen.Trim = "" Then
|
|||
|
'operacionOrigen = " "
|
|||
|
'myXmlTextWriter.WriteElementString("operacion_origen", operacionOrigen)
|
|||
|
Else
|
|||
|
myXmlTextWriter.WriteElementString("operacion_origen", operacionOrigen)
|
|||
|
operacionOrigen = ""
|
|||
|
End If
|
|||
|
|
|||
|
operacionDestino = row("operacion_destino_recepcion")
|
|||
|
If operacionDestino.Trim = "" Then
|
|||
|
'operacionDestino = " "
|
|||
|
'myXmlTextWriter.WriteElementString("operacion_destino", operacionDestino)
|
|||
|
Else
|
|||
|
myXmlTextWriter.WriteElementString("operacion_destino", operacionDestino)
|
|||
|
operacionDestino = ""
|
|||
|
End If
|
|||
|
|
|||
|
myXmlTextWriter.WriteStartElement("instrumentos_destino") 'abre instrumentos_destino
|
|||
|
myXmlTextWriter.WriteStartElement("instrumento_destino") 'abre instrumento_destino
|
|||
|
myXmlTextWriter.WriteElementString("instrumento_monetario_destino", row("instrumento_monetario_destino_recepcion"))
|
|||
|
myXmlTextWriter.WriteElementString("moneda_destino", row("moneda_destino_recepcion"))
|
|||
|
myXmlTextWriter.WriteElementString("monto_instrumento_destino", row("monto_instrumento_destino_recepcion"))
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra instrumento_destino
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra instrumentos_destino
|
|||
|
|
|||
|
'myXmlTextWriter.WriteStartElement("memo_recepcion") 'abre memo_recepcion
|
|||
|
'mensaje = row("mensaje_recepcion")
|
|||
|
'If mensaje = "" Then
|
|||
|
' mensaje = " "
|
|||
|
' myXmlTextWriter.WriteElementString("mensaje", mensaje)
|
|||
|
'Else
|
|||
|
' myXmlTextWriter.WriteElementString("mensaje", mensaje)
|
|||
|
' mensaje = ""
|
|||
|
'End If
|
|||
|
'myXmlTextWriter.WriteEndElement() 'cierra memo_recepcion
|
|||
|
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra transferencia_recepcion
|
|||
|
End If
|
|||
|
'aqui finaliza tag transferencia recepcion
|
|||
|
|
|||
|
'Aqui comienza vostro
|
|||
|
'nombre_corresponsal_vostro = row("nombre_corresponsal_vostro")
|
|||
|
|
|||
|
|
|||
|
If row("bic_aba_vostro") <> "" Then
|
|||
|
myXmlTextWriter.WriteStartElement("vostro") 'abre vostro
|
|||
|
|
|||
|
myXmlTextWriter.WriteStartElement("nombres_participantes_vostro") 'abre nombres_participantes_vostro
|
|||
|
myXmlTextWriter.WriteStartElement("nombre_participante_vostro") 'abre nombre_participante_vostro
|
|||
|
myXmlTextWriter.WriteElementString("nombre_corresponsal", row("nombre_corresponsal_vostro"))
|
|||
|
'nombreEntidadDestino = row("nombre_entidad_origen_vostro")
|
|||
|
|
|||
|
'If nombreEntidadDestino.Trim = "" Then
|
|||
|
'nombreEntidadDestino = " "
|
|||
|
'myXmlTextWriter.WriteElementString("nombre_entidad_origen", nombreEntidadDestino)
|
|||
|
'Else
|
|||
|
myXmlTextWriter.WriteElementString("nombre_entidad_origen", row("nombre_entidad_origen_vostro"))
|
|||
|
nombreEntidadDestino = ""
|
|||
|
'End If
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra nombre_participante_vostro
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra nombres_participantes_vostro
|
|||
|
|
|||
|
myXmlTextWriter.WriteElementString("bic_aba", row("bic_aba_vostro"))
|
|||
|
'myXmlTextWriter.WriteElementString("datos_ordenante", CleanInput(row("datos_ordenante_vostro")))
|
|||
|
myXmlTextWriter.WriteElementString("datos_ordenante", row("datos_ordenante_vostro"))
|
|||
|
|
|||
|
|
|||
|
operacionOrigen = row("operacion_origen_vostro")
|
|||
|
If operacionOrigen = "" Then
|
|||
|
'operacionOrigen = " "
|
|||
|
'myXmlTextWriter.WriteElementString("operacion_origen", operacionOrigen)
|
|||
|
Else
|
|||
|
myXmlTextWriter.WriteElementString("operacion_origen", operacionOrigen)
|
|||
|
operacionOrigen = ""
|
|||
|
End If
|
|||
|
|
|||
|
nombreEntidadDestino = row("nombre_entidad_destino_vostro")
|
|||
|
If nombreEntidadDestino = "" Then
|
|||
|
'nombreEntidadDestino = " "
|
|||
|
'myXmlTextWriter.WriteElementString("nombre_entidad_destino", nombreEntidadDestino)
|
|||
|
Else
|
|||
|
myXmlTextWriter.WriteElementString("nombre_entidad_destino", nombreEntidadDestino)
|
|||
|
nombreEntidadDestino = ""
|
|||
|
End If
|
|||
|
destinatarioVostro = row("datos_destinatario_vostro")
|
|||
|
If destinatarioVostro = "" Then
|
|||
|
'destinatarioVostro = " "
|
|||
|
'myXmlTextWriter.WriteElementString("datos_destinatario", destinatarioVostro)
|
|||
|
Else
|
|||
|
myXmlTextWriter.WriteElementString("datos_destinatario", destinatarioVostro)
|
|||
|
destinatarioVostro = ""
|
|||
|
End If
|
|||
|
operacionDestino = row("operacion_destino_vostro")
|
|||
|
If operacionDestino = "" Then
|
|||
|
'operacionDestino = " "
|
|||
|
'myXmlTextWriter.WriteElementString("operacion_destino", operacionDestino)
|
|||
|
Else
|
|||
|
myXmlTextWriter.WriteElementString("operacion_destino", operacionDestino)
|
|||
|
operacionDestino = ""
|
|||
|
End If
|
|||
|
|
|||
|
'myXmlTextWriter.WriteStartElement("memo_vostro") 'abre memo_vostro
|
|||
|
'mensaje = row("mensaje_vostro")
|
|||
|
'If mensaje = "" Then
|
|||
|
' mensaje = " "
|
|||
|
' myXmlTextWriter.WriteElementString("mensaje", mensaje)
|
|||
|
'Else
|
|||
|
' myXmlTextWriter.WriteElementString("mensaje", mensaje)
|
|||
|
' mensaje = ""
|
|||
|
'End If
|
|||
|
'myXmlTextWriter.WriteEndElement() 'cierra memo_vostro
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra vostro
|
|||
|
End If
|
|||
|
'Aqui finaliza vostro
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra transferencia
|
|||
|
|
|||
|
|
|||
|
'Aqui empieza Persona
|
|||
|
myXmlTextWriter.WriteStartElement("persona") 'abre persona
|
|||
|
myXmlTextWriter.WriteStartElement("tipo_persona") 'abre tipo_persona
|
|||
|
nombre_pf = row("nombre_pf")
|
|||
|
If nombre_pf <> "" Then
|
|||
|
myXmlTextWriter.WriteStartElement("persona_fisica") 'abre persona_fisica
|
|||
|
myXmlTextWriter.WriteElementString("nombre", row("nombre_pf"))
|
|||
|
myXmlTextWriter.WriteElementString("apellido_paterno", row("apellido_paterno_pf"))
|
|||
|
myXmlTextWriter.WriteElementString("apellido_materno", row("apellido_materno_pf"))
|
|||
|
myXmlTextWriter.WriteElementString("fecha_nacimiento", row("fecha_nacimiento_pf"))
|
|||
|
|
|||
|
If row("curp_pf") <> "" Then
|
|||
|
myXmlTextWriter.WriteElementString("curp", row("curp_pf"))
|
|||
|
End If
|
|||
|
|
|||
|
myXmlTextWriter.WriteElementString("rfc", row("rfc_pf"))
|
|||
|
|
|||
|
If row("pais_nacimiento_pf") <> "" Then
|
|||
|
myXmlTextWriter.WriteElementString("pais_nacimiento", row("pais_nacimiento_pf"))
|
|||
|
End If
|
|||
|
|
|||
|
|
|||
|
myXmlTextWriter.WriteElementString("pais_nacionalidad", row("pais_nacionalidad_pf"))
|
|||
|
myXmlTextWriter.WriteElementString("actividad_economica", row("actividad_economica_pf"))
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra persona_fisica
|
|||
|
End If
|
|||
|
|
|||
|
'razon_social_pm = CleanInput(row("razon_social_pm"))
|
|||
|
razon_social_pm = row("razon_social_pm")
|
|||
|
If razon_social_pm <> "" Then
|
|||
|
myXmlTextWriter.WriteStartElement("persona_moral") 'abre persona_moral
|
|||
|
myXmlTextWriter.WriteElementString("razon_social", razon_social_pm)
|
|||
|
myXmlTextWriter.WriteElementString("fecha_constitucion", row("fecha_constitucion_pm"))
|
|||
|
myXmlTextWriter.WriteElementString("rfc", row("rfc_pm"))
|
|||
|
myXmlTextWriter.WriteElementString("pais_nacionalidad", row("pais_nacionalidad_pm"))
|
|||
|
myXmlTextWriter.WriteElementString("giro_mercantil", row("giro_mercantil_pm"))
|
|||
|
myXmlTextWriter.WriteElementString("apoderado_legal", row("apoderado_legal_pm"))
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra persona_moral
|
|||
|
End If
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra tipo_persona
|
|||
|
myXmlTextWriter.WriteStartElement("domicilio") 'abre domicilio
|
|||
|
domicilioNacionalUnificado = row("domicilio_nacional_unificado")
|
|||
|
'domicilioNacionalSeparado = row("entidad_federativa_nacional_separado")
|
|||
|
If Trim(domicilioNacionalUnificado) <> "" Then 'Or Trim(domicilioNacionalSeparado) <> "" Then
|
|||
|
myXmlTextWriter.WriteStartElement("nacional") 'abre nacional
|
|||
|
|
|||
|
myXmlTextWriter.WriteStartElement("tipo_domicilio") 'abre tipo_domicilio
|
|||
|
If Trim(domicilioNacionalUnificado) <> "" Then
|
|||
|
myXmlTextWriter.WriteStartElement("unificado") 'abre unificado
|
|||
|
myXmlTextWriter.WriteElementString("domicilio_unificado", row("domicilio_nacional_unificado"))
|
|||
|
myXmlTextWriter.WriteElementString("ciudad_poblacion", row("ciudad_poblacion_nacional_unificado"))
|
|||
|
myXmlTextWriter.WriteElementString("codigo_postal", row("codigo_postal_nacional_unificado"))
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra unificado
|
|||
|
End If
|
|||
|
'If Trim(domicilioNacionalSeparado) <> "" Then
|
|||
|
' myXmlTextWriter.WriteStartElement("separado") 'abre separado
|
|||
|
' myXmlTextWriter.WriteElementString("entidad_federativa", row("entidad_federativa_nacional_separado"))
|
|||
|
' myXmlTextWriter.WriteElementString("codigo_postal", row("codigo_postal_nacional_separado"))
|
|||
|
' myXmlTextWriter.WriteElementString("ciudad_poblacion", row("ciudad_poblacion_nacional_separado"))
|
|||
|
' myXmlTextWriter.WriteElementString("delegacion_municipio", row("delegacion_municipio_nacional_separado"))
|
|||
|
' myXmlTextWriter.WriteElementString("colonia", row("colonia_nacional_separado"))
|
|||
|
' myXmlTextWriter.WriteElementString("calle", row("calle_nacional_separado"))
|
|||
|
' myXmlTextWriter.WriteElementString("numero_exterior", row("numero_exterior_nacional_separado"))
|
|||
|
' myXmlTextWriter.WriteElementString("numero_interior", row("numero_interior_nacional_separado"))
|
|||
|
' myXmlTextWriter.WriteEndElement() 'cierra separado
|
|||
|
'End If
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra tipo_domicilio
|
|||
|
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra nacional
|
|||
|
End If
|
|||
|
domicilioExtranjeroUnificado = row("domicilio_extranjero_unificado")
|
|||
|
'domicilioExtranjeroSeparado = row("estado_provincia_extranjero_separado")
|
|||
|
pais_extranjero = row("pais_extranjero")
|
|||
|
If pais_extranjero <> "" Then
|
|||
|
myXmlTextWriter.WriteStartElement("extranjero") 'abre extranjero
|
|||
|
myXmlTextWriter.WriteElementString("pais", row("pais_extranjero"))
|
|||
|
|
|||
|
myXmlTextWriter.WriteStartElement("tipo_domicilio") 'abre tipo_domicilio
|
|||
|
If Trim(domicilioExtranjeroUnificado) <> "" Then
|
|||
|
myXmlTextWriter.WriteStartElement("unificado") 'abre unificado
|
|||
|
myXmlTextWriter.WriteElementString("domicilio_unificado", row("domicilio_extranjero_unificado"))
|
|||
|
myXmlTextWriter.WriteElementString("ciudad_poblacion", row("ciudad_poblacion_extranjero_unificado"))
|
|||
|
myXmlTextWriter.WriteElementString("codigo_postal", row("codigo_postal_extranjero_unificado"))
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra unificado
|
|||
|
End If
|
|||
|
'If Trim(domicilioExtranjeroSeparado) <> "" Then
|
|||
|
' myXmlTextWriter.WriteStartElement("separado") 'abre separado
|
|||
|
' myXmlTextWriter.WriteElementString("estado_provincia", row("estado_provincia_extranjero_separado"))
|
|||
|
' myXmlTextWriter.WriteElementString("codigo_postal", row("codigo_postal_extranjero_separado"))
|
|||
|
' myXmlTextWriter.WriteElementString("ciudad_poblacion", row("ciudad_poblacion_extranjero_separado"))
|
|||
|
' myXmlTextWriter.WriteElementString("colonia", row("colonia_extranjero_separado"))
|
|||
|
' myXmlTextWriter.WriteElementString("calle", row("calle_extranjero_separado"))
|
|||
|
' myXmlTextWriter.WriteElementString("numero_exterior", row("numero_exterior_extranjero_separado"))
|
|||
|
' myXmlTextWriter.WriteElementString("numero_interior", row("numero_interior_extranjero_separado"))
|
|||
|
' myXmlTextWriter.WriteEndElement() 'cierra separado
|
|||
|
'End If
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra tipo_domicilio
|
|||
|
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra extranjero
|
|||
|
End If
|
|||
|
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra domicilio
|
|||
|
|
|||
|
myXmlTextWriter.WriteStartElement("telefono") 'abre telefono
|
|||
|
myXmlTextWriter.WriteElementString("numero_telefono", row("numero_telefono"))
|
|||
|
'myXmlTextWriter.WriteElementString("clave_pais", row("clave_pais_telefono"))
|
|||
|
'myXmlTextWriter.WriteElementString("extension", row("extension_telefono"))
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra telefono
|
|||
|
'myXmlTextWriter.WriteElementString("correo_electronico", row("correo_electronico"))
|
|||
|
'myXmlTextWriter.WriteElementString("fiel", row("fiel"))
|
|||
|
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra persona
|
|||
|
|
|||
|
'Termina Persona
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra operacio
|
|||
|
Next
|
|||
|
myXmlTextWriter.WriteEndElement() 'cierra operaciones
|
|||
|
myXmlTextWriter.WriteEndElement() 'reporte cierra
|
|||
|
myXmlTextWriter.Flush()
|
|||
|
myXmlTextWriter.Close()
|
|||
|
|
|||
|
End Sub
|
|||
|
|
|||
|
Function CleanInput(strIn As String) As String
|
|||
|
' Replace invalid characters with empty strings.
|
|||
|
Try
|
|||
|
Return Regex.Replace(strIn, "[^\w\.@-]", "")
|
|||
|
' If we timeout when replacing invalid characters,
|
|||
|
' we should return String.Empty.
|
|||
|
Catch e As Exception
|
|||
|
Return String.Empty
|
|||
|
End Try
|
|||
|
End Function
|
|||
|
Private Function GetData() As DataSet
|
|||
|
Dim Classcom As New clsComplejo
|
|||
|
Dim ClassCatalogos As New ClassCatalogos
|
|||
|
Dim SQL As String
|
|||
|
Dim FILA As DataRow
|
|||
|
Dim Parametros As New ArrayList
|
|||
|
Dim DsDatos As New DataSet
|
|||
|
Dim mesReportado As String
|
|||
|
|
|||
|
|
|||
|
mesReportado = cboYear.SelectedItem & "-" & cboMes.SelectedIndex + 1
|
|||
|
Try
|
|||
|
Dim anio As String
|
|||
|
Dim mes As String
|
|||
|
If Len(mesReportado) = 6 Then
|
|||
|
anio = Mid(mesReportado, 1, 4)
|
|||
|
mes = "0" & Mid(mesReportado, 6, 6)
|
|||
|
mesReportado = anio & "-" & mes
|
|||
|
End If
|
|||
|
SQL = "sp_ConsultaFTI '" & mesReportado & "'"
|
|||
|
DsDatos = Classcom.fdtDataSet(SQL)
|
|||
|
Return DsDatos
|
|||
|
Catch ex As Exception
|
|||
|
MessageBox.Show("Error de conexión" & ex.Message, "Minds", MessageBoxButtons.OK, MessageBoxIcon.Warning)
|
|||
|
End Try
|
|||
|
End Function
|
|||
|
|
|||
|
Private Sub btnModificatorio_Click(sender As System.Object, e As System.EventArgs) Handles btnModificatorio.Click
|
|||
|
If gridFTI.SelectedRows.Count > 0 Then
|
|||
|
Dim detalleFTI As frmDetalleFTI = New frmDetalleFTI
|
|||
|
detalleFTI.idFTI = gridFTI.Columns(0).CellValue(gridFTI.Row)
|
|||
|
|
|||
|
'Valida mes
|
|||
|
detalleFTI.ValidaMes = ValidaMes()
|
|||
|
|
|||
|
'abre formulario detalle
|
|||
|
detalleFTI.ShowDialog()
|
|||
|
|
|||
|
'actualiza grid
|
|||
|
llenarGrid()
|
|||
|
|
|||
|
'abrirDetalle = False
|
|||
|
Else
|
|||
|
MessageBox.Show("Debe seleccionar un elemento de la lista.", "Minds", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
|||
|
End If
|
|||
|
|
|||
|
End Sub
|
|||
|
End Class
|