Files

55 lines
1.5 KiB
C#

using compabetov2.database;
using compabetov2.database.modelos;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace compabetov2.Ventas
{
public partial class datosCuenta : Form
{
private Cuenta ventaModel;
private List<DetalleCuentaModel> detalles;
private 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)
{
}
private void btnAceptar_Click(object sender, EventArgs e)
{
ventaModel.cliente = txtCliente.Text;
if (service.crearCuenta(ventaModel, detalles, importes))
{
MessageBox.Show("Fiado");
ventanaPadre.eliminarProductosTocket();
ventanaPadre.llenarLayout();
ventanaPadre.total = 0;
ventanaPadre.importes.Clear();
Close();
}
}
private void btnCancelar_Click(object sender, EventArgs e)
{
Close();
}
}
}