Bueno ando trabajando en un proyecto para mi escuela, la idea es que hay un centro de computo con 50 PCs, la primera parte del proyecto esta enfocada a la comodidad de los alumnos.
Actualmente llegan, tienen que preguntar a la encargada si hay PCs disponibles y se anotan en un cuaderno, la idea es que haya una PC donde llegen y se muestren las PCs disponibles, hagan doble click en la que se quieren registrar, llenen un formulario. Al hacer click en Registar! se comprobará que sus apellidos y nombre coincidan con el de su N° de cuenta de ser así registra el N° de cuenta, N° de PC y hora en que se registro.
Bueno aqui pongo los codigos:
principal.frm(Form1):
Public statuspc As Integer
Private Sub Form_Load()
Dim running As Integer
running = App.PrevInstance
If running <> 0 Then
MsgBox "El Programa ya se esta ejecutando", 0 + 48, "News"
End
End If
End Sub
Private Sub pc1_Click()
statuspc = 1
If Label1.Caption = "DISPONIBLE" Then
Unload principal
registro.Show
Else
MsgBox "Elige otra computadora, esta ya esta ocupada =(", vbCritical, "Error"
End If
End Sub
Private Sub pc2_Click()
statuspc = 2
If Label2.Caption = "DISPONIBLE" Then
Unload principal
registro.Show
Else
MsgBox "Elige otra computadora, esta ya esta ocupada =(", vbCritical, "Error"
End If
End Sub
Private Sub pc3_Click()
statuspc = 3
If Label3.Caption = "DISPONIBLE" Then
Unload principal
registro.Show
Else
MsgBox "Elige otra computadora, esta ya esta ocupada =(", vbCritical, "Error"
End If
End Sub
Private Sub pc4_Click()
statuspc = 4
If Label4.Caption = "DISPONIBLE" Then
Unload principal
registro.Show
Else
MsgBox "Elige otra computadora, esta ya esta ocupada =(", vbCritical, "Error"
End If
End Sub
Private Sub pc5_Click()
statuspc = 5
If Label5.Caption = "DISPONIBLE" Then
Unload principal
registro.Show
Else
MsgBox "Elige otra computadora, esta ya esta ocupada =(", vbCritical, "Error"
End If
End Sub
registro.frm(Form2):
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Form_Load()
Command1.Enabled = False
End Sub
Private Sub apellidop_Change()
If apellidop.Text <> "" And apellidom.Text <> "" And nombre.Text <> "" And cuenta.Text <> "" Then
Command1.Enabled = True
Else
Command1.Enabled = False
End If
End Sub
Private Sub apellidom_Change()
If apellidop.Text <> "" And apellidom.Text <> "" And nombre.Text <> "" And cuenta.Text <> "" Then
Command1.Enabled = True
Else
Command1.Enabled = False
End If
End Sub
Private Sub nombre_Change()
If apellidop.Text <> "" And apellidom.Text <> "" And nombre.Text <> "" And cuenta.Text <> "" Then
Command1.Enabled = True
Else
Command1.Enabled = False
End If
End Sub
Private Sub cuenta_Change()
If apellidop.Text <> "" And apellidom.Text <> "" And nombre.Text <> "" And cuenta.Text <> "" Then
Command1.Enabled = True
Else
Command1.Enabled = False
End If
End Sub
Private Sub Command1_Click()
MsgBox "Registrado. Disfruta tu estancia", vbInformation, "Registro exitoso"
Sleep 250
Call Ocuparpc
Sleep 250
'Registro BD
Sleep 250
apellidop.Text = ""
apellidom.Text = ""
nombre.Text = ""
cuenta.Text = ""
Sleep 250
Unload registro
principal.Show
End Sub
Private Sub Command2_Click()
apellidop.Text = ""
apellidom.Text = ""
nombre.Text = ""
cuenta.Text = ""
Sleep 250
Unload registro
principal.Show
End Sub
funciones.bas(module1):
Function Limpiaregistro()
End Function
Function Bloquearpc()
End Function
Function Ocuparpc()
Select Case principal.statuspc
Case 1
principal.Label1.Caption = "NO DISPONIBLE"
Case 2
principal.Label2.Caption = "NO DISPONIBLE"
Case 3
principal.Label3.Caption = "NO DISPONIBLE"
Case 4
principal.Label4.Caption = "NO DISPONIBLE"
Case 5
principal.Label5.Caption = "NO DISPONIBLE"
End Select
End Function
Como se podran cuenta soy muy nuevo en visual basic
, aparte aquí les dejo el source:
http://rapidshare.com/files/288825115/Centro_de_computo.rarDe ante mano, mil gracias por su ayuda y consejos!!
Yo le cambiaria alguinas cosas. pero me quedo una duda
vos sos el que publico de como cambiar a "NO DISPONIBLE" en
www.forosdelweb.com por que ese cdigo es muy similar (Una parte) a la que le aonsegue a un usuario de FDW jaja