Colegio Nacional de Educación Profesional Técnica Del Estado de

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

Colegio Nacional de Educación Profesional Técnica del Estado de

Chihuahua

Elaboración y Mantenimiento de Sistemas de la Información

Practica#4

Interfaz y Pantallas

Jesús Manuel Silva

Grupo: 6101-I

Matricula: 080260779-6
Objetivo: concluir con el diseño del sistema

Material:

 Acces

 Visual Basic

Desarrollo:

1. Terminar con la programación

2. Diseño de pantallas

3. Dimensiones de formularios

4. Colores, fuentes, textos

5. Títulos de formularios

Código
Registro
Public Class Registro
Dim dt As New DataTable
Dim cn As New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Sis
tema\Sistema\Sistema.mdb")
Private Sub Registro_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If (x = 2) Then
Label1.Text = ("Welcome to the registration of a new
account")
Label2.Text = ("Name")
Label3.Text = ("Last name")
Label4.Text = ("Mother's maiden name")
Label5.Text = ("Address")
Label6.Text = ("Birth date")
Label7.Text = ("Account Name")
Label8.Text = ("Password")
Button1.Text = ("Register")
Else
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
cn.Open()
dt.Reset()
Dim GuardarDatos As String = "Insert Into
NuevosRegistros(Nombre,ApellidgoM,ApellidgoP,Domicilio,FechaNac,NombreCue
nta,Contraseña)" & " Values ('" & TextBox1.Text & "','" & TextBox2.Text &
"', '" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text &
"','" & TextBox6.Text & "','" & TextBox7.Text & "')"
Dim dataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos, cn)
dataAdapter.Fill(dt)
If (x = 2) Then
MsgBox("The account was created correctly")
Else
MsgBox("La cuenta se creo correctamente")
End If
dataAdapter.Dispose()
cn.Close()
Me.Hide()
Conectar.Show()
End Sub
End Class
Conectar

Public Class Conectar


Dim cn As New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Sis
tema\Sistema\Sistema.mdb")
Dim f, x, c, n
Dim dt As New DataTable

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Me.Hide()
Usuario.Show()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Me.Hide()
Registro.Show()
End Sub

Private Sub Conectar_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
If (x = 2) Then
Label1.Text = ("Please login your username and password")
Label2.Text = ("Name")
Label3.Text = ("Password")
Button1.Text = ("Login")
Button2.Text = ("Add new administrator")
Button3.Text = ("User login")
Button4.Text = ("Exit")
Else
End If
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
cn.Open()
dt.Reset()
Dim ConsultarDatos As String = "Select * From CuentasAdmin"
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
f = 1
If (TextBox1.Text = CStr(dt.Rows(f)("NombreUsuario"))) And
(TextBox2.Text = CInt(dt.Rows(f)("Contraseña"))) Then
Name = TextBox1.Text
Me.Hide()
Administrador.Show()
Else
End If
dataAdapter.Dispose()
cn.Close()
End Sub
End Class

Pantallas

You might also like