corregi bug del desplazamiento

This commit is contained in:
Michael Robles
2024-06-18 16:51:43 -07:00
22 changed files with 302 additions and 57 deletions
+1 -1
View File
@@ -156,7 +156,7 @@ namespace compabetov2.Ventas
private void modificarCantidad(int cantidad, int idImporte)
{
detalles[idImporte-1].catidad = cantidad;
detalles[idImporte-1].cantidad = cantidad;
}
private void Importe1_Load(object sender, EventArgs e)
+5 -2
View File
@@ -17,12 +17,14 @@ namespace compabetov2.Ventas
private Cuenta ventaModel;
private List<DetalleCuentaModel> detalles;
private vender ventanaPadre;
public datosCuenta(Cuenta ventaModel, List<DetalleCuentaModel> detalles, vender ventanaPadre)
private List<DetalleImporte> importes;
public datosCuenta(Cuenta ventaModel, List<DetalleCuentaModel> detalles, List<DetalleImporte> importes, vender ventanaPadre)
{
InitializeComponent();
this.ventaModel = ventaModel;
this.detalles = detalles;
this.ventanaPadre = ventanaPadre;
this.importes = importes;
}
private void datosCuenta_Load(object sender, EventArgs e)
@@ -33,12 +35,13 @@ namespace compabetov2.Ventas
private void btnAceptar_Click(object sender, EventArgs e)
{
ventaModel.cliente = txtCliente.Text;
if (service.crearCuenta(ventaModel, detalles))
if (service.crearCuenta(ventaModel, detalles, importes))
{
MessageBox.Show("Fiado");
ventanaPadre.eliminarProductosTocket();
ventanaPadre.llenarLayout();
ventanaPadre.total = 0;
ventanaPadre.importes.Clear();
Close();
}
}
+7 -4
View File
@@ -21,13 +21,15 @@ namespace compabetov2.Ventas
public string Telefono => txtTelefono.Text;
private Envio envio;
List<DetalleEnvioModel> detallesEnvio;
List<DetalleImporte> importes;
vender ventanaPadre;
public datosEnvio(Envio envio, List<DetalleEnvioModel> detallesEnvio, vender ventanaPadre)
public datosEnvio(Envio envio, List<DetalleEnvioModel> detallesEnvio, List<DetalleImporte> importes, vender ventanaPadre)
{
InitializeComponent();
this.envio = envio;
this.detallesEnvio = detallesEnvio;
this.ventanaPadre = ventanaPadre;
this.importes = importes;
txtTelefono.KeyPress += new KeyPressEventHandler(txtTelefono_KeyPress);
}
@@ -38,14 +40,15 @@ namespace compabetov2.Ventas
envio.cliente = txtCliente.Text;
envio.direccion = txtDireccion.Text;
envio.telefono = txtTelefono.Text;
if (service.crearEnvio(envio, detallesEnvio))
if (service.crearEnvio(envio, detallesEnvio, importes))
{
MessageBox.Show("Envio hecho");
ImprimirTicketEnvio();
ventanaPadre.eliminarProductosTocket();
ventanaPadre.llenarLayout();
ventanaPadre.total = 0;
ventanaPadre.importes.Clear();
this.Close();
}
}
@@ -197,7 +200,7 @@ namespace compabetov2.Ventas
envio.cliente = txtCliente.Text;
envio.direccion = txtDireccion.Text;
envio.telefono = txtTelefono.Text;
if (service.crearEnvio(envio, detallesEnvio))
if (service.crearEnvio(envio, detallesEnvio, importes))
{
MessageBox.Show("Envio hecho");
ImprimirTicketEnvio();
+6 -4
View File
@@ -75,7 +75,9 @@ namespace compabetov2
private void FlowLayoutPanel3_MouseUp(object sender, MouseEventArgs e)
{
flowLayoutPanel3.Capture = false;
lastPoint = new Point(e.X, e.Y);
flowLayoutPanel3.Capture = true;
}
@@ -777,7 +779,7 @@ namespace compabetov2
{
Cuenta ventaModel = new Cuenta(total);
datosCuenta datoCuenta = new datosCuenta(ventaModel, detallesCuenta, this);
datosCuenta datoCuenta = new datosCuenta(ventaModel, detallesCuenta,importes, this);
datoCuenta.Show();
}
@@ -837,7 +839,7 @@ namespace compabetov2
Envio envio = new Envio(-1, DateTime.Now.ToString(), "", "", responsable, "", "", total);
if (detallesEnvio.Count > 0)
{
datosEnvio datosEnvio = new datosEnvio(envio, detallesEnvio, this);
datosEnvio datosEnvio = new datosEnvio(envio, detallesEnvio,importes ,this);
datosEnvio.Show();
}
else
@@ -879,7 +881,7 @@ namespace compabetov2
decimal totalImporte = 0;
foreach(DetalleImporte importe in importes)
{
totalImporte += importe.precioImporte * importe.catidad;
totalImporte += importe.precioImporte * importe.cantidad;
}
total += totalImporte;
label1.Text = $"Total: ${total}";