ventana de datos cuenta en vender

This commit is contained in:
carlos
2024-02-03 06:58:24 -06:00
11 changed files with 111 additions and 4 deletions
+1
View File
@@ -93,6 +93,7 @@
this.txtTelefono.Name = "txtTelefono";
this.txtTelefono.Size = new System.Drawing.Size(449, 30);
this.txtTelefono.TabIndex = 5;
this.txtTelefono.TextChanged += new System.EventHandler(this.txtTelefono_TextChanged);
//
// label3
//
+21
View File
@@ -28,6 +28,7 @@ namespace compabetov2.Ventas
this.envio = envio;
this.detallesEnvio = detallesEnvio;
this.ventanaPadre = ventanaPadre;
txtTelefono.KeyPress += new KeyPressEventHandler(txtTelefono_KeyPress);
}
@@ -207,5 +208,25 @@ namespace compabetov2.Ventas
this.Close();
}
}
private void txtTelefono_TextChanged(object sender, EventArgs e)
{
}
private void txtTelefono_KeyPress(object sender, KeyPressEventArgs e)
{
// Verificar si la tecla presionada no es un número o la tecla de retroceso
if (!char.IsDigit(e.KeyChar) && e.KeyChar != 8)
{
e.Handled = true; // Ignorar la tecla presionada
// Mostrar un mensaje indicando que solo se permiten números
MessageBox.Show("Por favor, ingrese solo números en el teléfono.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
+1
View File
@@ -715,6 +715,7 @@ namespace compabetov2
{
List<DetalleCuentaModel> detallesCuenta = listaProductosCuenta();
if (detallesCuenta.Count > 0)
{
Cuenta ventaModel = new Cuenta(total);