crud de importe en proceso

This commit is contained in:
Carlos Sandoval
2024-06-30 11:19:46 -06:00
parent 3a1c75967a
commit 8009e38291
21 changed files with 733 additions and 50 deletions
File diff suppressed because one or more lines are too long
+140
View File
@@ -0,0 +1,140 @@
namespace compabetov2.admin
{
partial class AgregarImporte
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.txtNombre = new System.Windows.Forms.TextBox();
this.txtPrecio = new System.Windows.Forms.TextBox();
this.lbPrecio = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.lbImg = new System.Windows.Forms.Label();
this.button2 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(202, 117);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(79, 24);
this.label1.TabIndex = 0;
this.label1.Text = "Nombre";
//
// txtNombre
//
this.txtNombre.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtNombre.Location = new System.Drawing.Point(206, 157);
this.txtNombre.Name = "txtNombre";
this.txtNombre.Size = new System.Drawing.Size(323, 29);
this.txtNombre.TabIndex = 1;
//
// txtPrecio
//
this.txtPrecio.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtPrecio.Location = new System.Drawing.Point(206, 246);
this.txtPrecio.Name = "txtPrecio";
this.txtPrecio.Size = new System.Drawing.Size(323, 29);
this.txtPrecio.TabIndex = 3;
//
// lbPrecio
//
this.lbPrecio.AutoSize = true;
this.lbPrecio.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbPrecio.Location = new System.Drawing.Point(202, 206);
this.lbPrecio.Name = "lbPrecio";
this.lbPrecio.Size = new System.Drawing.Size(64, 24);
this.lbPrecio.TabIndex = 2;
this.lbPrecio.Text = "Precio";
//
// button1
//
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.button1.Location = new System.Drawing.Point(206, 309);
this.button1.Margin = new System.Windows.Forms.Padding(2);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(77, 37);
this.button1.TabIndex = 56;
this.button1.Text = "Subir";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// lbImg
//
this.lbImg.AutoSize = true;
this.lbImg.BackColor = System.Drawing.Color.Transparent;
this.lbImg.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbImg.ForeColor = System.Drawing.Color.Transparent;
this.lbImg.Location = new System.Drawing.Point(288, 314);
this.lbImg.Name = "lbImg";
this.lbImg.Size = new System.Drawing.Size(78, 24);
this.lbImg.TabIndex = 55;
this.lbImg.Text = "Imagen:";
//
// button2
//
this.button2.Location = new System.Drawing.Point(254, 393);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 57;
this.button2.Text = "button2";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// AgregarImporte
//
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.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.lbImg);
this.Controls.Add(this.txtPrecio);
this.Controls.Add(this.lbPrecio);
this.Controls.Add(this.txtNombre);
this.Controls.Add(this.label1);
this.Name = "AgregarImporte";
this.Text = "AgregarImporte";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtNombre;
private System.Windows.Forms.TextBox txtPrecio;
private System.Windows.Forms.Label lbPrecio;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label lbImg;
private System.Windows.Forms.Button button2;
}
}
+59
View File
@@ -0,0 +1,59 @@
using compabetov2.database.modelos;
using compabetov2.Ventas;
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.admin
{
public partial class AgregarImporte : Form
{
private string imagePath;
private visualizarImportes ventanaPadre;
public AgregarImporte(visualizarImportes ventanaPadre)
{
InitializeComponent();
this.ventanaPadre = ventanaPadre;
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "Archivos de imagen (*.jpg, *.jpeg, *.png, *.bmp)|*.jpg;*.jpeg;*.png;*.bmp";
openFileDialog1.Title = "Seleccionar imagen";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
imagePath = openFileDialog1.FileName;
lbImg.Text = $"Imagen: {Path.GetFileName(imagePath)}";
}
}
private void button2_Click(object sender, EventArgs e)
{
try
{
string nombre = txtNombre.Text;
decimal precio = decimal.Parse(txtPrecio.Text);
ImporteModel importe = new ImporteModel(-1, nombre, precio, Path.GetFileName(imagePath));
}
catch
{
MessageBox.Show("Por favor introduzca un precio valido", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+49 -48
View File
@@ -28,6 +28,8 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.AdminPanel = new System.Windows.Forms.FlowLayoutPanel();
this.btnAgregar = new System.Windows.Forms.Button();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.pictureBox7 = new System.Windows.Forms.PictureBox(); this.pictureBox7 = new System.Windows.Forms.PictureBox();
@@ -35,13 +37,32 @@
this.button2 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button(); this.button5 = new System.Windows.Forms.Button();
this.AdminPanel = new System.Windows.Forms.FlowLayoutPanel();
this.btnAgregar = new System.Windows.Forms.Button();
this.flowLayoutPanel1.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// AdminPanel
//
this.AdminPanel.AutoScroll = true;
this.AdminPanel.BackColor = System.Drawing.SystemColors.Control;
this.AdminPanel.Location = new System.Drawing.Point(308, 189);
this.AdminPanel.Name = "AdminPanel";
this.AdminPanel.Size = new System.Drawing.Size(1146, 615);
this.AdminPanel.TabIndex = 14;
//
// btnAgregar
//
this.btnAgregar.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnAgregar.Location = new System.Drawing.Point(813, 125);
this.btnAgregar.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnAgregar.Name = "btnAgregar";
this.btnAgregar.Size = new System.Drawing.Size(90, 36);
this.btnAgregar.TabIndex = 15;
this.btnAgregar.Text = "Agregar";
this.btnAgregar.UseVisualStyleBackColor = true;
this.btnAgregar.Click += new System.EventHandler(this.btnAgregar_Click);
//
// flowLayoutPanel1 // flowLayoutPanel1
// //
this.flowLayoutPanel1.BackgroundImage = global::compabetov2.Properties.Resources.rec; this.flowLayoutPanel1.BackgroundImage = global::compabetov2.Properties.Resources.rec;
@@ -51,26 +72,26 @@
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(0, -1); this.flowLayoutPanel1.Location = new System.Drawing.Point(0, -1);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 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(324, 1061); this.flowLayoutPanel1.Size = new System.Drawing.Size(243, 862);
this.flowLayoutPanel1.TabIndex = 8; this.flowLayoutPanel1.TabIndex = 8;
// //
// panel2 // panel2
// //
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(3, 2); this.panel2.Location = new System.Drawing.Point(2, 2);
this.panel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 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(312, 263); this.panel2.Size = new System.Drawing.Size(234, 214);
this.panel2.TabIndex = 8; this.panel2.TabIndex = 8;
// //
// pictureBox7 // pictureBox7
// //
this.pictureBox7.Image = global::compabetov2.Properties.Resources.HomeroMenu; this.pictureBox7.Image = global::compabetov2.Properties.Resources.HomeroMenu;
this.pictureBox7.Location = new System.Drawing.Point(64, 34); this.pictureBox7.Location = new System.Drawing.Point(48, 28);
this.pictureBox7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 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;
@@ -86,11 +107,11 @@
this.button1.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.button1.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
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(3, 269); this.button1.Location = new System.Drawing.Point(2, 220);
this.button1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 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(51, 0, 0, 0); this.button1.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button1.Size = new System.Drawing.Size(312, 114); this.button1.Size = new System.Drawing.Size(234, 93);
this.button1.TabIndex = 8; this.button1.TabIndex = 8;
this.button1.Text = "Menú"; this.button1.Text = "Menú";
this.button1.UseVisualStyleBackColor = false; this.button1.UseVisualStyleBackColor = false;
@@ -105,11 +126,11 @@
this.button2.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.button2.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
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(3, 387); this.button2.Location = new System.Drawing.Point(2, 317);
this.button2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 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(51, 0, 0, 0); this.button2.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button2.Size = new System.Drawing.Size(312, 114); this.button2.Size = new System.Drawing.Size(234, 93);
this.button2.TabIndex = 9; this.button2.TabIndex = 9;
this.button2.Text = "Reportes"; this.button2.Text = "Reportes";
this.button2.UseVisualStyleBackColor = false; this.button2.UseVisualStyleBackColor = false;
@@ -124,11 +145,11 @@
this.button3.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.button3.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
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(3, 505); this.button3.Location = new System.Drawing.Point(2, 414);
this.button3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 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(51, 0, 0, 0); this.button3.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button3.Size = new System.Drawing.Size(312, 114); this.button3.Size = new System.Drawing.Size(234, 93);
this.button3.TabIndex = 10; this.button3.TabIndex = 10;
this.button3.Text = "Productos"; this.button3.Text = "Productos";
this.button3.UseVisualStyleBackColor = false; this.button3.UseVisualStyleBackColor = false;
@@ -142,47 +163,27 @@
this.button5.ForeColor = System.Drawing.SystemColors.ButtonHighlight; this.button5.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
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(3, 623); this.button5.Location = new System.Drawing.Point(2, 511);
this.button5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 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(51, 0, 0, 0); this.button5.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
this.button5.Size = new System.Drawing.Size(312, 114); this.button5.Size = new System.Drawing.Size(234, 93);
this.button5.TabIndex = 12; this.button5.TabIndex = 12;
this.button5.Text = "Salir"; this.button5.Text = "Salir";
this.button5.UseVisualStyleBackColor = false; this.button5.UseVisualStyleBackColor = false;
this.button5.Click += new System.EventHandler(this.button5_Click); this.button5.Click += new System.EventHandler(this.button5_Click);
// //
// AdminPanel
//
this.AdminPanel.AutoScroll = true;
this.AdminPanel.BackColor = System.Drawing.SystemColors.Control;
this.AdminPanel.Location = new System.Drawing.Point(410, 233);
this.AdminPanel.Margin = new System.Windows.Forms.Padding(4);
this.AdminPanel.Name = "AdminPanel";
this.AdminPanel.Size = new System.Drawing.Size(1528, 757);
this.AdminPanel.TabIndex = 14;
//
// btnAgregar
//
this.btnAgregar.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnAgregar.Location = new System.Drawing.Point(1084, 154);
this.btnAgregar.Name = "btnAgregar";
this.btnAgregar.Size = new System.Drawing.Size(120, 44);
this.btnAgregar.TabIndex = 15;
this.btnAgregar.Text = "Agregar";
this.btnAgregar.UseVisualStyleBackColor = true;
this.btnAgregar.Click += new System.EventHandler(this.btnAgregar_Click);
//
// crud // crud
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); 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(1942, 1037); this.ClientSize = new System.Drawing.Size(1040, 640);
this.ControlBox = false; this.ControlBox = false;
this.Controls.Add(this.btnAgregar); this.Controls.Add(this.btnAgregar);
this.Controls.Add(this.AdminPanel); this.Controls.Add(this.AdminPanel);
this.Controls.Add(this.flowLayoutPanel1); this.Controls.Add(this.flowLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Name = "crud"; this.Name = "crud";
this.ShowIcon = false; this.ShowIcon = false;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+7
View File
@@ -209,6 +209,13 @@ namespace compabetov2.admin
login.ShowDialog(); login.ShowDialog();
this.Dispose(); this.Dispose();
} }
private void btnImporte_Click(object sender, EventArgs e)
{
visualizarImportes ventana = new visualizarImportes();
ventana.Owner = this;
ventana.Show();
}
} }
+1
View File
@@ -115,6 +115,7 @@
this.lbImg.Size = new System.Drawing.Size(78, 24); this.lbImg.Size = new System.Drawing.Size(78, 24);
this.lbImg.TabIndex = 53; this.lbImg.TabIndex = 53;
this.lbImg.Text = "Imagen:"; this.lbImg.Text = "Imagen:";
this.lbImg.Click += new System.EventHandler(this.lbImg_Click);
// //
// txtCantidad // txtCantidad
// //
+5
View File
@@ -124,5 +124,10 @@ namespace compabetov2.admin
{ {
} }
private void lbImg_Click(object sender, EventArgs e)
{
}
} }
} }
+59
View File
@@ -0,0 +1,59 @@
namespace compabetov2.admin
{
partial class visualizarImportes
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.panelImporte = new System.Windows.Forms.FlowLayoutPanel();
this.SuspendLayout();
//
// panelImporte
//
this.panelImporte.BackColor = System.Drawing.Color.Transparent;
this.panelImporte.Location = new System.Drawing.Point(62, 43);
this.panelImporte.Name = "panelImporte";
this.panelImporte.Size = new System.Drawing.Size(677, 364);
this.panelImporte.TabIndex = 2;
this.panelImporte.Paint += new System.Windows.Forms.PaintEventHandler(this.panelImporte_Paint);
//
// visualizarImportes
//
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.panelImporte);
this.Name = "visualizarImportes";
this.Text = "visualizarImportes";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.FlowLayoutPanel panelImporte;
}
}
+123
View File
@@ -0,0 +1,123 @@
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.admin
{
public partial class visualizarImportes : Form
{
private List<ImporteModel> importes;
public visualizarImportes()
{
InitializeComponent();
llenarPanel();
}
private void llenarPanel()
{
panelImporte.Controls.Clear();
importes = service.conseguirImportes();
foreach (ImporteModel importe in importes)
{
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 = 2;
agregarPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
agregarPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
agregarPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
Button btnEditar = new Button();
btnEditar.Text = "Editar";
btnEditar.Width = 150;
btnEditar.Height = 60;
btnEditar.Font = new Font(btnEditar.Font.FontFamily, 14);
btnEditar.ForeColor = Color.White;
btnEditar.FlatStyle = FlatStyle.Flat;
btnEditar.FlatAppearance.BorderSize = 0;
btnEditar.BackColor = Color.FromArgb(33, 90, 255);
btnEditar.Anchor = AnchorStyles.None;
btnEditar.Click += new EventHandler(delegate (object sender, EventArgs e)
{
});
Button btnEliminar = new Button();
btnEliminar.Text = "Eliminar";
btnEliminar.Width = 150;
btnEliminar.Height = 60;
btnEliminar.Font = new Font(btnEliminar.Font.FontFamily, 14);
btnEliminar.ForeColor = Color.Black;
btnEliminar.BackColor = Color.Red;
btnEliminar.FlatStyle = FlatStyle.Flat;
btnEliminar.FlatAppearance.BorderSize = 0;
btnEliminar.Anchor = AnchorStyles.None;
btnEliminar.Click += new EventHandler(delegate (object sender, EventArgs e)
{
});
informacionProducto.Controls.Add(imagen, 0, 0);
informacionProducto.Controls.Add(nombreStock, 1, 0);
agregarPanel.Controls.Add(btnEditar, 0, 0);
agregarPanel.Controls.Add(btnEliminar, 1, 0);
filaLayout.Controls.Add(informacionProducto, 0, 0);
filaLayout.Controls.Add(agregarPanel, 1, 0);
panelImporte.Controls.Add(filaLayout);
}
}
private void panelImporte_Paint(object sender, PaintEventArgs e)
{
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
Binary file not shown.
Binary file not shown.
+18
View File
@@ -112,6 +112,12 @@
<Compile Include="admin\addvariante.Designer.cs"> <Compile Include="admin\addvariante.Designer.cs">
<DependentUpon>addvariante.cs</DependentUpon> <DependentUpon>addvariante.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="admin\AgregarImporte.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="admin\AgregarImporte.Designer.cs">
<DependentUpon>AgregarImporte.cs</DependentUpon>
</Compile>
<Compile Include="admin\agregarproducto.cs"> <Compile Include="admin\agregarproducto.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -142,6 +148,12 @@
<Compile Include="admin\Variantes.Designer.cs"> <Compile Include="admin\Variantes.Designer.cs">
<DependentUpon>Variantes.cs</DependentUpon> <DependentUpon>Variantes.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="admin\visualizarImportes.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="admin\visualizarImportes.Designer.cs">
<DependentUpon>visualizarImportes.cs</DependentUpon>
</Compile>
<Compile Include="database\modelos\DetalleEnvioModel.cs" /> <Compile Include="database\modelos\DetalleEnvioModel.cs" />
<Compile Include="database\modelos\DetalleImporte.cs" /> <Compile Include="database\modelos\DetalleImporte.cs" />
<Compile Include="database\modelos\DetalleImporteCuenta.cs" /> <Compile Include="database\modelos\DetalleImporteCuenta.cs" />
@@ -320,6 +332,9 @@
<DependentUpon>addvariante.cs</DependentUpon> <DependentUpon>addvariante.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="admin\AgregarImporte.resx">
<DependentUpon>AgregarImporte.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="admin\agregarproducto.resx"> <EmbeddedResource Include="admin\agregarproducto.resx">
<DependentUpon>agregarproducto.cs</DependentUpon> <DependentUpon>agregarproducto.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@@ -335,6 +350,9 @@
<EmbeddedResource Include="admin\Variantes.resx"> <EmbeddedResource Include="admin\Variantes.resx">
<DependentUpon>Variantes.cs</DependentUpon> <DependentUpon>Variantes.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="admin\visualizarImportes.resx">
<DependentUpon>visualizarImportes.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Empleados\AgregarEmpleado1.resx"> <EmbeddedResource Include="Empleados\AgregarEmpleado1.resx">
<DependentUpon>AgregarEmpleado1.cs</DependentUpon> <DependentUpon>AgregarEmpleado1.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
+28
View File
@@ -13,6 +13,7 @@ using System.Windows.Forms;
using compabetov2.admin; using compabetov2.admin;
using compabetov2.database; using compabetov2.database;
using compabetov2.database.modelos; using compabetov2.database.modelos;
using compabetov2.Ventas;
namespace compabetov2.database namespace compabetov2.database
{ {
@@ -1981,6 +1982,33 @@ namespace compabetov2.database
} }
} }
public static bool insertarImporteDAO(ImporteModel importe)
{
var db_conexion = new Conexion();
try
{
SQLiteConnection conexion = db_conexion.get_connection();
conexion.Open();
string sql = "INSERT INTO importe (tipo, precioImporte, img) VALUES(@tipo, @precioImporte, @img); ";
SQLiteCommand command = new SQLiteCommand(sql, conexion);
command.Parameters.AddWithValue("@tipo",importe.tipo);
command.Parameters.AddWithValue("@precioImporte", importe.precioImporte);
command.Parameters.AddWithValue("@img",importe.img);
command.ExecuteNonQuery();
return true;
}
catch (SQLiteException ex)
{
MessageBox.Show(ex.Message);
return false;
}
}
private static void crearDB() private static void crearDB()
{ {
var db_conexion = new Conexion(); var db_conexion = new Conexion();
Binary file not shown.
@@ -1 +1 @@
4bc0b21d4c0f19e1e9ae1bfa37f9e96b5658ecea100004a31759a9d5405753d7 7667a5999934c1a74b47acd40b7c90e3bc381844d0d29d1440ec77954ef70622
@@ -167,3 +167,5 @@ C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.a
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.admin.editarvariante.resources C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.admin.editarvariante.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.RegistroVentas.resources C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.RegistroVentas.resources
C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.RegistroVentas.resources C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.RegistroVentas.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.admin.visualizarImportes.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.admin.AgregarImporte.resources
Binary file not shown.
Binary file not shown.
Binary file not shown.