cuenta hecha
This commit is contained in:
+42
-7
@@ -51,6 +51,7 @@ namespace compabetov2
|
||||
private void llenarPanel()
|
||||
{
|
||||
List<Cuenta> cuentas = service.conseguirCuentaDAO();
|
||||
panelCuenta.Controls.Clear();
|
||||
|
||||
foreach (Cuenta cuenta in cuentas)
|
||||
{
|
||||
@@ -59,8 +60,8 @@ namespace compabetov2
|
||||
carta.ColumnCount = 2;
|
||||
carta.Height = 100;
|
||||
carta.Width = 820;
|
||||
carta.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 70F));
|
||||
carta.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 30F));
|
||||
carta.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 55F));
|
||||
carta.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 45F));
|
||||
carta.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
||||
carta.BackColor = Color.Gray;
|
||||
|
||||
@@ -90,9 +91,10 @@ namespace compabetov2
|
||||
TableLayoutPanel HUDPanel = new TableLayoutPanel();
|
||||
HUDPanel.Dock = DockStyle.Fill;
|
||||
HUDPanel.RowCount = 1;
|
||||
HUDPanel.ColumnCount = 2;
|
||||
HUDPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
|
||||
HUDPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
|
||||
HUDPanel.ColumnCount = 3;
|
||||
HUDPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
|
||||
HUDPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
|
||||
HUDPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
|
||||
HUDPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
||||
|
||||
Button btnVer = new Button();
|
||||
@@ -106,7 +108,7 @@ namespace compabetov2
|
||||
btnVer.Click += new EventHandler(delegate (object sender, EventArgs e)
|
||||
{
|
||||
List<DetalleCuentaModel> detalles = service.conseguirDetalleCuante(cuenta.id);
|
||||
string mensaje = "";
|
||||
string mensaje = $"Cliente: {cuenta.cliente}\n";
|
||||
foreach (DetalleCuentaModel detalle in detalles)
|
||||
{
|
||||
mensaje += $"{detalle.producto.nombre} - {detalle.cantidad}\n";
|
||||
@@ -114,6 +116,29 @@ namespace compabetov2
|
||||
MessageBox.Show(mensaje);
|
||||
});
|
||||
|
||||
Button btnSaldar = new Button();
|
||||
btnSaldar.Text = "Saldar";
|
||||
btnSaldar.Dock = DockStyle.Fill;
|
||||
btnSaldar.FlatStyle = FlatStyle.Flat;
|
||||
btnSaldar.FlatAppearance.BorderSize = 0;
|
||||
btnSaldar.BackColor = Color.FromArgb(33, 90, 255);
|
||||
btnSaldar.Font = new Font(btnVer.Font.FontFamily, 16);
|
||||
btnSaldar.ForeColor = Color.White;
|
||||
btnSaldar.Click += new EventHandler(delegate (object sender, EventArgs e)
|
||||
{
|
||||
DialogResult result = MessageBox.Show("¿Está seguro de que desea saldar esta cuenta?",
|
||||
"Confirmación", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
List<DetalleCuentaModel> detalles = service.conseguirDetalleCuante(cuenta.id);
|
||||
if (service.saldarCuenta(cuenta, detalles))
|
||||
{
|
||||
llenarPanel();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Button btnEliminar = new Button();
|
||||
btnEliminar.Text = "Cancelar";
|
||||
btnEliminar.Dock = DockStyle.Fill;
|
||||
@@ -124,14 +149,19 @@ namespace compabetov2
|
||||
btnEliminar.ForeColor = Color.White;
|
||||
btnEliminar.Click += new EventHandler(delegate (object sender, EventArgs e)
|
||||
{
|
||||
DialogResult result = MessageBox.Show("¿Está seguro de que desea eliminar este registro?",
|
||||
DialogResult result = MessageBox.Show("¿Está seguro de que desea cancelar este registro?",
|
||||
"Confirmación", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
if (service.cancelarCuenta(cuenta.id))
|
||||
{
|
||||
llenarPanel();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
HUDPanel.Controls.Add(btnVer);
|
||||
HUDPanel.Controls.Add(btnSaldar);
|
||||
HUDPanel.Controls.Add(btnEliminar);
|
||||
|
||||
|
||||
@@ -148,5 +178,10 @@ namespace compabetov2
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void cuentas_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user