amp-web-push-widget button.amp-subscribe { display: inline-flex; align-items: center; border-radius: 5px; border: 0; box-sizing: border-box; margin: 0; padding: 10px 15px; cursor: pointer; outline: none; font-size: 15px; font-weight: 500; background: #4A90E2; margin-top: 7px; color: white; box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.5); -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .amp-logo amp-img{width:190px} .amp-menu input{display:none;}.amp-menu li.menu-item-has-children ul{display:none;}.amp-menu li{position:relative;display:block;}.amp-menu > li a{display:block;} /* Inline styles */ div.acss138d7{clear:both;}div.acssf5b84{--relposth-columns:3;--relposth-columns_m:2;--relposth-columns_t:2;}div.acssa8a3d{aspect-ratio:1/1;background:transparent no-repeat scroll 0% 0%;height:300px;max-width:300px;}div.acss13836{color:#333333;font-family:Arial;font-size:14px;height:75px;}span.acss47fcd{background:#FFFFFF;color:#000000;}div.acss0f1bf{display:none;}a.acssf23c5{font-size:8pt;}a.acss24ea4{font-size:16.4pt;}a.acss066f0{font-size:22pt;} .ampforwp_wc_shortcode{margin-top: 0;padding:0;display:inline-block;width: 100%;} .ampforwp_wc_shortcode li{position: relative;width:29%; font-size:12px; line-height: 1; float: left;list-style-type: none;margin:2%;} .ampforwp_wc_shortcode .onsale{position: absolute;top: 0;right: 0;background: #ddd;padding: 7px;font-size: 12px;} .single-post .ampforwp_wc_shortcode li amp-img{margin:0} .ampforwp-wc-title{margin: 8px 0px 10px 0px;font-size: 13px;} .ampforwp-wc-price{color:#444} .wc_widgettitle{text-align:center;margin-bottom: 0px;} .ampforwp-wc-price, .ampforwp_wc_star_rating{float:left;margin-right: 10px;} .icon-widgets:before {content: "\e1bd";}.icon-search:before {content: "\e8b6";}.icon-shopping-cart:after {content: "\e8cc";} /******* Paste your Custom CSS in this Editor *******/

Parte 17 – Creación de la Ventana Proveedores y Producto

En este vídeo implementamos las funcionalidades de la ventana de proveedores, en ella ya guardamos proveedores para poder poder ingresar productos, ya que productos va relacionado con dos tablas Categorías y Proveedores.  Para poder ingresar un Producto se necesita tener ya Categorías y Proveedores por esta razón se organizo estas dos ventanas.

Se dejo lista para implementar funcionalidades la ventana de Producto donde ingresaran los productos del inventario.

Los códigos que se implementaron son las siguientes:

Dim CodigoProveedor 'variable que controla la edición del proveedor

Sub GuardarProveedor()

    If txtNombreEmpresa = "" Then
       MsgBox "Debe llenar el nombre de la Nombre de la Empresa", vbExclamation, "Error"
       txtNombreEmpresa.SetFocus
       Exit Sub
    End If
    If txtNit = "" Then
       MsgBox "Debe llenar el campo Nit", vbExclamation, "Error"
       txtNit.SetFocus
       Exit Sub
    End If
    If txtNombreContacto = "" Then
       MsgBox "Debe llenar el nombre de Nombre de Contacto", vbExclamation, "Error"
       txtNombreContacto.SetFocus
       Exit Sub
    End If
    If txtTelefono = "" Then
       MsgBox "Debe llenar el nombre de Teléfono", vbExclamation, "Error"
       txtTelefono.SetFocus
       Exit Sub
    End If
    If txtDireccion = "" Then
       MsgBox "Debe llenar el nombre de Dirección", vbExclamation, "Error"
       txtDireccion.SetFocus
       Exit Sub
    End If
    If txtEmail = "" Then
       MsgBox "Debe llenar el nombre de E-Mail", vbExclamation, "Error"
       txtEmail.SetFocus
       Exit Sub
    End If
    If CodigoProveedor = 0 Then
        IdProveedor = UltimoIdTabla("tblProveedores", "IdProveedor")
        Sql = "Insert Into tblProveedores (IdProveedor, NombreEmpresaPro, NitEmpresaPro, NombrePro, TelefonoPro, DireccionPro, EmailPro) Values (" & IdProveedor & ",'" & txtNombreEmpresa & "','" & txtNit & "','" & txtNombreContacto & "','" & txtTelefono & "','" & txtDireccion & "','" & txtEmail & "') "
    Else
        Sql = "Update tblProveedores SET NombreEmpresaPro = '" & txtNombreEmpresa & "',NitEmpresaPro = '" & txtNit & "',NombrePro = '" & txtNombreContacto & "',TelefonoPro = '" & txtTelefono & "',DireccionPro = '" & txtDireccion & "',EmailPro = '" & txtEmail & "' Where tblProveedores = " & CodigoProveedor
    End If
    ConexionADO.Execute Sql
    MsgBox "Proveedor Guardado", vbInformation, "Guardar"
    Call Limpiar
End Sub

El Procedimiento de GuardarProveedor Valida los campos y segun el CodigoProveedor guarda o actualiza un proveedor

Sub Limpiar()
    txtNombreEmpresa.Text = ""
    txtNit.Text = ""
    txtNombreContacto.Text = ""
    txtTelefono.Text = ""
    txtDireccion.Text = ""
    txtEmail.Text = ""
    txtNombreEmpresa.SetFocus
End Sub

El procedimiento de Limpiar() Inicializa los campos del formulario por si se va a guardar un nuevo proveedor

Private Sub cmdGuardar_Click()
    Call GuardarProveedor
End Sub

Private Sub cmdNuevo_Click()
    Call Limpiar
End Sub

Private Sub Form_Load()
    CodigoProveedor = 0
End Sub

Eventos de los botones y el load del formulario.

El Evento Load del formulario se usa cuando queremos que al abrir el formulario se cargue alguna función en este caso estamos inicializando la variable de CodigoProveedor a Cero.

Siguiente Lección Parte 18 – 1 Ventana de Producto

Total Page Visits: 5220 - Today Page Visits: 1
Leave a Comment
Compartir
Publicado por

Publicaciones Recientes

CRUD Enviar y Recibir datos de Visual Basic 6 a PHP

Saludos, en este tutorial aprenderás a integrar tu aplicación de Visual Basic 6 con un…

4 meses hace

Problemas para acceder a Hotmail o Live.com desde el navegador web

Recientemente, muchos usuarios de Hotmail (ahora Outlook.com) han reportado un error al intentar iniciar sesión…

6 meses hace

Calculadora Básica en Visual Basic 6, Aprende a usar variables

En este proyecto, vamos a desarrollar una calculadora sencilla usando Visual Basic 6, que permite…

1 año hace

Lenguajes de Programación Más Demandados en 2024

6 de septiembre de 2024 - La demanda de desarrolladores de software sigue en aumento,…

1 año hace

La Unión Europea Aprueba la Primera Ley de Inteligencia Artificial del Mundo

En un movimiento histórico, la Unión Europea ha aprobado la primera ley de inteligencia artificial…

1 año hace

Sincronización de Datos en Línea VB6: Lleva tu Proyecto al Siguiente Nivel

¿Sigues trabajando con Visual Basic 6 y necesitas una forma eficiente de acceder a tus…

1 año hace

Este sitio utiliza cookies desea activarlas