miércoles, 23 de noviembre de 2016

EDICIÓN EN VISUAL BASIC .NET

Imports System.Data.OleDb
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.SujetoTableAdapter.Fill(Me.Mi_baseDataSet.Sujeto)
    End Sub

    Private Sub Nuevo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Nuevo.Click
        SujetoBindingSource.AddNew()
        CedulaTextEdit.Focus()
    End Sub

    Private Sub Eliminar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Eliminar.Click
        If MsgBox("Deseas eliminar el registro?", CType(vbQuestion + vbYesNo, MsgBoxStyle), _
                  "Eliminar registro") = vbNo Then Exit Sub
        SujetoBindingSource.RemoveCurrent()
        SujetoTableAdapter.Update(Mi_baseDataSet.Sujeto)
    End Sub

    Private Sub Principio_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Principio.Click
        SujetoBindingSource.MoveFirst()
    End Sub

    Private Sub Anterior_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Anterior.Click
        SujetoBindingSource.MovePrevious()
    End Sub

    Private Sub Siguiente_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Siguiente.Click
        SujetoBindingSource.MoveNext()
    End Sub

    Private Sub Ultimo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Ultimo.Click
        SujetoBindingSource.MoveLast()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SujetoBindingSource.EndEdit()
        SujetoTableAdapter.Update(Mi_baseDataSet.Sujeto)
        MsgBox("La información se guardo correctamente..!", MsgBoxStyle.Information, "Registro de usuarios")
    End Sub

0 comentarios:

Publicar un comentario