client/Seguridad/FrmPasswConfig.vb

201 lines
7.8 KiB
VB.net

Public Class FrmPasswConfig
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles cboInserta.Click
Dim sqlQuery As String
Dim Classcom As New clsComplejo
Dim valCheck As Integer = 0
If Val(Me.TextBox3.Text) > Val(Me.TextBox2.Text) Then
MsgBox("el valor de cambio de PassWord no puede ser MENOR a los Días de expiración de contraseña ")
Exit Sub
End If
'If Me.TextBox9.Text < 8 Or Me.TextBox9.Text > 50 Then
' MsgBox("el valor minimo no puede ser menor a 8 o mayor a 50")
' Exit Sub
'End If
'If Me.TextBox10.Text > 50 Then
' MsgBox("el valor maximo no puede ser mayor a 50 ....")
' Exit Sub
'End If
'If Val(Me.TextBox9.Text) > Val(Me.TextBox10.Text) Then
' MsgBox("el valor minimo no puede ser MAYOR al valor Maximo ....")
' Exit Sub
'End If
sqlQuery = "UPDATE ConfigPassw SET "
'sqlQuery = sqlQuery & "IntentosLogin=" & Me.TextBox1.Text & ","
sqlQuery = sqlQuery & "DiasCambiaContrasena=" & Me.TextBox2.Text & ","
'sqlQuery = sqlQuery & "DiasPrevioExpira=" & Me.TextBox3.Text & ","
sqlQuery = sqlQuery & "DiasBloqueaUsuario=" & Me.TextBox4.Text '& ","
'sqlQuery = sqlQuery & "TimeoutCliente=" & Me.TextBox5.Text & ","
'sqlQuery = sqlQuery & "TimeoutKYC=" & Me.TextBox6.Text & ","
'sqlQuery = sqlQuery & "TimeoutServer=" & Me.TextBox7.Text & ","
'sqlQuery = sqlQuery & "NumeroContrasenas=" & Me.TextBox8.Text & ","
'sqlQuery = sqlQuery & "LengthMin=" & Me.TextBox9.Text & ","
'sqlQuery = sqlQuery & "LengthMax=" & Me.TextBox10.Text & ","
'If Me.CheckBox1.Checked = False Then
' valCheck = 0
'Else
' valCheck = 1
'End If
'sqlQuery = sqlQuery & "Sequence=" & valCheck & ","
'If Me.CheckBox2.Checked = False Then
' valCheck = 0
'Else
' valCheck = 1
'End If
'sqlQuery = sqlQuery & "Repeat=" & valCheck & ","
'If Me.CheckBox3.Checked = False Then
' valCheck = 0
'Else
' valCheck = 1
'End If
'sqlQuery = sqlQuery & "Letras=" & valCheck & ","
'If Me.CheckBox4.Checked = False Then
' valCheck = 0
'Else
' valCheck = 1
'End If
'sqlQuery = sqlQuery & "Numeros=" & valCheck & ","
'If Me.CheckBox5.Checked = False Then
' valCheck = 0
'Else
' valCheck = 1
'End If
'sqlQuery = sqlQuery & "Special=" & valCheck
Classcom.sbGuardaModifica(sqlQuery)
MessageBox.Show("Registro Actualizado correctamente.", "Password", MessageBoxButtons.OK, MessageBoxIcon.Information)
'mdiForm.iTimeout = Me.TextBox5.Text
'AudPrgId
'AudUsrId
'AudMaquina
'AudFecHra
End Sub
Private Sub TextBox1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs)
Dim classCom As New clsComplejo
e.KeyChar = classCom.ValidaCampos("numeros", e.KeyChar)
End Sub
Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs)
End Sub
Private Sub TextBox2_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
Dim classCom As New clsComplejo
e.KeyChar = classCom.ValidaCampos("numeros", e.KeyChar)
End Sub
Private Sub TextBox2_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox2.TextChanged
End Sub
Private Sub TextBox3_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
Dim classCom As New clsComplejo
e.KeyChar = classCom.ValidaCampos("numeros", e.KeyChar)
End Sub
Private Sub TextBox4_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress
Dim classCom As New clsComplejo
e.KeyChar = classCom.ValidaCampos("numeros", e.KeyChar)
End Sub
Private Sub TextBox5_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs)
Dim classCom As New clsComplejo
e.KeyChar = classCom.ValidaCampos("numeros", e.KeyChar)
End Sub
Private Sub TextBox6_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs)
Dim classCom As New clsComplejo
e.KeyChar = classCom.ValidaCampos("numeros", e.KeyChar)
End Sub
Private Sub TextBox7_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs)
Dim classCom As New clsComplejo
e.KeyChar = classCom.ValidaCampos("numeros", e.KeyChar)
End Sub
Private Sub TextBox8_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs)
Dim classCom As New clsComplejo
e.KeyChar = classCom.ValidaCampos("numeros", e.KeyChar)
End Sub
Private Sub TextBox9_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs)
Dim classCom As New clsComplejo
e.KeyChar = classCom.ValidaCampos("numeros", e.KeyChar)
End Sub
Private Sub TextBox10_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs)
Dim classCom As New clsComplejo
e.KeyChar = classCom.ValidaCampos("numeros", e.KeyChar)
End Sub
Private Sub FrmPasswConfig_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim Classcom As New clsComplejo
Dim SQL As String
Dim FILA As DataRow
Dim ds As DataSet
SQL = "SELECT * FROM ConfigPassw"
'Classcom.fdtDataTable(SQL)
ds = Classcom.fdtDataSet(SQL)
If (ds.Tables(0).Rows.Count = 1) Then
'TextBox1.Text = ds.Tables(0).Rows.Item(0)
'TextBox1.Text = ds.Tables.Item(0)
'TextBox1.Text = ds.Tables(0).Rows(0).Item("IntentosLogin")
TextBox2.Text = ds.Tables(0).Rows(0).Item("DiasCambiaContrasena")
TextBox3.Text = ds.Tables(0).Rows(0).Item("DiasPrevioExpira")
TextBox4.Text = ds.Tables(0).Rows(0).Item("DiasBloqueaUsuario")
'TextBox5.Text = ds.Tables(0).Rows(0).Item("TimeoutCliente")
'TextBox6.Text = ds.Tables(0).Rows(0).Item("TimeoutKYC")
'TextBox7.Text = ds.Tables(0).Rows(0).Item("TimeoutServer")
'TextBox8.Text = ds.Tables(0).Rows(0).Item("NumeroContrasenas")
'TextBox9.Text = ds.Tables(0).Rows(0).Item("LengthMin")
'TextBox10.Text = ds.Tables(0).Rows(0).Item("LengthMax")
'If ds.Tables(0).Rows(0).Item("Sequence") = 0 Then
' CheckBox1.Checked = False
'Else
' CheckBox1.Checked = True
'End If
'If ds.Tables(0).Rows(0).Item("Repeat") = 0 Then
' CheckBox2.Checked = False
'Else
' CheckBox2.Checked = True
'End If
'If ds.Tables(0).Rows(0).Item("letras") = 0 Then
' CheckBox3.Checked = False
'Else
' CheckBox3.Checked = True
'End If
'If ds.Tables(0).Rows(0).Item("numeros") = 0 Then
' CheckBox4.Checked = False
'Else
' CheckBox4.Checked = True
'End If
'If ds.Tables(0).Rows(0).Item("Special") = 0 Then
' CheckBox5.Checked = False
'Else
' CheckBox5.Checked = True
'End If
'cboInserta.Visible = False
'cboActualiza.Visible = True
'Else
' cboInserta.Visible = True
' cboActualiza.Visible = False
End If
'BuscaDatos
'Public Function fdtDataTable(ByVal SQL As String) As DataTable
'MsgBox("habilitar boton de Insertar o Actualizar")
'cboInserta.Visible = False
'cboActualiza.Visible = False
End Sub
End Class