crea venta pero no imprime
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using compabetov2.database.modelos;
|
||||
using compabetov2.database;
|
||||
using compabetov2.database.modelos;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@@ -14,10 +15,86 @@ namespace compabetov2
|
||||
public partial class mermas : Form
|
||||
{
|
||||
private LoginModel loginPrincipal;
|
||||
private List<Merma> mermasList;
|
||||
public mermas(LoginModel loginPrincipal)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.loginPrincipal = loginPrincipal;
|
||||
getData();
|
||||
llenarPanel();
|
||||
}
|
||||
|
||||
private void llenarPanel()
|
||||
{
|
||||
foreach (Merma merma in mermasList)
|
||||
{
|
||||
TableLayoutPanel carta = new TableLayoutPanel();
|
||||
carta.RowCount = 1;
|
||||
carta.ColumnCount = 2;
|
||||
carta.Height = 100;
|
||||
carta.Width = 770;
|
||||
carta.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
|
||||
carta.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
|
||||
carta.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
||||
carta.BorderStyle = BorderStyle.FixedSingle;
|
||||
|
||||
|
||||
Label fecha = new Label();
|
||||
fecha.Text = merma.fecha;
|
||||
fecha.Dock = DockStyle.Fill;
|
||||
fecha.TextAlign = ContentAlignment.MiddleLeft;
|
||||
fecha.Font = new Font(fecha.Font.FontFamily, 20, FontStyle.Bold);
|
||||
|
||||
TableLayoutPanel panelBotones = new TableLayoutPanel();
|
||||
panelBotones.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
|
||||
panelBotones.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
|
||||
panelBotones.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
|
||||
panelBotones.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
||||
panelBotones.Dock = DockStyle.Fill;
|
||||
|
||||
Button btnVer = new Button();
|
||||
btnVer.Text = "Ver";
|
||||
btnVer.Dock = DockStyle.Fill;
|
||||
btnVer.FlatStyle = FlatStyle.Flat;
|
||||
btnVer.FlatAppearance.BorderSize = 0;
|
||||
btnVer.BackColor = Color.FromArgb(33, 90, 255);
|
||||
btnVer.Font = new Font(btnVer.Font.FontFamily, 16);
|
||||
btnVer.ForeColor = Color.White;
|
||||
|
||||
Button btnEditar = new Button();
|
||||
btnEditar.Text = "Editar";
|
||||
btnEditar.Dock = DockStyle.Fill;
|
||||
btnEditar.FlatStyle = FlatStyle.Flat;
|
||||
btnEditar.FlatAppearance.BorderSize = 0;
|
||||
btnEditar.BackColor = Color.FromArgb(33, 90, 255);
|
||||
btnEditar.Font = new Font(btnVer.Font.FontFamily, 16);
|
||||
btnEditar.ForeColor = Color.White;
|
||||
|
||||
|
||||
Button btnEliminar = new Button();
|
||||
btnEliminar.Text = "Eliminar";
|
||||
btnEliminar.Dock = DockStyle.Fill;
|
||||
btnEliminar.BackColor = Color.Red;
|
||||
btnEliminar.FlatStyle = FlatStyle.Flat;
|
||||
btnEliminar.FlatAppearance.BorderSize = 0;
|
||||
btnEliminar.Font = new Font(btnVer.Font.FontFamily, 16);
|
||||
btnEliminar.ForeColor = Color.White;
|
||||
|
||||
|
||||
panelBotones.Controls.Add(btnVer,0,0);
|
||||
panelBotones.Controls.Add(btnEditar,1,0);
|
||||
panelBotones.Controls.Add(btnEliminar,2,0);
|
||||
|
||||
carta.Controls.Add(fecha,0,0);
|
||||
carta.Controls.Add(panelBotones,1,0);
|
||||
|
||||
mermaPanel.Controls.Add(carta);
|
||||
}
|
||||
}
|
||||
|
||||
private void getData()
|
||||
{
|
||||
mermasList = service.conseguirMerma();
|
||||
}
|
||||
|
||||
private void mermas_Load(object sender, EventArgs e)
|
||||
@@ -47,5 +124,10 @@ namespace compabetov2
|
||||
menuPrincipal.Show();
|
||||
this.Dispose(true);
|
||||
}
|
||||
|
||||
private void mermaPanel_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user