You are on page 1of 9

Public Class Login Dim Usuario As String Dim Password As String Dim Pos As Integer Private Sub Form1_Load(ByVal

sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'FantasyDataSet.Usuarios' table. You can move, or remove it, as needed. Me.UsuariosTableAdapter.Fill(Me.FantasyDataSet.Usuarios) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Usuario = TextBox1.Text Password = TextBox2.Text Pos = Me.Usuarios.Find("nickname", Usuario) If Pos < 0 Then Me.Usuarios.Position = Pos If Me.Usuarios.Current("passw") = Password Then My.Forms.Menu.MenuStrip1.Items(1).Enabled = True Close() Else

MsgBox("Contrasea Incorrecta") End If Else MsgBox("Usuario Incorrecto") End If End Sub End Class

Public Class Menu Private Sub IniciarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IniciarToolStripMenuItem.Click My.Forms.Login.ShowDialog() End Sub Private Sub CerrarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CerrarToolStripMenuItem.Click End End Sub

Private Sub NuevasModelosToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NuevasModelosToolStripMenuItem.Click My.Forms.NuevosM.ShowDialog() End Sub Private Sub NuevosRepresentantesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NuevosRepresentantesToolStripMenuItem.Click My.Forms.NuevosR.ShowDialog() End Sub Private Sub DetalleModelosToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DetalleModelosToolStripMenuItem.Click My.Forms.VDModelo.ShowDialog() End Sub Private Sub DetalleRepresentantesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DetalleRepresentantesToolStripMenuItem.Click My.Forms.VDRepresentantes.ShowDialog() End Sub Private Sub GridModelosToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GridModelosToolStripMenuItem.Click My.Forms.VGModelo.ShowDialog() End Sub

Private Sub GridRepresentantesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GridRepresentantesToolStripMenuItem.Click My.Forms.VGRepresentante.ShowDialog() End Sub Private Sub Menu_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class

Public Class NuevosM Private Sub NuevosM_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'TODO: This line of code loads data into the 'FantasyDataSet.Modelos' table. You can move, or remove it, as needed. Me.ModelosTableAdapter.Fill(Me.FantasyDataSet.Modelos) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.ModelosBindingSource.AddNew() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.ModelosBindingSource.RemoveCurrent() Button2.PerformClick() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Validate() Me.ModelosBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.FantasyDataSet) Me.FantasyDataSet.AcceptChanges() MsgBox("Datos Actualizados") End Sub End Class

Public Class NuevosR Private Sub NuevosR_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'FantasyDataSet.Representante' table. You can move, or remove it, as needed. Me.RepresentanteTableAdapter.Fill(Me.FantasyDataSet.Repre sentante) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.RepresentanteBindingSource.AddNew() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Validate() Me.RepresentanteBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.FantasyDataSet) Me.FantasyDataSet.AcceptChanges()

MsgBox("Datos Actualizados") End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.RepresentanteBindingSource.RemoveCurrent() Button2.PerformClick() End Sub End Class

Public Class VDModelo Private Sub VDModelo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'FantasyDataSet.Modelos' table. You can move, or remove it, as needed. Me.ModelosTableAdapter.Fill(Me.FantasyDataSet.Modelos) End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.ModelosBindingSource.MoveFirst() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.ModelosBindingSource.MovePrevious() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.ModelosBindingSource.MoveNext() End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.ModelosBindingSource.MoveLast() End Sub End Class

Public Class VGModelo

Private Sub VGModelo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'FantasyDataSet.Modelos' table. You can move, or remove it, as needed. Me.ModelosTableAdapter.Fill(Me.FantasyDataSet.Modelos) End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged Me.ModelosBindingSource.Filter = "pais like '" + TextBox1.Text + "%'" End Sub End Class

You might also like