Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
COSTA RICA
CÓDIGO VISUAL BASIC .NET
Formulario de Proveedores
Imports CapaDatos
Imports CapaEntidades
Public Class frmProveedores
Dim ObjetodeClase_EProveedores As New EntiProveedores
Dim ObjetodeClase_FProveedores As New FProveedor
' --> Inicio --> Procedimienot para cerrar deshabilitar el botón cerrar de nuestra aplicación
Dim _enabledCerrar As Boolean = False
COSTA RICA
CÓDIGO VISUAL BASIC .NET
Formulario de Proveedores
' --> Fin --> Procedimienot para cerrar deshabilitar el botón cerrar de nuestra aplicación
Private Sub frmProveedores_Load(sender As Object, e As EventArgs) Handles MyBase.Load
MetodoLimpiar()
MetodoBotonesInicio()
MetedoDeshabilitarCampos()
End Sub
cmbBuscar.Enabled = True
txtBuscar.Enabled = True
btnNuevo.Enabled = False
btnGrabar.Enabled = True
btnBuscar.Enabled = False
txtNombre.Focus()
End Sub
COSTA RICA
CÓDIGO VISUAL BASIC .NET
Formulario de Proveedores
Sub MetodoLimpiar()
txtNombre.Text = ""
txtApellidos.Text = ""
txtCedula.Text = ""
txtRazon.Text = ""
txtContacto.Text = ""
txtDireccion.Text = ""
txtEmail.Text = ""
txttelcasa.Text = ""
txtteloficina.Text = ""
txttelmovil.Text = ""
cmbBuscar.SelectedIndex = 0
dgvProveedores.DataSource = vbNull
btnNuevo.Enabled = True
btnNuevo.Focus()
End Sub
Sub MetodoBotonesInicio()
btnModificar.Enabled = False
btnEliminar.Enabled = False
btnGrabar.Enabled = False
btnNuevo.Enabled = True
btnBuscar.Enabled = True
End Sub
Sub MetedoDeshabilitarCampos()
txtNombre.Enabled = False
txtApellidos.Enabled = False
txtCedula.Enabled = False
txtRazon.Enabled = False
txtContacto.Enabled = False
txtContacto.Enabled = False
txtDireccion.Enabled = False
txtEmail.Enabled = False
txttelcasa.Enabled = False
txtteloficina.Enabled = False
txttelmovil.Enabled = False
txtSaldo.Enabled = False
cmbBuscar.Enabled = False
txtBuscar.Enabled = False
dgvProveedores.DataSource = vbNull
End Sub
COSTA RICA
CÓDIGO VISUAL BASIC .NET
Formulario de Proveedores
COSTA RICA
CÓDIGO VISUAL BASIC .NET
Formulario de Proveedores
COSTA RICA
CÓDIGO VISUAL BASIC .NET
Formulario de Proveedores
txttelcasa.Enabled = True
txtteloficina.Enabled = True
txttelmovil.Enabled = True
txtSaldo.Enabled = True
txtNombre.Text = dgvProveedores(1, dgvProveedores.CurrentRow.Index).Value
txtApellidos.Text = dgvProveedores(2, dgvProveedores.CurrentRow.Index).Value
txtCedula.Text = dgvProveedores(3, dgvProveedores.CurrentRow.Index).Value
txtRazon.Text = dgvProveedores(4, dgvProveedores.CurrentRow.Index).Value
txtContacto.Text = dgvProveedores(5, dgvProveedores.CurrentRow.Index).Value
txtDireccion.Text = dgvProveedores(6, dgvProveedores.CurrentRow.Index).Value
txtEmail.Text = dgvProveedores(7, dgvProveedores.CurrentRow.Index).Value
txttelcasa.Text = dgvProveedores(8, dgvProveedores.CurrentRow.Index).Value
txtteloficina.Text = dgvProveedores(9, dgvProveedores.CurrentRow.Index).Value
txttelmovil.Text = dgvProveedores(10, dgvProveedores.CurrentRow.Index).Value
txtSaldo.Text = dgvProveedores(11, dgvProveedores.CurrentRow.Index).Value
btnEliminar.Enabled = True
btnModificar.Enabled = True
btnBuscar.Enabled = False
cmbBuscar.Enabled = False
txtBuscar.Enabled = False
End If
End Sub
COSTA RICA
CÓDIGO VISUAL BASIC .NET
Formulario de Proveedores
If MessageBox.Show("¿Realmente desea eliminar el registro: [" & ObjetodeClase_EProveedores.Nombre & "]?", "Mensajes del Sistema", MessageBoxButtons.YesNo, MessageBoxIcon.Question) Then
If ObjetodeClase_FProveedores.EliminarProveedor(ObjetodeClase_EProveedores) Then
MessageBox.Show("el registro fue eliminado correctamente", "Mensajes del Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Else
MessageBox.Show("El registro no ha sido eliminado", "Mensajes del Sistema", MessageBoxButtons.OK, MessageBoxIcon.Warning)
MetodoLimpiar()
MetedoDeshabilitarCampos()
MetodoLimpiar()
MetodoBotonesInicio()
End If
End Sub
End Class