Ingenieria Del Software
Imports MySql.Data
Imports MySql.Data.MySqlClient
Public Class Form1
Dim conexion As MySqlConnection
Dim mycomando As MySqlCommand
Dim myadapter As MySqlDataReader
Dim mydata As DataTable
Dim mydataset As DataSet
Dim fila As DataRow
Dim intentos As Integer = 3
Private Sub Form1_Load(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles MyBase.Load
txtusuario.Focus() ' Instruccion para hacer que al iniciar el formulario el cursor de ubique en un texbox especifico
GroupBox3.Enabled = False
End Sub
Private Sub btnlogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlogin.Click
If txtusuario.Text = "" Ortxtclave.Text = "" Then
MsgBox("Debe Ingresar usuario y clave")
Else
Dim buscausu As String
Dim buscacla As String
Dim buscaest As String
conexion = New MySqlConnection
conexion.ConnectionString = "Server=localhost;database=inventario;user id=root;password=111;"
conexion.Open()
mycomando= New MySqlCommand
mycomando.Connection = conexion
mycomando.CommandType = CommandType.Text
buscausu = Me.txtusuario.Text
buscacla = Me.txtclave.Text
buscaest = Me.lblestado.Text
mycomando.CommandText = "select estadousu from usuarios where cedulaemp= " & buscausu & " and claveusu= '" &buscacla & "' ;"
buscaest = mycomando.ExecuteScalar
conexion.Close()
lblestado.Text = buscaest
If buscaest = "" Then
intentos = intentos - 1
If intentos > 0 Then
MsgBox("Usuario o Clave invalida, le quedan disponibles " & intentos & " Intentos ", vbOKOnly)Else
MsgBox("El Usuario ha sido bloqueado", vbOKOnly)
conexion = New MySqlConnection
conexion.ConnectionString = "server=Localhost;User=root;password=111;database=inventario"
conexion.Open()
mycomando = New MySqlCommand()
mycomando.Connection = conexionmycomando.CommandText = "update usuarios set estadousu = 'Inactivo' where cedulaemp = " & txtusuario.Text & " ;"
mycomando.ExecuteNonQuery()
conexion.Close()
End If
End If
If buscaest = "Activo" Then
MsgBox("Bienvenido al Modulo")
Dim a As Newmodulo_inventario
a.Show()
Me.Hide()
End If
If buscaest = "Inactivo" Then
MsgBox("Su estado es: " & buscaest & " ¡ Deberá comunicarse con el administrador !", vbOKOnly)
End If
End If
-------------------------------------------------
End Sub
Timer
Private Sub Timer1_Tick(ByValsender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Bola.Left >= 0 And Bola.Left <= 462 Then
Bola.Left = Bola.Left + 10
End If
If Bola2.Left <= 475 And Bola2.Left >= 27 Then
Bola2.Left = Bola2.Left - 20
End If
If Bola3.Left >= 0 And Bola3.Left <= 445 Then
Bola3.Left =Bola3.Left + 20
End If
If Bola4.Left <= 475 And Bola4.Left >= 40 Then
Bola4.Left = Bola4.Left - 20
End If
If Bola5.Left >= 20 And Bola5.Left <= 413 Then
Bola5.Left = Bola5.Left + 10
End If
If Bola6.Left <= 475 And Bola6.Left >= 70 Then
Bola6.Left = Bola6.Left - 10
End If...
Regístrate para leer el documento completo.