cambios menores

This commit is contained in:
carlos
2024-01-23 21:03:31 -06:00
parent cfd142504b
commit 8b4563fa4e
11 changed files with 144 additions and 93 deletions
+50 -5
View File
@@ -55,10 +55,11 @@ namespace compabetov2
foreach (Cuenta cuenta in cuentas) foreach (Cuenta cuenta in cuentas)
{ {
TableLayoutPanel carta = new TableLayoutPanel(); TableLayoutPanel carta = new TableLayoutPanel();
carta.RowCount = 1; carta.RowCount = 1;
carta.ColumnCount = 2; carta.ColumnCount = 2;
carta.Height = 80; carta.Height = 100;
carta.Width = 820; carta.Width = 820;
carta.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 55F)); carta.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 55F));
carta.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 45F)); carta.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 45F));
@@ -70,23 +71,31 @@ namespace compabetov2
Label cliente = new Label(); Label cliente = new Label();
cliente.Text = $"Cliente: {cuenta.cliente}"; cliente.Text = $"Cliente: {cuenta.cliente}";
cliente.Font = new Font(cliente.Font.FontFamily, 18); cliente.Font = new Font(cliente.Font.FontFamily, 12);
cliente.Width = 600; cliente.Width = 600;
Label fecha = new Label(); Label fecha = new Label();
fecha.Text = "Fecha: " + cuenta.fecha; fecha.Text = "Fecha: " + cuenta.fecha;
fecha.Font = new Font(fecha.Font.FontFamily, 18); fecha.Font = new Font(fecha.Font.FontFamily, 12);
fecha.Width = 600; fecha.Width = 600;
Label total = new Label(); Label total = new Label();
total.Text = "Total: $" + cuenta.total; total.Text = "Total: $" + cuenta.total;
total.Font = new Font(total.Font.FontFamily, 18); total.Font = new Font(total.Font.FontFamily, 12);
total.Width = 600; total.Width = 600;
Label estado = new Label();
estado.Text = $"Estado: {cuenta.estado}";
estado.Font = new Font(total.Font.FontFamily, 12);
estado.Width = 600;
infoPanel.Controls.Add(fecha); infoPanel.Controls.Add(fecha);
infoPanel.Controls.Add(cliente); infoPanel.Controls.Add(cliente);
infoPanel.Controls.Add(total); infoPanel.Controls.Add(total);
infoPanel.Controls.Add(estado);
if (cuenta.estado.Equals("ACTIVO"))
{
TableLayoutPanel HUDPanel = new TableLayoutPanel(); TableLayoutPanel HUDPanel = new TableLayoutPanel();
HUDPanel.Dock = DockStyle.Fill; HUDPanel.Dock = DockStyle.Fill;
HUDPanel.RowCount = 1; HUDPanel.RowCount = 1;
@@ -163,9 +172,45 @@ namespace compabetov2
HUDPanel.Controls.Add(btnSaldar); HUDPanel.Controls.Add(btnSaldar);
HUDPanel.Controls.Add(btnEliminar); HUDPanel.Controls.Add(btnEliminar);
carta.Controls.Add(HUDPanel, 1, 0);
}
else
{
TableLayoutPanel HUDPanel = new TableLayoutPanel();
HUDPanel.Dock = DockStyle.Fill;
HUDPanel.RowCount = 1;
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();
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;
btnVer.Click += new EventHandler(delegate (object sender, EventArgs e)
{
List<DetalleCuentaModel> detalles = service.conseguirDetalleCuante(cuenta.id);
string mensaje = $"Cliente: {cuenta.cliente}\n";
foreach (DetalleCuentaModel detalle in detalles)
{
mensaje += $"{detalle.producto.nombre} - {detalle.cantidad}\n";
}
MessageBox.Show(mensaje);
});
HUDPanel.Controls.Add(btnVer,2,0);
carta.Controls.Add(HUDPanel, 1, 0);
}
carta.Controls.Add(infoPanel,0,0); carta.Controls.Add(infoPanel,0,0);
carta.Controls.Add(HUDPanel,1,0);
panelCuenta.Controls.Add(carta); panelCuenta.Controls.Add(carta);
+16 -21
View File
@@ -98,7 +98,7 @@
this.flowLayoutPanel2.Controls.Add(this.label1); this.flowLayoutPanel2.Controls.Add(this.label1);
this.flowLayoutPanel2.Controls.Add(this.labeltotal); this.flowLayoutPanel2.Controls.Add(this.labeltotal);
this.flowLayoutPanel2.Location = new System.Drawing.Point(1204, -1); this.flowLayoutPanel2.Location = new System.Drawing.Point(1204, -1);
this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(2);
this.flowLayoutPanel2.Name = "flowLayoutPanel2"; this.flowLayoutPanel2.Name = "flowLayoutPanel2";
this.flowLayoutPanel2.Size = new System.Drawing.Size(243, 968); this.flowLayoutPanel2.Size = new System.Drawing.Size(243, 968);
this.flowLayoutPanel2.TabIndex = 11; this.flowLayoutPanel2.TabIndex = 11;
@@ -109,7 +109,7 @@
this.panel1.BackColor = System.Drawing.Color.Transparent; this.panel1.BackColor = System.Drawing.Color.Transparent;
this.panel1.Controls.Add(this.pictureBox9); this.panel1.Controls.Add(this.pictureBox9);
this.panel1.Location = new System.Drawing.Point(2, 2); this.panel1.Location = new System.Drawing.Point(2, 2);
this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.panel1.Margin = new System.Windows.Forms.Padding(2);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(234, 214); this.panel1.Size = new System.Drawing.Size(234, 214);
this.panel1.TabIndex = 8; this.panel1.TabIndex = 8;
@@ -118,7 +118,7 @@
// //
this.pictureBox9.Image = global::compabetov2.Properties.Resources.HomeroMenu; this.pictureBox9.Image = global::compabetov2.Properties.Resources.HomeroMenu;
this.pictureBox9.Location = new System.Drawing.Point(48, 28); this.pictureBox9.Location = new System.Drawing.Point(48, 28);
this.pictureBox9.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.pictureBox9.Margin = new System.Windows.Forms.Padding(2);
this.pictureBox9.Name = "pictureBox9"; this.pictureBox9.Name = "pictureBox9";
this.pictureBox9.Size = new System.Drawing.Size(190, 197); this.pictureBox9.Size = new System.Drawing.Size(190, 197);
this.pictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
@@ -160,7 +160,7 @@
this.flowLayoutPanel1.Controls.Add(this.button3); this.flowLayoutPanel1.Controls.Add(this.button3);
this.flowLayoutPanel1.Controls.Add(this.button5); this.flowLayoutPanel1.Controls.Add(this.button5);
this.flowLayoutPanel1.Location = new System.Drawing.Point(-1, 2); this.flowLayoutPanel1.Location = new System.Drawing.Point(-1, 2);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(2);
this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(243, 974); this.flowLayoutPanel1.Size = new System.Drawing.Size(243, 974);
this.flowLayoutPanel1.TabIndex = 8; this.flowLayoutPanel1.TabIndex = 8;
@@ -170,7 +170,7 @@
this.panel2.BackColor = System.Drawing.Color.Transparent; this.panel2.BackColor = System.Drawing.Color.Transparent;
this.panel2.Controls.Add(this.pictureBox7); this.panel2.Controls.Add(this.pictureBox7);
this.panel2.Location = new System.Drawing.Point(2, 2); this.panel2.Location = new System.Drawing.Point(2, 2);
this.panel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.panel2.Margin = new System.Windows.Forms.Padding(2);
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(234, 214); this.panel2.Size = new System.Drawing.Size(234, 214);
this.panel2.TabIndex = 8; this.panel2.TabIndex = 8;
@@ -179,7 +179,7 @@
// //
this.pictureBox7.Image = global::compabetov2.Properties.Resources.HomeroMenu; this.pictureBox7.Image = global::compabetov2.Properties.Resources.HomeroMenu;
this.pictureBox7.Location = new System.Drawing.Point(48, 28); this.pictureBox7.Location = new System.Drawing.Point(48, 28);
this.pictureBox7.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.pictureBox7.Margin = new System.Windows.Forms.Padding(2);
this.pictureBox7.Name = "pictureBox7"; this.pictureBox7.Name = "pictureBox7";
this.pictureBox7.Size = new System.Drawing.Size(190, 197); this.pictureBox7.Size = new System.Drawing.Size(190, 197);
this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
@@ -196,7 +196,7 @@
this.button1.Image = global::compabetov2.Properties.Resources.Menui1; this.button1.Image = global::compabetov2.Properties.Resources.Menui1;
this.button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button1.Location = new System.Drawing.Point(2, 220); this.button1.Location = new System.Drawing.Point(2, 220);
this.button1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.button1.Margin = new System.Windows.Forms.Padding(2);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0); this.button1.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button1.Size = new System.Drawing.Size(234, 93); this.button1.Size = new System.Drawing.Size(234, 93);
@@ -215,7 +215,7 @@
this.button2.Image = global::compabetov2.Properties.Resources.estadisticasi; this.button2.Image = global::compabetov2.Properties.Resources.estadisticasi;
this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button2.Location = new System.Drawing.Point(2, 317); this.button2.Location = new System.Drawing.Point(2, 317);
this.button2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.button2.Margin = new System.Windows.Forms.Padding(2);
this.button2.Name = "button2"; this.button2.Name = "button2";
this.button2.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0); this.button2.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button2.Size = new System.Drawing.Size(234, 93); this.button2.Size = new System.Drawing.Size(234, 93);
@@ -233,7 +233,7 @@
this.button3.Image = global::compabetov2.Properties.Resources.productoi; this.button3.Image = global::compabetov2.Properties.Resources.productoi;
this.button3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button3.Location = new System.Drawing.Point(2, 414); this.button3.Location = new System.Drawing.Point(2, 414);
this.button3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.button3.Margin = new System.Windows.Forms.Padding(2);
this.button3.Name = "button3"; this.button3.Name = "button3";
this.button3.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0); this.button3.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button3.Size = new System.Drawing.Size(234, 93); this.button3.Size = new System.Drawing.Size(234, 93);
@@ -251,7 +251,7 @@
this.button5.Image = global::compabetov2.Properties.Resources.sesionc; this.button5.Image = global::compabetov2.Properties.Resources.sesionc;
this.button5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button5.Location = new System.Drawing.Point(2, 511); this.button5.Location = new System.Drawing.Point(2, 511);
this.button5.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.button5.Margin = new System.Windows.Forms.Padding(2);
this.button5.Name = "button5"; this.button5.Name = "button5";
this.button5.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0); this.button5.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button5.Size = new System.Drawing.Size(234, 93); this.button5.Size = new System.Drawing.Size(234, 93);
@@ -263,7 +263,7 @@
// //
this.flowLayoutPanel3.AutoScroll = true; this.flowLayoutPanel3.AutoScroll = true;
this.flowLayoutPanel3.Location = new System.Drawing.Point(244, 230); this.flowLayoutPanel3.Location = new System.Drawing.Point(244, 230);
this.flowLayoutPanel3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.flowLayoutPanel3.Margin = new System.Windows.Forms.Padding(2);
this.flowLayoutPanel3.Name = "flowLayoutPanel3"; this.flowLayoutPanel3.Name = "flowLayoutPanel3";
this.flowLayoutPanel3.Size = new System.Drawing.Size(955, 769); this.flowLayoutPanel3.Size = new System.Drawing.Size(955, 769);
this.flowLayoutPanel3.TabIndex = 14; this.flowLayoutPanel3.TabIndex = 14;
@@ -273,7 +273,7 @@
// //
this.txtbusqueda.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtbusqueda.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtbusqueda.Location = new System.Drawing.Point(247, 178); this.txtbusqueda.Location = new System.Drawing.Point(247, 178);
this.txtbusqueda.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.txtbusqueda.Margin = new System.Windows.Forms.Padding(2);
this.txtbusqueda.Name = "txtbusqueda"; this.txtbusqueda.Name = "txtbusqueda";
this.txtbusqueda.Size = new System.Drawing.Size(528, 30); this.txtbusqueda.Size = new System.Drawing.Size(528, 30);
this.txtbusqueda.TabIndex = 15; this.txtbusqueda.TabIndex = 15;
@@ -285,7 +285,7 @@
this.bntImprimir.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F); this.bntImprimir.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.bntImprimir.ForeColor = System.Drawing.Color.Transparent; this.bntImprimir.ForeColor = System.Drawing.Color.Transparent;
this.bntImprimir.Location = new System.Drawing.Point(791, 171); this.bntImprimir.Location = new System.Drawing.Point(791, 171);
this.bntImprimir.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.bntImprimir.Margin = new System.Windows.Forms.Padding(2);
this.bntImprimir.Name = "bntImprimir"; this.bntImprimir.Name = "bntImprimir";
this.bntImprimir.Size = new System.Drawing.Size(113, 44); this.bntImprimir.Size = new System.Drawing.Size(113, 44);
this.bntImprimir.TabIndex = 17; this.bntImprimir.TabIndex = 17;
@@ -297,13 +297,8 @@
// //
this.responsablecb.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F); this.responsablecb.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.responsablecb.FormattingEnabled = true; this.responsablecb.FormattingEnabled = true;
this.responsablecb.Items.AddRange(new object[] {
"Fabian Herrera",
"Cristofer Perez ",
"Angel Alexander",
"Emilio Urenda"});
this.responsablecb.Location = new System.Drawing.Point(1028, 172); this.responsablecb.Location = new System.Drawing.Point(1028, 172);
this.responsablecb.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.responsablecb.Margin = new System.Windows.Forms.Padding(2);
this.responsablecb.Name = "responsablecb"; this.responsablecb.Name = "responsablecb";
this.responsablecb.Size = new System.Drawing.Size(171, 33); this.responsablecb.Size = new System.Drawing.Size(171, 33);
this.responsablecb.TabIndex = 18; this.responsablecb.TabIndex = 18;
@@ -340,7 +335,7 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1028, 627); this.ClientSize = new System.Drawing.Size(1300, 627);
this.ControlBox = false; this.ControlBox = false;
this.Controls.Add(this.btnEnviar); this.Controls.Add(this.btnEnviar);
this.Controls.Add(this.btnFiar); this.Controls.Add(this.btnFiar);
@@ -352,7 +347,7 @@
this.Controls.Add(this.lblhora); this.Controls.Add(this.lblhora);
this.Controls.Add(this.flowLayoutPanel2); this.Controls.Add(this.flowLayoutPanel2);
this.Controls.Add(this.flowLayoutPanel1); this.Controls.Add(this.flowLayoutPanel1);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "vender"; this.Name = "vender";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.vender_Load); this.Load += new System.EventHandler(this.vender_Load);
+10
View File
@@ -36,9 +36,19 @@ namespace compabetov2
InitializeComponent(); InitializeComponent();
getData(); getData();
llenarLayout(); llenarLayout();
llenarComBox();
this.loginPrincipal = loginPrincipal; this.loginPrincipal = loginPrincipal;
} }
private void llenarComBox()
{
List<Empleado> empleados = service.conseguirEmpleados();
foreach(Empleado empleado in empleados)
{
responsablecb.Items.Add(empleado.nombre);
}
}
private void llenarLayout() private void llenarLayout()
{ {
foreach (Producto producto in productos) foreach (Producto producto in productos)
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+4 -3
View File
@@ -324,7 +324,7 @@ namespace compabetov2.database
conexion.Open(); conexion.Open();
string sql = "SELECT * FROM Empleado"; string sql = "SELECT * FROM Empleado WHERE idempleado > 1";
SQLiteCommand command = new SQLiteCommand(sql, conexion); SQLiteCommand command = new SQLiteCommand(sql, conexion);
reader = command.ExecuteReader(); reader = command.ExecuteReader();
@@ -914,7 +914,7 @@ namespace compabetov2.database
conexion.Open(); conexion.Open();
string sql = "SELECT * FROM cuenta WHERE estado = 'ACTIVO'"; string sql = "SELECT * FROM cuenta ORDER BY idCuenta DESC";
SQLiteCommand command = new SQLiteCommand(sql, conexion); SQLiteCommand command = new SQLiteCommand(sql, conexion);
reader = command.ExecuteReader(); reader = command.ExecuteReader();
@@ -1097,6 +1097,7 @@ namespace compabetov2.database
SQLiteCommand commandCuenta = new SQLiteCommand(sqlCuenta, conexion); SQLiteCommand commandCuenta = new SQLiteCommand(sqlCuenta, conexion);
commandCuenta.Parameters.AddWithValue("@idCuenta", cuenta.id); commandCuenta.Parameters.AddWithValue("@idCuenta", cuenta.id);
commandCuenta.ExecuteNonQuery();
SQLiteCommand commandConsulta = new SQLiteCommand(sqlIdVenta, conexion); SQLiteCommand commandConsulta = new SQLiteCommand(sqlIdVenta, conexion);
SQLiteDataReader reader = commandConsulta.ExecuteReader(); SQLiteDataReader reader = commandConsulta.ExecuteReader();
@@ -1269,7 +1270,7 @@ namespace compabetov2.database
conexion.Open(); conexion.Open();
string sql = "SELECT * FROM envios"; string sql = "SELECT * FROM envios ORDER BY idEnvios DESC";
SQLiteCommand command = new SQLiteCommand(sql, conexion); SQLiteCommand command = new SQLiteCommand(sql, conexion);
reader = command.ExecuteReader(); reader = command.ExecuteReader();
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.