diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json
index 14c2cf7..6fc01b8 100644
--- a/.vs/VSWorkspaceState.json
+++ b/.vs/VSWorkspaceState.json
@@ -1,10 +1,9 @@
{
"ExpandedNodes": [
"",
- "\\Cuentas",
"\\database",
- "\\Principal"
+ "\\Ventas"
],
- "SelectedNode": "\\Solution.sln",
+ "SelectedNode": "\\Ventas\\vender.cs",
"PreviewInSolutionExplorer": false
}
\ No newline at end of file
diff --git a/.vs/compabetoOG/v17/.wsuo b/.vs/compabetoOG/v17/.wsuo
index ca070ec..c31e3f9 100644
Binary files a/.vs/compabetoOG/v17/.wsuo and b/.vs/compabetoOG/v17/.wsuo differ
diff --git a/Inventario/inventario.cs b/Inventario/inventario.cs
index 13f3cf5..8d854da 100644
--- a/Inventario/inventario.cs
+++ b/Inventario/inventario.cs
@@ -108,7 +108,7 @@ namespace compabetov2
int numeroContador = int.Parse(txtStockAgregar.Text);
txtStockAgregar.Text = (numeroContador - 1).ToString();
}
- catch (Exception ex)
+ catch (Exception)
{
txtStockAgregar.Text = "0";
}
@@ -130,7 +130,7 @@ namespace compabetov2
{
int numeroContador = int.Parse(txtStockAgregar.Text);
txtStockAgregar.Text = (numeroContador + 1).ToString();
- }catch (Exception ex)
+ }catch (Exception)
{
txtStockAgregar.Text = "0";
}
diff --git a/Ventas/Importe.Designer.cs b/Ventas/Importe.Designer.cs
new file mode 100644
index 0000000..aa040f2
--- /dev/null
+++ b/Ventas/Importe.Designer.cs
@@ -0,0 +1,58 @@
+namespace compabetov2.Ventas
+{
+ partial class Importe
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.panelImporte = new System.Windows.Forms.FlowLayoutPanel();
+ this.SuspendLayout();
+ //
+ // panelImporte
+ //
+ this.panelImporte.Location = new System.Drawing.Point(72, 46);
+ this.panelImporte.Name = "panelImporte";
+ this.panelImporte.Size = new System.Drawing.Size(596, 292);
+ this.panelImporte.TabIndex = 0;
+ //
+ // Importe
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(747, 406);
+ this.Controls.Add(this.panelImporte);
+ this.Name = "Importe";
+ this.Text = "Form1";
+ this.Load += new System.EventHandler(this.Importe_Load);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.FlowLayoutPanel panelImporte;
+ }
+}
\ No newline at end of file
diff --git a/Ventas/Importe.cs b/Ventas/Importe.cs
new file mode 100644
index 0000000..7d976e6
--- /dev/null
+++ b/Ventas/Importe.cs
@@ -0,0 +1,154 @@
+using compabetov2.database;
+using compabetov2.database.modelos;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace compabetov2.Ventas
+{
+ public partial class Importe : Form
+ {
+ private vender ventanaPadre;
+ private List importes;
+ public Importe(vender ventaPadre)
+ {
+ InitializeComponent();
+ ventanaPadre = ventaPadre;
+ llenarPanel();
+ }
+
+ private void getData()
+ {
+ this.importes = service.conseguirImportes();
+ }
+
+ private void llenarPanel()
+ {
+ getData();
+
+ foreach (ImporteModel importe in importes)
+ {
+ TableLayoutPanel filaLayout = new TableLayoutPanel();
+ filaLayout.RowCount = 1;
+ filaLayout.ColumnCount = 2;
+ filaLayout.Height = 100;
+ filaLayout.Width = 830;
+ filaLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
+ filaLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
+ filaLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
+
+ TableLayoutPanel informacionProducto = new TableLayoutPanel();
+ informacionProducto.RowCount = 1;
+ informacionProducto.ColumnCount = 2;
+ informacionProducto.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F));
+ informacionProducto.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 80F));
+ informacionProducto.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
+ informacionProducto.Dock = DockStyle.Fill;
+
+ PictureBox imagen = new PictureBox();
+ string rutaImg = Path.Combine(Application.StartupPath, "Resources", importe.img);
+ imagen.Image = Image.FromFile(rutaImg);
+ imagen.Dock = DockStyle.Fill;
+ imagen.BackgroundImageLayout = ImageLayout.Stretch;
+ imagen.SizeMode = PictureBoxSizeMode.Zoom;
+
+
+
+ Label nombreStock = new Label();
+ nombreStock.Text = importe.tipo;
+ nombreStock.Font = new Font(nombreStock.Font.FontFamily, 16);
+ nombreStock.Dock = DockStyle.Fill;
+ nombreStock.TextAlign = ContentAlignment.MiddleCenter;
+
+ //panel de agregar stock
+ TableLayoutPanel agregarPanel = new TableLayoutPanel();
+ agregarPanel.Dock = DockStyle.Fill;
+ agregarPanel.RowCount = 1;
+ agregarPanel.ColumnCount = 3;
+ agregarPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 60F));
+ agregarPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F));
+ agregarPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F));
+ agregarPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
+
+ TextBox txtStockAgregar = new TextBox();
+ txtStockAgregar.Text = "0";
+ txtStockAgregar.Height = 60;
+ txtStockAgregar.Width = 200;
+ txtStockAgregar.Anchor = AnchorStyles.None;
+ txtStockAgregar.Font = new Font(txtStockAgregar.Font.FontFamily, 17);
+
+ Button btnMenos = new Button();
+ btnMenos.Text = "-";
+ btnMenos.Width = 60;
+ btnMenos.Height = 60;
+ btnMenos.Font = new Font(btnMenos.Font.FontFamily, 30);
+ btnMenos.ForeColor = Color.White;
+ btnMenos.FlatStyle = FlatStyle.Flat;
+ btnMenos.FlatAppearance.BorderSize = 0;
+ btnMenos.BackColor = Color.FromArgb(33, 90, 255);
+ btnMenos.Anchor = AnchorStyles.None;
+ btnMenos.Click += new EventHandler(delegate (object sender, EventArgs e)
+ {
+ try
+ {
+ int numeroContador = int.Parse(txtStockAgregar.Text);
+ txtStockAgregar.Text = (numeroContador - 1).ToString();
+ }
+ catch (Exception)
+ {
+ txtStockAgregar.Text = "0";
+ }
+ });
+
+ Button btnMas = new Button();
+ btnMas.Text = "+";
+ btnMas.Width = 60;
+ btnMas.Height = 60;
+ btnMas.Font = new Font(btnMas.Font.FontFamily, 30);
+ btnMas.ForeColor = Color.White;
+ btnMas.BackColor = Color.FromArgb(33, 90, 255);
+ btnMas.FlatStyle = FlatStyle.Flat;
+ btnMas.FlatAppearance.BorderSize = 0;
+ btnMas.Anchor = AnchorStyles.None;
+ btnMas.Click += new EventHandler(delegate (object sender, EventArgs e)
+ {
+ try
+ {
+ int numeroContador = int.Parse(txtStockAgregar.Text);
+ txtStockAgregar.Text = (numeroContador + 1).ToString();
+ }
+ catch (Exception)
+ {
+ txtStockAgregar.Text = "0";
+ }
+
+ });
+
+
+ informacionProducto.Controls.Add(imagen, 0, 0);
+ informacionProducto.Controls.Add(nombreStock, 1, 0);
+
+ agregarPanel.Controls.Add(txtStockAgregar, 0, 0);
+ agregarPanel.Controls.Add(btnMenos, 1, 0);
+ agregarPanel.Controls.Add(btnMas, 2, 0);
+
+
+ filaLayout.Controls.Add(informacionProducto, 0, 0);
+ filaLayout.Controls.Add(agregarPanel, 1, 0);
+ panelImporte.Controls.Add(filaLayout);
+ }
+ }
+
+ private void Importe_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
diff --git a/Ventas/Importe.resx b/Ventas/Importe.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/Ventas/Importe.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Ventas/Importe1.Designer.cs b/Ventas/Importe1.Designer.cs
new file mode 100644
index 0000000..f537f23
--- /dev/null
+++ b/Ventas/Importe1.Designer.cs
@@ -0,0 +1,72 @@
+namespace compabetov2.Ventas
+{
+ partial class Importe1
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.panelImporte = new System.Windows.Forms.FlowLayoutPanel();
+ this.btnAceptar = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // panelImporte
+ //
+ this.panelImporte.Location = new System.Drawing.Point(55, 22);
+ this.panelImporte.Name = "panelImporte";
+ this.panelImporte.Size = new System.Drawing.Size(677, 364);
+ this.panelImporte.TabIndex = 1;
+ //
+ // btnAceptar
+ //
+ this.btnAceptar.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.btnAceptar.Location = new System.Drawing.Point(338, 382);
+ this.btnAceptar.Name = "btnAceptar";
+ this.btnAceptar.Size = new System.Drawing.Size(105, 46);
+ this.btnAceptar.TabIndex = 2;
+ this.btnAceptar.Text = "Aceptar";
+ this.btnAceptar.UseVisualStyleBackColor = true;
+ this.btnAceptar.Click += new System.EventHandler(this.btnAceptar_Click);
+ //
+ // Importe1
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.btnAceptar);
+ this.Controls.Add(this.panelImporte);
+ this.Name = "Importe1";
+ this.Text = "Importe1";
+ this.Load += new System.EventHandler(this.Importe1_Load);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.FlowLayoutPanel panelImporte;
+ private System.Windows.Forms.Button btnAceptar;
+ }
+}
\ No newline at end of file
diff --git a/Ventas/Importe1.cs b/Ventas/Importe1.cs
new file mode 100644
index 0000000..b4ef03d
--- /dev/null
+++ b/Ventas/Importe1.cs
@@ -0,0 +1,174 @@
+using compabetov2.database.modelos;
+using compabetov2.database;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace compabetov2.Ventas
+{
+ public partial class Importe1 : Form
+ {
+ private vender ventanaPadre;
+ private List importes;
+ private List detalles = new List();
+ public Importe1(vender ventaPadre)
+ {
+ InitializeComponent();
+ ventanaPadre = ventaPadre;
+ llenarPanel();
+ }
+
+ private void getData()
+ {
+ this.importes = service.conseguirImportes();
+ }
+
+ private void llenarPanel()
+ {
+ getData();
+ int i = 0;
+ foreach (ImporteModel importe in importes)
+ {
+ detalles.Add(new DetalleImporte(importe.idImporte,0,importe.precioImporte));
+
+ TableLayoutPanel filaLayout = new TableLayoutPanel();
+ filaLayout.RowCount = 1;
+ filaLayout.ColumnCount = 2;
+ filaLayout.Height = 100;
+ filaLayout.Width = 650;
+ filaLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
+ filaLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
+ filaLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
+
+ TableLayoutPanel informacionProducto = new TableLayoutPanel();
+ informacionProducto.RowCount = 1;
+ informacionProducto.ColumnCount = 2;
+ informacionProducto.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F));
+ informacionProducto.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 80F));
+ informacionProducto.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
+ informacionProducto.Dock = DockStyle.Fill;
+
+ PictureBox imagen = new PictureBox();
+ string rutaImg = Path.Combine(Application.StartupPath, "Resources", importe.img);
+ imagen.Image = Image.FromFile(rutaImg);
+ imagen.Dock = DockStyle.Fill;
+ imagen.BackgroundImageLayout = ImageLayout.Stretch;
+ imagen.SizeMode = PictureBoxSizeMode.Zoom;
+
+
+
+ Label nombreStock = new Label();
+ nombreStock.Text = importe.tipo;
+ nombreStock.Font = new Font(nombreStock.Font.FontFamily, 16);
+ nombreStock.Dock = DockStyle.Fill;
+ nombreStock.TextAlign = ContentAlignment.MiddleCenter;
+
+ //panel de agregar stock
+ TableLayoutPanel agregarPanel = new TableLayoutPanel();
+ agregarPanel.Dock = DockStyle.Fill;
+ agregarPanel.RowCount = 1;
+ agregarPanel.ColumnCount = 3;
+ agregarPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 60F));
+ agregarPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F));
+ agregarPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F));
+ agregarPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
+
+ TextBox txtStockAgregar = new TextBox();
+ txtStockAgregar.Text = "0";
+ txtStockAgregar.Height = 60;
+ txtStockAgregar.Width = 200;
+ txtStockAgregar.Anchor = AnchorStyles.None;
+ txtStockAgregar.Font = new Font(txtStockAgregar.Font.FontFamily, 17);
+
+ Button btnMenos = new Button();
+ btnMenos.Text = "-";
+ btnMenos.Width = 60;
+ btnMenos.Height = 60;
+ btnMenos.Font = new Font(btnMenos.Font.FontFamily, 30);
+ btnMenos.ForeColor = Color.White;
+ btnMenos.FlatStyle = FlatStyle.Flat;
+ btnMenos.FlatAppearance.BorderSize = 0;
+ btnMenos.BackColor = Color.FromArgb(33, 90, 255);
+ btnMenos.Anchor = AnchorStyles.None;
+ btnMenos.Click += new EventHandler(delegate (object sender, EventArgs e)
+ {
+ try
+ {
+ int numeroContador = int.Parse(txtStockAgregar.Text);
+ txtStockAgregar.Text = (numeroContador - 1).ToString();
+ modificarCantidad(numeroContador-1, importe.idImporte);
+ }
+ catch (Exception)
+ {
+ txtStockAgregar.Text = "0";
+ modificarCantidad(0, importe.idImporte);
+ }
+ });
+
+ Button btnMas = new Button();
+ btnMas.Text = "+";
+ btnMas.Width = 60;
+ btnMas.Height = 60;
+ btnMas.Font = new Font(btnMas.Font.FontFamily, 30);
+ btnMas.ForeColor = Color.White;
+ btnMas.BackColor = Color.FromArgb(33, 90, 255);
+ btnMas.FlatStyle = FlatStyle.Flat;
+ btnMas.FlatAppearance.BorderSize = 0;
+ btnMas.Anchor = AnchorStyles.None;
+ btnMas.Click += new EventHandler(delegate (object sender, EventArgs e)
+ {
+ try
+ {
+ int numeroContador = int.Parse(txtStockAgregar.Text);
+ txtStockAgregar.Text = (numeroContador + 1).ToString();
+ modificarCantidad(numeroContador+1, importe.idImporte);
+ }
+ catch (Exception)
+ {
+ txtStockAgregar.Text = "0";
+ modificarCantidad(0, importe.idImporte);
+ }
+
+ });
+
+
+ informacionProducto.Controls.Add(imagen, 0, 0);
+ informacionProducto.Controls.Add(nombreStock, 1, 0);
+
+ agregarPanel.Controls.Add(txtStockAgregar, 0, 0);
+ agregarPanel.Controls.Add(btnMenos, 1, 0);
+ agregarPanel.Controls.Add(btnMas, 2, 0);
+
+
+ filaLayout.Controls.Add(informacionProducto, 0, 0);
+ filaLayout.Controls.Add(agregarPanel, 1, 0);
+ panelImporte.Controls.Add(filaLayout);
+ i++;
+ }
+ }
+
+ private void modificarCantidad(int cantidad, int idImporte)
+ {
+ detalles[idImporte-1].catidad = cantidad;
+ }
+
+ private void Importe1_Load(object sender, EventArgs e)
+ {
+
+ }
+
+ private void btnAceptar_Click(object sender, EventArgs e)
+ {
+ ventanaPadre.importes = detalles;
+ ventanaPadre.actualizarImporteTotal();
+ this.Close();
+ }
+ }
+}
diff --git a/Ventas/Importe1.resx b/Ventas/Importe1.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/Ventas/Importe1.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Ventas/vender.Designer.cs b/Ventas/vender.Designer.cs
index a302869..1de6210 100644
--- a/Ventas/vender.Designer.cs
+++ b/Ventas/vender.Designer.cs
@@ -51,6 +51,7 @@
this.responsablecb = new System.Windows.Forms.ComboBox();
this.btnFiar = new System.Windows.Forms.Button();
this.btnEnviar = new System.Windows.Forms.Button();
+ this.btnImporte = new System.Windows.Forms.Button();
this.flowLayoutPanel2.SuspendLayout();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).BeginInit();
@@ -98,7 +99,7 @@
this.flowLayoutPanel2.Controls.Add(this.label1);
this.flowLayoutPanel2.Controls.Add(this.labeltotal);
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.Size = new System.Drawing.Size(243, 968);
this.flowLayoutPanel2.TabIndex = 11;
@@ -109,7 +110,7 @@
this.panel1.BackColor = System.Drawing.Color.Transparent;
this.panel1.Controls.Add(this.pictureBox9);
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.Size = new System.Drawing.Size(234, 214);
this.panel1.TabIndex = 8;
@@ -118,7 +119,7 @@
//
this.pictureBox9.Image = global::compabetov2.Properties.Resources.HomeroMenu;
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.Size = new System.Drawing.Size(190, 197);
this.pictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
@@ -134,7 +135,7 @@
this.label1.Location = new System.Drawing.Point(2, 218);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(83, 31);
+ this.label1.Size = new System.Drawing.Size(66, 25);
this.label1.TabIndex = 17;
this.label1.Text = "Total:";
this.label1.Click += new System.EventHandler(this.label1_Click);
@@ -145,7 +146,7 @@
this.labeltotal.BackColor = System.Drawing.Color.Transparent;
this.labeltotal.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F);
this.labeltotal.ForeColor = System.Drawing.Color.AliceBlue;
- this.labeltotal.Location = new System.Drawing.Point(89, 218);
+ this.labeltotal.Location = new System.Drawing.Point(71, 174);
this.labeltotal.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.labeltotal.Name = "labeltotal";
this.labeltotal.Size = new System.Drawing.Size(0, 31);
@@ -160,7 +161,7 @@
this.flowLayoutPanel1.Controls.Add(this.button3);
this.flowLayoutPanel1.Controls.Add(this.button5);
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.Size = new System.Drawing.Size(243, 974);
this.flowLayoutPanel1.TabIndex = 8;
@@ -170,7 +171,7 @@
this.panel2.BackColor = System.Drawing.Color.Transparent;
this.panel2.Controls.Add(this.pictureBox7);
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.Size = new System.Drawing.Size(234, 214);
this.panel2.TabIndex = 8;
@@ -179,7 +180,7 @@
//
this.pictureBox7.Image = global::compabetov2.Properties.Resources.HomeroMenu;
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.Size = new System.Drawing.Size(190, 197);
this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
@@ -196,7 +197,7 @@
this.button1.Image = global::compabetov2.Properties.Resources.Menui1;
this.button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
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.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button1.Size = new System.Drawing.Size(234, 93);
@@ -215,7 +216,7 @@
this.button2.Image = global::compabetov2.Properties.Resources.estadisticasi;
this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
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.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button2.Size = new System.Drawing.Size(234, 93);
@@ -234,7 +235,7 @@
this.button3.Image = global::compabetov2.Properties.Resources.productoi;
this.button3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
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.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button3.Size = new System.Drawing.Size(234, 93);
@@ -252,7 +253,7 @@
this.button5.Image = global::compabetov2.Properties.Resources.sesionc;
this.button5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
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.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button5.Size = new System.Drawing.Size(234, 93);
@@ -264,7 +265,7 @@
//
this.flowLayoutPanel3.AutoScroll = true;
this.flowLayoutPanel3.Location = new System.Drawing.Point(247, 279);
- 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.Size = new System.Drawing.Size(955, 593);
this.flowLayoutPanel3.TabIndex = 14;
@@ -274,7 +275,7 @@
//
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.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.Size = new System.Drawing.Size(528, 30);
this.txtbusqueda.TabIndex = 15;
@@ -287,7 +288,7 @@
this.bntImprimir.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.bntImprimir.ForeColor = System.Drawing.Color.Transparent;
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.Size = new System.Drawing.Size(113, 44);
this.bntImprimir.TabIndex = 17;
@@ -300,7 +301,7 @@
this.responsablecb.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.responsablecb.FormattingEnabled = true;
this.responsablecb.Location = new System.Drawing.Point(1028, 177);
- 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.Size = new System.Drawing.Size(171, 33);
this.responsablecb.TabIndex = 18;
@@ -327,7 +328,7 @@
this.btnEnviar.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.btnEnviar.ForeColor = System.Drawing.Color.Transparent;
this.btnEnviar.Location = new System.Drawing.Point(852, 219);
- this.btnEnviar.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+ this.btnEnviar.Margin = new System.Windows.Forms.Padding(2);
this.btnEnviar.Name = "btnEnviar";
this.btnEnviar.Size = new System.Drawing.Size(113, 44);
this.btnEnviar.TabIndex = 20;
@@ -335,12 +336,27 @@
this.btnEnviar.UseVisualStyleBackColor = false;
this.btnEnviar.Click += new System.EventHandler(this.btnEnviar_Click);
//
+ // btnImporte
+ //
+ this.btnImporte.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(104)))), ((int)(((byte)(255)))));
+ this.btnImporte.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
+ this.btnImporte.ForeColor = System.Drawing.Color.Transparent;
+ this.btnImporte.Location = new System.Drawing.Point(735, 222);
+ this.btnImporte.Margin = new System.Windows.Forms.Padding(2);
+ this.btnImporte.Name = "btnImporte";
+ this.btnImporte.Size = new System.Drawing.Size(113, 44);
+ this.btnImporte.TabIndex = 21;
+ this.btnImporte.Text = "Importe";
+ this.btnImporte.UseVisualStyleBackColor = false;
+ this.btnImporte.Click += new System.EventHandler(this.btnImporte_Click);
+ //
// vender
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(1028, 627);
+ this.ClientSize = new System.Drawing.Size(1325, 627);
this.ControlBox = false;
+ this.Controls.Add(this.btnImporte);
this.Controls.Add(this.btnEnviar);
this.Controls.Add(this.btnFiar);
this.Controls.Add(this.responsablecb);
@@ -351,7 +367,7 @@
this.Controls.Add(this.lblhora);
this.Controls.Add(this.flowLayoutPanel2);
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.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.vender_Load);
@@ -393,5 +409,6 @@
private System.Windows.Forms.ComboBox responsablecb;
private System.Windows.Forms.Button btnFiar;
private System.Windows.Forms.Button btnEnviar;
+ private System.Windows.Forms.Button btnImporte;
}
}
\ No newline at end of file
diff --git a/Ventas/vender.cs b/Ventas/vender.cs
index 1cb2dbf..8a7be3e 100644
--- a/Ventas/vender.cs
+++ b/Ventas/vender.cs
@@ -30,6 +30,7 @@ namespace compabetov2
private LoginModel loginPrincipal;
private Dictionary imagenes = new Dictionary();
private List carrito = new List();
+ public List importes = new List();
public vender(LoginModel loginPrincipal)
@@ -173,7 +174,7 @@ namespace compabetov2
{
contador.Text = (numeroContador - 1).ToString();
total -= producto.precio;
- label1.Text = $"Total: ${total}";
+ label1.Text = $"Total: ${total} - Importe: $";
// Obtener información del Label id y precio
decimal precioProducto = producto.precio;
@@ -214,7 +215,7 @@ namespace compabetov2
int numeroContador = int.Parse(contador.Text.ToString());
contador.Text = (numeroContador + 1).ToString();
total += producto.precio;
- label1.Text = $"Total: ${total}";
+ label1.Text = $"Total: ${total} - Importe:";
// Obtener información del Label id y precio
int idProducto = int.Parse(id.Text);
@@ -526,17 +527,18 @@ namespace compabetov2
if (resultado == DialogResult.Yes)
{
VentaModel ventaModel = new VentaModel(total, -1, "",
- responsablecb.Text.Equals("") ? loginPrincipal.usuario : responsablecb.Text
+ responsablecb.Text.Equals("") ? loginPrincipal.usuario : responsablecb.Text,
+ 0
);
-
- if (service.crearVentaDAO(ventaModel, carrito))
+
+ if (service.crearVentaDAO(ventaModel, carrito, importes))
{
MessageBox.Show("Venta hecha");
ImprimirTicket();
eliminarProductosTocket();
llenarLayout();
total = 0;
-
+ importes.Clear();
}
}
else
@@ -547,7 +549,33 @@ namespace compabetov2
}
else
{
- MessageBox.Show("No hay ningun producto agregado");
+ if(importes.Count > 0)
+ {
+ if (total < 0)
+ {
+ DialogResult resultado = MessageBox.Show("¿Quieres hacer la devolucion del importe?", "Confirmación devolucion de importe", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+ if (resultado == DialogResult.Yes)
+ {
+ if (service.devolverImporte(importes))
+ {
+ MessageBox.Show("Importe devuelto");
+ llenarLayout();
+ total = 0;
+ importes.Clear();
+ }
+ }
+ }
+ else
+ {
+
+ MessageBox.Show("No puede vender un importe sin seleccionar un producto");
+ }
+ }
+ else
+ {
+ MessageBox.Show("No hay ningun producto agregado");
+ }
+
}
}
@@ -826,7 +854,7 @@ namespace compabetov2
c.Dispose();
flowLayoutPanel1.Controls.Remove(c);
}
- label1.Text = "Total: 0";
+ label1.Text = "Total: 0 - Importe: 0";
txtbusqueda.Text = "";
carrito.Clear();
@@ -838,5 +866,26 @@ namespace compabetov2
estadiscticas.Owner = this;
estadiscticas.Show();
}
+
+ private void btnImporte_Click(object sender, EventArgs e)
+ {
+ Importe1 importe = new Importe1(this);
+ importe.Owner = this;
+ importe.Show();
+ }
+
+ public void actualizarImporteTotal()
+ {
+ string mensaje = "";
+ decimal totalImporte = 0;
+ foreach(DetalleImporte importe in importes)
+ {
+ totalImporte += importe.precioImporte * importe.catidad;
+ mensaje += $"importe: {importe.fkImporte} - cantidad: {importe.catidad}\n";
+ }
+ MessageBox.Show(mensaje);
+ total += totalImporte;
+ label1.Text = $"Total: ${total}";
+ }
}
}
diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe
index 1aa92d6..bf7bd95 100644
Binary files a/bin/Debug/compabetov2.exe and b/bin/Debug/compabetov2.exe differ
diff --git a/bin/Debug/compabetov2.pdb b/bin/Debug/compabetov2.pdb
index 27d95ab..64f3d73 100644
Binary files a/bin/Debug/compabetov2.pdb and b/bin/Debug/compabetov2.pdb differ
diff --git a/bin/Debug/data.db b/bin/Debug/data.db
index f5d1ff7..c782e82 100644
Binary files a/bin/Debug/data.db and b/bin/Debug/data.db differ
diff --git a/compabetov2.csproj b/compabetov2.csproj
index e7b805f..3fd4e54 100644
--- a/compabetov2.csproj
+++ b/compabetov2.csproj
@@ -107,7 +107,9 @@
+
+
Form
@@ -246,6 +248,18 @@
datosEnvio.cs
+
+ Form
+
+
+ Importe.cs
+
+
+ Form
+
+
+ Importe1.cs
+
Form
@@ -331,6 +345,12 @@
datosEnvio.cs
+
+ Importe.cs
+
+
+ Importe1.cs
+
vender.cs
diff --git a/database/DAO.cs b/database/DAO.cs
index 2f48858..daad4ec 100644
--- a/database/DAO.cs
+++ b/database/DAO.cs
@@ -575,35 +575,6 @@ namespace compabetov2.database
}
}
- public static bool insertarCategoriaDAO(Categoria categoria)
- {
- var db_conexion = new Conexion();
- try
- {
- using (SQLiteConnection conexion = db_conexion.get_connection())
- {
- conexion.Open();
-
- string sql = "INSERT INTO Categoria (nombre, descripcion) " +
- "VALUES (@nombre, @descripcion)";
-
- using (SQLiteCommand command = new SQLiteCommand(sql, conexion))
- {
- command.Parameters.AddWithValue("@nombre", categoria.nombre);
- command.Parameters.AddWithValue("@descripcion", categoria.descripcion);
- int filasAfectadas = command.ExecuteNonQuery();
-
- if (filasAfectadas > 0) { return true; }
- else { return false; }
- }
- }
- }
- catch (SQLiteException ex)
- {
- MessageBox.Show(ex.Message);
- return false;
- }
- }
public static bool insertarClienteDAO(Cliente cliente)
{
@@ -767,7 +738,7 @@ namespace compabetov2.database
}
}
- public static bool crearVentaDAO(VentaModel venta, List detalleVentas)
+ public static bool crearVentaDAO(VentaModel venta, List detalleVentas, List importes)
{
var db_conexion = new Conexion();
try
@@ -785,14 +756,16 @@ namespace compabetov2.database
string sqlIdVenta = "SELECT idVenta FROM venta ORDER BY idVenta DESC LIMIT 1";
string sqlProductoStock = "SELECT stock FROM Producto WHERE idproducto = @idproducto";
string sqlProductoUpdate = "UPDATE Producto SET stock = @stock WHERE idproducto = @idproducto";
+ string sqlImporte = "INSERT INTO detalle_importe (fk_importe,cantidad,precio,fecha) VALUES (@fk_importe,@cantidad,@precio,@fecha)";
-
+ // CREACION DE LA VENTA
SQLiteCommand commandVenta = new SQLiteCommand(sqlVenta, conexion);
commandVenta.Parameters.AddWithValue("@fecha", DateTime.Now.ToString());
commandVenta.Parameters.AddWithValue("@total", venta.total);
commandVenta.Parameters.AddWithValue("@responzable", venta.responzable);
commandVenta.ExecuteNonQuery();
+ //CONSEGUIR EL ID DE LA VENTA PARA RELACIONARLO CON DETALLE VENTA
SQLiteCommand commandConsulta = new SQLiteCommand(sqlIdVenta, conexion);
SQLiteDataReader reader = commandConsulta.ExecuteReader();
@@ -802,6 +775,7 @@ namespace compabetov2.database
idVenta = reader.GetInt64(0);
}
+ // CREACION DE DETALLE VENTA
foreach (DetalleVentaModel detalleVenta in detalleVentas)
{
SQLiteCommand commandEmpleado = new SQLiteCommand(sqlDetalle, conexion);
@@ -821,10 +795,74 @@ namespace compabetov2.database
}
+ //ACTUALIZACION DE STOCK
SQLiteCommand commandProdcutoUpdate = new SQLiteCommand(sqlProductoUpdate, conexion);
commandProdcutoUpdate.Parameters.AddWithValue("@stock", stockActual - (detalleVenta.cantidad * detalleVenta.producto.cantidad));
commandProdcutoUpdate.Parameters.AddWithValue("@idproducto", detalleVenta.producto.fkProducto);
commandProdcutoUpdate.ExecuteNonQuery();
+
+
+
+ }
+ //creacion del importe
+ foreach (DetalleImporte importe in importes)
+ {
+ if (importe.catidad != 0)
+ {
+ SQLiteCommand commandDetalleImporte = new SQLiteCommand(sqlImporte, conexion);
+ commandDetalleImporte.Parameters.AddWithValue("@fk_importe", importe.fkImporte);
+ commandDetalleImporte.Parameters.AddWithValue("@cantidad", importe.catidad);
+ commandDetalleImporte.Parameters.AddWithValue("@precio", importe.precioImporte);
+ commandDetalleImporte.Parameters.AddWithValue("@fecha", DateTime.Now.ToString());
+ commandDetalleImporte.ExecuteNonQuery();
+ }
+ }
+
+ transaccion.Commit();
+ return true;
+ }
+ catch (SQLiteException ex)
+ {
+ transaccion.Rollback();
+ MessageBox.Show(ex.Message);
+ return false;
+ }
+ }
+ }
+ }
+ catch (SQLiteException ex)
+ {
+ MessageBox.Show(ex.Message);
+ return false;
+ }
+ }
+
+ public static bool devolverImporteDAO(List importes)
+ {
+ var db_conexion = new Conexion();
+ try
+ {
+ using (SQLiteConnection conexion = db_conexion.get_connection())
+ {
+ conexion.Open();
+
+ using (var transaccion = conexion.BeginTransaction())
+ {
+ try
+ {
+ string sqlImporte = "INSERT INTO detalle_importe (fk_importe,cantidad,precio,fecha) VALUES (@fk_importe,@cantidad,@precio,@fecha)";
+ //creacion del importe
+ foreach (DetalleImporte importe in importes)
+ {
+ if (importe.catidad != 0)
+ {
+ SQLiteCommand commandDetalleImporte = new SQLiteCommand(sqlImporte, conexion);
+ commandDetalleImporte.Parameters.AddWithValue("@fk_importe", importe.fkImporte);
+ commandDetalleImporte.Parameters.AddWithValue("@cantidad", importe.catidad);
+ commandDetalleImporte.Parameters.AddWithValue("@precio", importe.precioImporte);
+ commandDetalleImporte.Parameters.AddWithValue("@fecha", DateTime.Now.ToString());
+ commandDetalleImporte.ExecuteNonQuery();
+ }
}
transaccion.Commit();
@@ -1389,8 +1427,6 @@ namespace compabetov2.database
try
{
string sqlCuenta = "UPDATE envios SET estado = @estado WHERE idEnvios = @idEnvios;";
- string sqlStock = "select stock from Producto p where idproducto = @idProducto";
- string sqlActualizarStock = "UPDATE Producto set stock = @stock WHERE idproducto = @idProducto";
SQLiteCommand command = new SQLiteCommand(sqlCuenta, conexion);
command.Parameters.AddWithValue("@idEnvios", envio.id);
@@ -1604,6 +1640,30 @@ namespace compabetov2.database
}
}
+ public static SQLiteDataReader conseguirImportesDAO()
+ {
+ SQLiteDataReader reader = null;
+ var db_conexion = new Conexion();
+ try
+ {
+ SQLiteConnection conexion = db_conexion.get_connection();
+
+ conexion.Open();
+
+ string sql = "SELECT * FROM importe";
+ SQLiteCommand command = new SQLiteCommand(sql, conexion);
+ reader = command.ExecuteReader();
+
+ return reader;
+
+ }
+ catch (SQLiteException ex)
+ {
+ MessageBox.Show(ex.Message);
+ return reader;
+ }
+ }
+
private static void crearDB()
{
var db_conexion = new Conexion();
diff --git a/database/modelos/DetalleImporte.cs b/database/modelos/DetalleImporte.cs
new file mode 100644
index 0000000..d7cac40
--- /dev/null
+++ b/database/modelos/DetalleImporte.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace compabetov2.database.modelos
+{
+ public class DetalleImporte
+ {
+ public int fkImporte;
+ public int catidad;
+ public decimal precioImporte;
+
+ public DetalleImporte(int fkImporte, int cantidad, decimal precioImporte)
+ {
+ this.fkImporte = fkImporte;
+ this.catidad = cantidad;
+ this.precioImporte = precioImporte;
+ }
+ }
+}
diff --git a/database/modelos/ImporteModel.cs b/database/modelos/ImporteModel.cs
new file mode 100644
index 0000000..b2508e5
--- /dev/null
+++ b/database/modelos/ImporteModel.cs
@@ -0,0 +1,25 @@
+using compabetov2.Ventas;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace compabetov2.database.modelos
+{
+ internal class ImporteModel
+ {
+ public int idImporte;
+
+ public string tipo;
+ public decimal precioImporte;
+ public string img;
+
+ public ImporteModel(int idImporte, string tipo, decimal precioImporte, string img) {
+ this.idImporte = idImporte;
+ this.tipo = tipo;
+ this.img = img;
+ this.precioImporte = precioImporte;
+ }
+ }
+}
diff --git a/database/modelos/VentaModel.cs b/database/modelos/VentaModel.cs
index 9a5889d..599d53f 100644
--- a/database/modelos/VentaModel.cs
+++ b/database/modelos/VentaModel.cs
@@ -12,12 +12,15 @@ namespace compabetov2.database.modelos
public string fecha;
public decimal total;
public string responzable;
+ public int importe;
- public VentaModel(decimal total = 0, int id = -1, string fecha = "", string responzable = "") {
+ public VentaModel(decimal total = 0, int id = -1, string fecha = "", string responzable = "", int importe = 0)
+ {
this.id = id;
this.fecha = fecha;
this.total = total;
this.responzable = responzable;
+ this.importe = importe;
}
}
}
diff --git a/database/service.cs b/database/service.cs
index 18c08de..93e5526 100644
--- a/database/service.cs
+++ b/database/service.cs
@@ -69,11 +69,6 @@ namespace compabetov2.database
{
return DAO.insertarProductoDAO(producto);
}
-
- public static bool insertarCategoriaDAO(Categoria categoria)
- {
- return DAO.insertarCategoriaDAO(categoria);
- }
public static bool insertarCliente(Cliente cliente)
{
@@ -202,9 +197,14 @@ namespace compabetov2.database
return mermas;
}
- public static bool crearVentaDAO(VentaModel venta, List detalleVentas)
+ public static bool crearVentaDAO(VentaModel venta, List detalleVentas, List importes)
{
- return DAO.crearVentaDAO(venta, detalleVentas);
+ return DAO.crearVentaDAO(venta, detalleVentas,importes);
+ }
+
+ public static bool devolverImporte(List importes)
+ {
+ return DAO.devolverImporteDAO(importes);
}
public static bool insertarMerma(Merma merma)
@@ -520,5 +520,23 @@ namespace compabetov2.database
return variantes;
}
+
+ public static List conseguirImportes()
+ {
+ List importes = new List();
+ SQLiteDataReader reader = DAO.conseguirImportesDAO();
+
+ while (reader.Read())
+ {
+ ImporteModel importe = new ImporteModel(
+ (int)reader.GetInt64(0), //id
+ reader.GetString(1), //tipo
+ reader.GetDecimal(2), //precion
+ reader.GetString(3) //imagen
+ );
+ importes.Add(importe);
+ }
+ return importes;
+ }
}
}
diff --git a/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/obj/Debug/DesignTimeResolveAssemblyReferences.cache
index 10a1a65..4382aa9 100644
Binary files a/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ
diff --git a/obj/Debug/compabetov2.csproj.AssemblyReference.cache b/obj/Debug/compabetov2.csproj.AssemblyReference.cache
index 2692e89..3e96430 100644
Binary files a/obj/Debug/compabetov2.csproj.AssemblyReference.cache and b/obj/Debug/compabetov2.csproj.AssemblyReference.cache differ
diff --git a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache
index c515b82..5c110f6 100644
--- a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache
+++ b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-e9fe970c95e178692c332067dd30d0ac1c7f5a7190013fcb65c40593ddd0ee2d
+afad5b5549ec219a4cd1dcd558a30f10f9712e8d73e654845b31f646b6d12d05
diff --git a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt
index 79d4459..43fb6f0 100644
--- a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt
+++ b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt
@@ -96,3 +96,5 @@ C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.a
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.csproj.CopyComplete
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.exe
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.pdb
+C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.Ventas.Importe.resources
+C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.Ventas.Importe1.resources
diff --git a/obj/Debug/compabetov2.csproj.GenerateResource.cache b/obj/Debug/compabetov2.csproj.GenerateResource.cache
index b3c67ed..21f2586 100644
Binary files a/obj/Debug/compabetov2.csproj.GenerateResource.cache and b/obj/Debug/compabetov2.csproj.GenerateResource.cache differ
diff --git a/obj/Debug/compabetov2.exe b/obj/Debug/compabetov2.exe
index 1aa92d6..bf7bd95 100644
Binary files a/obj/Debug/compabetov2.exe and b/obj/Debug/compabetov2.exe differ
diff --git a/obj/Debug/compabetov2.pdb b/obj/Debug/compabetov2.pdb
index 27d95ab..64f3d73 100644
Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ