Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/10/2009, 23:17
Avatar de BaByRoDrI
BaByRoDrI
 
Fecha de Ingreso: julio-2009
Ubicación: Mexico
Mensajes: 60
Antigüedad: 14 años, 10 meses
Puntos: 1
Exclamación Registrador

Registrador:


principal.frm(Form1):
Código vb:
Ver original
  1. Private Sub Form_Load()
  2. Dim running As Integer
  3. running = App.PrevInstance
  4. If running <> 0 Then
  5. MsgBox "El Programa ya se esta ejecutando", 0 + 48, "News"
  6. End
  7. End If
  8. End Sub
  9. Private Sub pc1_Click()
  10. statuspc = 1
  11. If Label1.Caption = "DISPONIBLE" Then
  12. Unload principal
  13. registro.Show
  14. Else
  15. MsgBox "Elige otra computadora, esta ya esta ocupada =(", vbCritical, "Error"
  16. End If
  17. End Sub
  18. Private Sub pc2_Click()
  19. statuspc = 2
  20. If Label2.Caption = "DISPONIBLE" Then
  21. Unload principal
  22. registro.Show
  23. Else
  24. MsgBox "Elige otra computadora, esta ya esta ocupada =(", vbCritical, "Error"
  25. End If
  26. End Sub
  27. Private Sub pc3_Click()
  28. statuspc = 3
  29. If Label3.Caption = "DISPONIBLE" Then
  30. Unload principal
  31. registro.Show
  32. Else
  33. MsgBox "Elige otra computadora, esta ya esta ocupada =(", vbCritical, "Error"
  34. End If
  35. End Sub
  36. Private Sub pc4_Click()
  37. statuspc = 4
  38. If Label4.Caption = "DISPONIBLE" Then
  39. Unload principal
  40. registro.Show
  41. Else
  42. MsgBox "Elige otra computadora, esta ya esta ocupada =(", vbCritical, "Error"
  43. End If
  44. End Sub
  45. Private Sub pc5_Click()
  46. statuspc = 5
  47. If Label5.Caption = "DISPONIBLE" Then
  48. Unload principal
  49. registro.Show
  50. Else
  51. MsgBox "Elige otra computadora, esta ya esta ocupada =(", vbCritical, "Error"
  52. End If
  53. End Sub

registro.frm(Form2):
Código vb:
Ver original
  1. Private Sub Form_Load()
  2. Command1.Enabled = False
  3. End Sub
  4. Private Sub apellidop_Change()
  5. If apellidop.Text <> "" And apellidom.Text <> "" And nombre.Text <> "" And cuenta.Text <> "" Then
  6. Command1.Enabled = True
  7. Else
  8. Command1.Enabled = False
  9. End If
  10. End Sub
  11. Private Sub apellidom_Change()
  12. If apellidop.Text <> "" And apellidom.Text <> "" And nombre.Text <> "" And cuenta.Text <> "" Then
  13. Command1.Enabled = True
  14. Else
  15. Command1.Enabled = False
  16. End If
  17. End Sub
  18. Private Sub nombre_Change()
  19. If apellidop.Text <> "" And apellidom.Text <> "" And nombre.Text <> "" And cuenta.Text <> "" Then
  20. Command1.Enabled = True
  21. Else
  22. Command1.Enabled = False
  23. End If
  24. End Sub
  25. Private Sub cuenta_Change()
  26. If apellidop.Text <> "" And apellidom.Text <> "" And nombre.Text <> "" And cuenta.Text <> "" Then
  27. Command1.Enabled = True
  28. Else
  29. Command1.Enabled = False
  30. End If
  31. End Sub
  32. Private Sub Command1_Click()
  33. MsgBox "Registrado. Disfruta tu estancia", vbInformation, "Registro exitoso"
  34. Sleep 250
  35. Call Ocuparpc
  36. Sleep 250
  37. 'Registro BD
  38. Sleep 250
  39. apellidop.Text = ""
  40. apellidom.Text = ""
  41. nombre.Text = ""
  42. cuenta.Text = ""
  43. Sleep 250
  44. Unload registro
  45. principal.Show
  46. End Sub
  47. Private Sub Command2_Click()
  48. apellidop.Text = ""
  49. apellidom.Text = ""
  50. nombre.Text = ""
  51. cuenta.Text = ""
  52. Sleep 250
  53. Unload registro
  54. principal.Show
  55. End Sub

funciones.bas(Module1):
Código vb:
Ver original
  1. Function Limpiaregistro()
  2.  
  3. End Function
  4. Function Bloquearpc()
  5.  
  6. End Function
  7. Function Ocuparpc()
  8. Select Case principal.statuspc
  9. Case 1
  10. principal.Label1.Caption = "NO DISPONIBLE"
  11. Case 2
  12. principal.Label2.Caption = "NO DISPONIBLE"
  13. Case 3
  14. principal.Label3.Caption = "NO DISPONIBLE"
  15. Case 4
  16. principal.Label4.Caption = "NO DISPONIBLE"
  17. Case 5
  18. principal.Label5.Caption = "NO DISPONIBLE"
  19. End Select
  20. End Function

Aquí les dejo el proyecto:
rapidshare.com/files/288825115/Centro_de_computo.rar

Última edición por BaByRoDrI; 04/10/2009 a las 23:22