client/Actualizadores/frmParam.vb
2020-05-06 18:18:29 -05:00

333 lines
15 KiB
VB.net

Public Class frmParam
Dim rutaAntR As String
Dim rutaAntI As String
Dim rutaAntP As String
Dim rutaAntC As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRutaRelevantes.Click
FolderBrowserDialog.ShowDialog()
txtRutaRelevantes.Text = FolderBrowserDialog.SelectedPath
btnGuardarRelevantes.Enabled = True
Colores()
End Sub
Private Sub BTCerrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTCerrar.Click
Dim valor As String
If (rutaAntR <> txtRutaRelevantes.Text) Then
valor = MessageBox.Show("¿Desea salir sin guardar los cambios?", "Ruta Relevantes", MessageBoxButtons.OKCancel)
If valor = 2 Then
Return
End If
End If
If (rutaAntI <> txtRutaInusuales.Text) Then
valor = MessageBox.Show("¿Desea salir sin guardar los cambios?", "Ruta Inusuales", MessageBoxButtons.OKCancel)
If valor = 2 Then
Return
End If
End If
If (rutaAntP <> txtRutaPreocupantes.Text) Then
valor = MessageBox.Show("¿Desea salir sin guardar los cambios?", "Ruta Preocupantes", MessageBoxButtons.OKCancel)
If valor = 2 Then
Return
End If
End If
Me.Close()
End Sub
Private Sub BTAceptar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGuardarRelevantes.Click
Dim strSqlParam As String
Dim ClassCom As New clsComplejo
Try
ClassCom.fdtDataSet("SELECT IdOrganismoInternacional,idinstitucionFinanciera FROM ParamRep ")
If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
'strSqlParam = " UPDATE ParamRep SET IdOrganismoInternacional = '001002',idinstitucionFinanciera = '" & Me.CbOInFinanciera.SelectedValue & "',rutainusuales = '" & TXTRutaInusuales.Text & "'"
strSqlParam = " UPDATE ParamRep SET rutaRelevantes = '" & txtRutaRelevantes.Text & "'"
ClassCom.sbGuardaModifica(strSqlParam)
Else
strSqlParam = " INSERT INTO ParamRep (IdOrganismoInternacional,idinstitucionFinanciera,rutainusuales) VALUES ('1002','" & CbOInFinanciera.SelectedValue & "','" & txtRutaRelevantes.Text & "')"
ClassCom.sbInserta(strSqlParam)
End If
Dim coneccion As New ClassMyUtils
coneccion.RT_Auditoria(clsVaribles.varUsuario, 129, 1, "MODIFICACIÓN DE LA RUTA REPORTES RELEVANTES (ANTERIOR:" & rutaAntR & ", NUEVO:" & txtRutaRelevantes.Text & ")")
btnGuardarRelevantes.Enabled = False
rutaAntR = txtRutaRelevantes.Text
Catch ex As Exception
MessageBox.Show("Erroral grabar Paramrep " & ex.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub CbOInFinanciera_DropDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles CbOInFinanciera.DropDown
Dim SQLPaises As String
Dim clCmj1 As clsComplejo
Try
clCmj1 = New clsComplejo
SQLPaises = "SELECT idInstitucionFinanciera as clave,InstitucionFinanciera nombre FROM cat_InstitucionFinanciera ORDER BY InstitucionFinanciera"
clCmj1.cm.CommandText = SQLPaises
clCmj1.ad.SelectCommand = clCmj1.cm
clCmj1.sbLlenaCombo2(SQLPaises, CbOInFinanciera)
Catch ex As Exception
MessageBox.Show("Error CboInstitucion_DropDown: " & ex.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CbOInFinanciera.SelectedIndexChanged
Dim Keywords = IIf(String.IsNullOrEmpty(CbOInFinanciera.Text), "N/A", CbOInFinanciera.Text)
If Keywords = "N/A" Then
Exit Sub
End If
Try
'Label3.Text = "Clave de la Institucion Financiera: " & CbOInFinanciera.SelectedValue.ToString & ""
lblCveNombreSofome.Visible = True
Catch ex As Exception
End Try
End Sub
Private Sub frmParam_FormClosed(sender As Object, e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
Dim coneccion As New ClassMyUtils
'coneccion.RT_Auditoria(129, "SALIDA PARAMETROS REPORTE CNBV")
coneccion.RT_Auditoria(clsVaribles.varUsuario, 129, 1, "SALIDA PARAMETROS REPORTE CNBV ")
End Sub
Private Sub frmParam_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim SQL As String
Dim clCmj1 As clsComplejo
Dim Classcom As New SenteciasSQL.ClassSQL
Try
Dim coneccion As New ClassMyUtils
coneccion.RT_Auditoria(clsVaribles.varUsuario, 129, 1, "ENTRADA PARAMETROS REPORTE CNBV")
clCmj1 = New clsComplejo
Classcom.fdtDataSet("SELECT * FROM ParamRep")
If Classcom.ds.Tables(0).Rows.Count <> 0 Then
txtRutaRelevantes.Text = Classcom.ds.Tables(0).Rows(0).Item("rutaRelevantes")
txtRutaInusuales.Text = Classcom.ds.Tables(0).Rows(0).Item("rutaInusuales")
txtRutaPreocupantes.Text = Classcom.ds.Tables(0).Rows(0).Item("rutaPreocupantes")
txtRutaCarteras.Text = Classcom.ds.Tables(0).Rows(0).Item("rutacarteras")
rutaAntR = txtRutaRelevantes.Text
rutaAntI = txtRutaInusuales.Text
rutaAntP = txtRutaPreocupantes.Text
rutaAntC = txtRutaCarteras.Text
End If
SQL = "SELECT cf.IDInstitucionFinanciera as clave,InstitucionFinanciera nombre FROM Cat_InstitucionFinanciera cf, ParamRep pr where cf.IDInstitucionFinanciera=pr.IDInstitucionFinanciera ORDER BY cf.IDInstitucionFinanciera DESC"
Dim fila As DataRow
Dim Cl As SenteciasSQL.ClassSQL = New SenteciasSQL.ClassSQL
Cl.fdtDataSet(SQL)
If Cl.ds.Tables(0).Rows.Count <> 0 Then
fila = Cl.ds.Tables(0).Rows(0)
lblCveNombreSofome.Text = fila(0).ToString() & " - " & fila(1).ToString()
Else
lblCveNombreSofome.Text = "000000 - Error. No se obtuvo el nombre de la Institución Financiera"
End If
'clCmj1.cm.CommandText = SQLPaises
'clCmj1.ad.SelectCommand = clCmj1.cm
' FINANCIERA FINCA, S.A. DE C.V., SOFOM, E.N.R. 691231
'clCmj1.sbLlenaCombo2(SQLPaises, CbOInFinanciera)
'lblCveNombreSofome.Text = CbOInFinanciera.SelectedValue & " - " & CbOInFinanciera.Text
' aqui darle un posicionamiento a la clave de finca
'CbOInFinanciera.SelectedValue = 694224
'clCmj1 = New clsComplejo
'clCmj1.fdtDataSet("SELECT IdOrganismoInternacional,idinstitucionFinanciera,rutainusuales FROM ParamRep ")
'If clCmj1.ds.Tables(0).Rows.Count <> 0 Then
' CbOInFinanciera.SelectedValue = CLng(clCmj1.ds.Tables(0).Rows(0).Item("idinstitucionFinanciera").ToString)
' If Not IsDBNull(clCmj1.ds.Tables(0).Rows(0).Item("rutainusuales")) Then
' TXTRutaInusuales.Text = clCmj1.ds.Tables(0).Rows(0).Item("rutainusuales").ToString.Trim
' End If
'End If
'verifica el boton de la ruta
'BTRutaInusuales
'clCmj1 = New clsComplejo
'SQLPaises = " select activo from perfilpermiso p "
'SQLPaises = SQLPaises & " inner join cat_permiso c on p.idpermiso = c.idpermiso and p.idaplicativo = c.idaplicativo"
'SQLPaises = SQLPaises & " where c.idaplicativo = 1 and p.activo = 1 and p.idperfil = " & clsVaribles.VarPerfil & " order by c.idpermiso "
'clCmj1.fdtDataSet(SQLPaises)
'If clCmj1.ds.Tables(0).Rows.Count <> 0 Then
'BTRutaInusuales.Visible = True
'Else
'BTRutaInusuales.Visible = False
'End If
desHeader.Text = Me.Text
Colores()
Catch ex As Exception
MessageBox.Show("Error CboInstitucion_DropDown: " & ex.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub Colores()
If btnGuardarRelevantes.Enabled = False Then
btnGuardarRelevantes.BackColor = Color.DarkGray
Else
btnGuardarRelevantes.BackColor = Color.Black
End If
If btnGuardarInusuales.Enabled = False Then
btnGuardarInusuales.BackColor = Color.DarkGray
Else
btnGuardarInusuales.BackColor = Color.Black
End If
If btnGuardarPreocupantes.Enabled = False Then
btnGuardarPreocupantes.BackColor = Color.DarkGray
Else
btnGuardarPreocupantes.BackColor = Color.Black
End If
If btnGuardarCarteras.Enabled = False Then
btnGuardarCarteras.BackColor = Color.DarkGray
Else
btnGuardarCarteras.BackColor = Color.Black
End If
End Sub
Private Sub Label3_Click(sender As System.Object, e As System.EventArgs) Handles lblCveNombreSofome.Click
End Sub
Private Sub TXTRutaInusuales_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtRutaRelevantes.TextChanged
End Sub
Private Sub btnRutaInusuales_Click(sender As Object, e As EventArgs) Handles btnRutaInusuales.Click
FolderBrowserDialog.ShowDialog()
txtRutaInusuales.Text = FolderBrowserDialog.SelectedPath
btnGuardarInusuales.Enabled = True
Colores()
End Sub
Private Sub btnRutaPreocupantes_Click(sender As Object, e As EventArgs) Handles btnRutaPreocupantes.Click
FolderBrowserDialog.ShowDialog()
txtRutaPreocupantes.Text = FolderBrowserDialog.SelectedPath
btnGuardarPreocupantes.Enabled = True
Colores()
End Sub
Private Sub btnGuardarInusuales_Click(sender As Object, e As EventArgs) Handles btnGuardarInusuales.Click
Dim strSqlParam As String
Dim ClassCom As New clsComplejo
Try
ClassCom.fdtDataSet("SELECT IdOrganismoInternacional,idinstitucionFinanciera FROM ParamRep ")
If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
'strSqlParam = " UPDATE ParamRep SET IdOrganismoInternacional = '001002',idinstitucionFinanciera = '" & Me.CbOInFinanciera.SelectedValue & "',rutainusuales = '" & TXTRutaInusuales.Text & "'"
strSqlParam = " UPDATE ParamRep SET rutainusuales = '" & txtRutaInusuales.Text & "'"
ClassCom.sbGuardaModifica(strSqlParam)
Else
strSqlParam = " INSERT INTO ParamRep (IdOrganismoInternacional,idinstitucionFinanciera,rutainusuales) VALUES ('1002','" & CbOInFinanciera.SelectedValue & "','" & txtRutaInusuales.Text & "')"
ClassCom.sbInserta(strSqlParam)
End If
btnGuardarInusuales.Enabled = False
rutaAntI = txtRutaInusuales.Text
Dim coneccion As New ClassMyUtils
coneccion.RT_Auditoria(clsVaribles.varUsuario, 129, 1, "MODIFICACIÓN DE LA RUTA REPORTES INUSUALES (ANTERIOR:" & rutaAntI & ", NUEVO:" & txtRutaInusuales.Text & ")")
Colores()
Catch ex As Exception
MessageBox.Show("Erroral grabar Paramrep " & ex.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub btnGuardarPreocupantes_Click(sender As Object, e As EventArgs) Handles btnGuardarPreocupantes.Click
Dim strSqlParam As String
Dim ClassCom As New clsComplejo
Try
ClassCom.fdtDataSet("SELECT IdOrganismoInternacional,idinstitucionFinanciera FROM ParamRep ")
If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
'strSqlParam = " UPDATE ParamRep SET IdOrganismoInternacional = '001002',idinstitucionFinanciera = '" & Me.CbOInFinanciera.SelectedValue & "',rutainusuales = '" & TXTRutaInusuales.Text & "'"
strSqlParam = " UPDATE ParamRep SET rutaPreocupantes= '" & txtRutaPreocupantes.Text & "'"
ClassCom.sbGuardaModifica(strSqlParam)
Else
strSqlParam = " INSERT INTO ParamRep (IdOrganismoInternacional,idinstitucionFinanciera,rutainusuales) VALUES ('1002','" & CbOInFinanciera.SelectedValue & "','" & txtRutaPreocupantes.Text & "')"
ClassCom.sbInserta(strSqlParam)
End If
btnGuardarPreocupantes.Enabled = False
rutaAntP = txtRutaPreocupantes.Text
Dim coneccion As New ClassMyUtils
coneccion.RT_Auditoria(clsVaribles.varUsuario, 129, 1, "MODIFICACIÓN DE LA RUTA REPORTES INUSUALES (ANTERIOR:" & rutaAntP & ", NUEVO:" & txtRutaPreocupantes.Text & ")")
Colores()
Catch ex As Exception
MessageBox.Show("Erroral grabar Paramrep " & ex.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub btnGuardarCarteras_Click(sender As Object, e As EventArgs) Handles btnGuardarCarteras.Click
Dim strSqlParam As String
Dim ClassCom As New clsComplejo
Try
ClassCom.fdtDataSet("SELECT IdOrganismoInternacional,idinstitucionFinanciera FROM ParamRep ")
If ClassCom.ds.Tables(0).Rows.Count <> 0 Then
'strSqlParam = " UPDATE ParamRep SET IdOrganismoInternacional = '001002',idinstitucionFinanciera = '" & Me.CbOInFinanciera.SelectedValue & "',rutainusuales = '" & TXTRutaInusuales.Text & "'"
strSqlParam = " UPDATE ParamRep SET rutacarteras = '" & txtRutaCarteras.Text & "'"
ClassCom.sbGuardaModifica(strSqlParam)
Else
strSqlParam = " INSERT INTO ParamRep (IdOrganismoInternacional,idinstitucionFinanciera,rutacarteras) VALUES ('1002','" & CbOInFinanciera.SelectedValue & "','" & txtRutaCarteras.Text & "')"
ClassCom.sbInserta(strSqlParam)
End If
btnGuardarCarteras.Enabled = False
Dim coneccion As New ClassMyUtils
coneccion.RT_Auditoria(clsVaribles.varUsuario, 129, 1, "MODIFICACIÓN DE LA RUTA REPORTES CARTERAS DE VALORES (ANTERIOR:" & rutaAntC & ", NUEVO:" & txtRutaCarteras.Text & ")")
rutaAntC = txtRutaCarteras.Text
Colores()
Catch ex As Exception
MessageBox.Show("Erroral grabar Paramrep " & ex.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub btnRutaCarteras_Click(sender As Object, e As EventArgs) Handles btnRutaCarteras.Click
FolderBrowserDialog.ShowDialog()
txtRutaCarteras.Text = FolderBrowserDialog.SelectedPath
btnGuardarCarteras.Enabled = True
Colores()
End Sub
End Class