Merge branch 'Vista'

This commit is contained in:
2024-08-03 21:22:12 +01:00
151 changed files with 5978 additions and 14359 deletions

122
Vista/AddProducto.Designer.cs generated Normal file
View File

@@ -0,0 +1,122 @@
namespace Vista
{
partial class AddProducto
{
/// <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()
{
comboBox1 = new ComboBox();
label1 = new Label();
label2 = new Label();
numericUpDown1 = new NumericUpDown();
button1 = new Button();
button2 = new Button();
((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
SuspendLayout();
//
// comboBox1
//
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox1.FormattingEnabled = true;
comboBox1.Location = new Point(164, 36);
comboBox1.Name = "comboBox1";
comboBox1.Size = new Size(121, 23);
comboBox1.TabIndex = 0;
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(92, 39);
label1.Name = "label1";
label1.Size = new Size(56, 15);
label1.TabIndex = 1;
label1.Text = "Producto";
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(93, 85);
label2.Name = "label2";
label2.Size = new Size(55, 15);
label2.TabIndex = 2;
label2.Text = "Cantidad";
//
// numericUpDown1
//
numericUpDown1.Location = new Point(165, 77);
numericUpDown1.Maximum = new decimal(new int[] { 10000000, 0, 0, 0 });
numericUpDown1.Name = "numericUpDown1";
numericUpDown1.Size = new Size(120, 23);
numericUpDown1.TabIndex = 3;
//
// button1
//
button1.Location = new Point(12, 191);
button1.Name = "button1";
button1.Size = new Size(85, 42);
button1.TabIndex = 4;
button1.Text = "Guardar";
button1.UseVisualStyleBackColor = true;
button1.Click += button1_Click;
//
// button2
//
button2.Location = new Point(354, 191);
button2.Name = "button2";
button2.Size = new Size(85, 42);
button2.TabIndex = 5;
button2.Text = "Cancelar";
button2.UseVisualStyleBackColor = true;
button2.Click += button2_Click;
//
// AddProducto
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(451, 245);
Controls.Add(button2);
Controls.Add(button1);
Controls.Add(numericUpDown1);
Controls.Add(label2);
Controls.Add(label1);
Controls.Add(comboBox1);
Name = "AddProducto";
Text = "Form1";
((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private ComboBox comboBox1;
private Label label1;
private Label label2;
private NumericUpDown numericUpDown1;
private Button button1;
private Button button2;
}
}

30
Vista/AddProducto.cs Normal file
View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Vista
{
public partial class AddProducto : Form
{
public AddProducto()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Close();
}
private void button2_Click(object sender, EventArgs e)
{
Close();
}
}
}

120
Vista/AddProducto.resx Normal file
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>

119
Vista/CategoriaCreate.Designer.cs generated Normal file
View File

@@ -0,0 +1,119 @@
namespace Vista
{
partial class CategoriaCreate
{
/// <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()
{
button2 = new Button();
label1 = new Label();
label2 = new Label();
numericUpDown1 = new NumericUpDown();
textBox1 = new TextBox();
button1 = new Button();
((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
SuspendLayout();
//
// button2
//
button2.Location = new Point(146, 166);
button2.Name = "button2";
button2.Size = new Size(75, 23);
button2.TabIndex = 1;
button2.Text = "Cancelar";
button2.UseVisualStyleBackColor = true;
button2.Click += button2_Click;
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(12, 31);
label1.Name = "label1";
label1.Size = new Size(18, 15);
label1.TabIndex = 2;
label1.Text = "ID";
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(12, 67);
label2.Name = "label2";
label2.Size = new Size(69, 15);
label2.TabIndex = 3;
label2.Text = "Descripcion";
//
// numericUpDown1
//
numericUpDown1.Location = new Point(101, 23);
numericUpDown1.Maximum = new decimal(new int[] { 1215752191, 23, 0, 0 });
numericUpDown1.Name = "numericUpDown1";
numericUpDown1.Size = new Size(120, 23);
numericUpDown1.TabIndex = 4;
//
// textBox1
//
textBox1.Location = new Point(101, 59);
textBox1.Name = "textBox1";
textBox1.Size = new Size(120, 23);
textBox1.TabIndex = 5;
//
// button1
//
button1.Location = new Point(32, 166);
button1.Name = "button1";
button1.Size = new Size(75, 23);
button1.TabIndex = 6;
button1.Text = "Aceptar";
button1.UseVisualStyleBackColor = true;
button1.Click += button1_Click;
//
// CategoriaCreate
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(517, 235);
Controls.Add(button1);
Controls.Add(textBox1);
Controls.Add(numericUpDown1);
Controls.Add(label2);
Controls.Add(label1);
Controls.Add(button2);
Name = "CategoriaCreate";
Text = "Form1";
((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Button button2;
private Label label1;
private Label label2;
private NumericUpDown numericUpDown1;
private TextBox textBox1;
private Button button1;
}
}

92
Vista/CategoriaCreate.cs Normal file
View File

@@ -0,0 +1,92 @@
using Controladora;
using Entidades;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Vista
{
public partial class CategoriaCreate : Form
{
private Categoria? categoria;
public CategoriaCreate()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void CargarDatos()
{
if (categoria != null)
{
textBox1.Text = categoria.Descripcion;
numericUpDown1.Value = categoria.Id;
}
}
private bool ValidarDatos()
{
string devolucion = "";
if (string.IsNullOrEmpty(textBox1.Text))
devolucion += "La descripción no puede ser nula o vacía\n";
else if (textBox1.Text.Length > 100) // Ajusta el límite según sea necesario
devolucion += "La descripción no puede superar los 100 caracteres\n";
// Validar unicidad del ID solo si es una nueva categoría
if (categoria == null && ControladoraCategorias.Instance.Listar().Any(c => c.Id == (int)numericUpDown1.Value))
{
devolucion += "Ya existe una categoría con el mismo ID\n";
}
if (devolucion == "")
{
return true;
}
else
{
MessageBox.Show(devolucion);
return false;
}
}
private void button1_Click(object sender, EventArgs e)
{
string msg;
if (ValidarDatos())
{
if (categoria == null)
{
categoria = new Categoria
{
Id = (int)numericUpDown1.Value,
Descripcion = textBox1.Text
};
msg = ControladoraCategorias.Instance.Añadir(categoria);
}
else
{
categoria.Descripcion = textBox1.Text;
categoria.Id = (int)numericUpDown1.Value; // Solo si quieres permitir modificaciones del ID
msg = ControladoraCategorias.Instance.Modificar(categoria);
}
MessageBox.Show(msg, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
Close();
}
}
}
}

View File

@@ -1,17 +1,17 @@
<?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
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>
@@ -26,36 +26,36 @@
<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
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
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
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
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
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
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
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->

View File

@@ -1,39 +0,0 @@
namespace Vista
{
partial class Form1
{
/// <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.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
}
}

View File

@@ -1,10 +0,0 @@
namespace Vista
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}

194
Vista/FrmCliente.Designer.cs generated Normal file
View File

@@ -0,0 +1,194 @@

namespace Vista
{
partial class FrmCliente
{
/// <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()
{
label1 = new Label();
label2 = new Label();
label3 = new Label();
label4 = new Label();
label5 = new Label();
txtNombre = new TextBox();
txtApellido = new TextBox();
txtDireccion = new TextBox();
txtCorreo = new TextBox();
BtnAceptar = new Button();
BtnCancelar = new Button();
numCuit = new NumericUpDown();
((System.ComponentModel.ISupportInitialize)numCuit).BeginInit();
SuspendLayout();
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(29, 29);
label1.Name = "label1";
label1.Size = new Size(29, 15);
label1.TabIndex = 0;
label1.Text = "Cuit";
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(29, 59);
label2.Name = "label2";
label2.Size = new Size(51, 15);
label2.TabIndex = 1;
label2.Text = "Nombre";
//
// label3
//
label3.AutoSize = true;
label3.Location = new Point(29, 88);
label3.Name = "label3";
label3.Size = new Size(51, 15);
label3.TabIndex = 2;
label3.Text = "Apellido";
//
// label4
//
label4.AutoSize = true;
label4.Location = new Point(29, 117);
label4.Name = "label4";
label4.Size = new Size(57, 15);
label4.TabIndex = 3;
label4.Text = "Direccion";
//
// label5
//
label5.AutoSize = true;
label5.Location = new Point(29, 146);
label5.Name = "label5";
label5.Size = new Size(43, 15);
label5.TabIndex = 4;
label5.Text = "Correo";
//
// txtNombre
//
txtNombre.Location = new Point(92, 51);
txtNombre.Name = "txtNombre";
txtNombre.Size = new Size(173, 23);
txtNombre.TabIndex = 6;
//
// txtApellido
//
txtApellido.Location = new Point(91, 80);
txtApellido.Name = "txtApellido";
txtApellido.Size = new Size(174, 23);
txtApellido.TabIndex = 7;
//
// txtDireccion
//
txtDireccion.Location = new Point(92, 109);
txtDireccion.Name = "txtDireccion";
txtDireccion.Size = new Size(173, 23);
txtDireccion.TabIndex = 8;
//
// txtCorreo
//
txtCorreo.Location = new Point(91, 138);
txtCorreo.Name = "txtCorreo";
txtCorreo.Size = new Size(174, 23);
txtCorreo.TabIndex = 9;
//
// BtnAceptar
//
BtnAceptar.Location = new Point(29, 190);
BtnAceptar.Name = "BtnAceptar";
BtnAceptar.Size = new Size(75, 23);
BtnAceptar.TabIndex = 10;
BtnAceptar.Text = "Aceptar";
BtnAceptar.UseVisualStyleBackColor = true;
BtnAceptar.Click += BtnAceptar_Click;
//
// BtnCancelar
//
BtnCancelar.Location = new Point(158, 190);
BtnCancelar.Name = "BtnCancelar";
BtnCancelar.Size = new Size(75, 23);
BtnCancelar.TabIndex = 11;
BtnCancelar.Text = "Cancelar";
BtnCancelar.UseVisualStyleBackColor = true;
BtnCancelar.Click += BtnCancelar_Click;
//
// numCuit
//
numCuit.Location = new Point(92, 22);
numCuit.Maximum = new decimal(new int[] { 1215752191, 23, 0, 0 });
numCuit.Name = "numCuit";
numCuit.Size = new Size(173, 23);
numCuit.TabIndex = 12;
numCuit.ValueChanged += numCuit_ValueChanged;
//
// FrmCliente
//
AcceptButton = BtnAceptar;
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
CancelButton = BtnCancelar;
ClientSize = new Size(420, 245);
ControlBox = false;
Controls.Add(numCuit);
Controls.Add(BtnCancelar);
Controls.Add(BtnAceptar);
Controls.Add(txtCorreo);
Controls.Add(txtDireccion);
Controls.Add(txtApellido);
Controls.Add(txtNombre);
Controls.Add(label5);
Controls.Add(label4);
Controls.Add(label3);
Controls.Add(label2);
Controls.Add(label1);
Name = "FrmCliente";
Text = "Form1";
((System.ComponentModel.ISupportInitialize)numCuit).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label label1;
private Label label2;
private Label label3;
private Label label4;
private Label label5;
private TextBox txtNombre;
private TextBox txtApellido;
private TextBox txtDireccion;
private TextBox txtCorreo;
private Button BtnAceptar;
private Button BtnCancelar;
private NumericUpDown numCuit;
public EventHandler button1_Click_1 { get; private set; }
}
}

114
Vista/FrmCliente.cs Normal file
View File

@@ -0,0 +1,114 @@
using Entidades;
using Controladora;
namespace Vista
{
public partial class FrmCliente : Form
{
Cliente cliente;
public FrmCliente(Cliente? cliente = null)
{
InitializeComponent();
if (cliente != null)
{
this.cliente = cliente;
this.Text = "Modificar Proveedor";
CargarDatos();
}
else
{
this.Text = "Agregar Proveedor";
}
}
private void CargarDatos()
{
txtNombre.Text = cliente.Nombre;
txtApellido.Text = cliente.Apellido;
txtDireccion.Text = cliente.Direccion;
txtCorreo.Text = cliente.Correo;
numCuit.Value = cliente.Cuit;
numCuit.ReadOnly = true;
}
private bool ValidarDatos()
{
string devolucion = "";
/*
* complicado de leer pero en estas lineas estan todas las comprobaciones
* que pude pensar en el momento.
*/
if (string.IsNullOrEmpty(txtDireccion.Text)) devolucion += "La direccion no deberia ser nulo o vacio\n";
if (txtDireccion.Text.Length > 200) devolucion += "La direccion no puede superar los 200 chars\n";
if (string.IsNullOrEmpty(txtNombre.Text)) devolucion += "el nombre no puede ser nulo o vacio\n";
if (txtNombre.Text.Length > 50) devolucion += "El nombre no puede superar los 50 chars\n";
if (string.IsNullOrEmpty(txtApellido.Text)) devolucion += "El Apellido no puede ser nulo o vacio\n";
if (string.IsNullOrEmpty(txtCorreo.Text)) devolucion += "El Correo no puede ser nulo o vacio\n";
else if (!txtCorreo.Text.Contains("@"))
{
devolucion += "El correo debe contener '@'\n";
}
if (devolucion == "")
{
return true;
}
else
{
MessageBox.Show(devolucion);
return false;
}
}
private void BtnCancelar_Click(object sender, EventArgs e)
{
this.Close();
}
private void BtnAceptar_Click(object sender, EventArgs e)
{
string msg;
if (ValidarDatos())
{
if (cliente == null)
{
cliente = new Cliente
{
Nombre = txtNombre.Text,
Cuit = long.Parse(numCuit.Value.ToString()),
Direccion = txtDireccion.Text,
Apellido = txtApellido.Text,
Correo = txtCorreo.Text,
};
msg = ControladoraClientes.Instance.Añadir(cliente);
}
else
{
cliente.Apellido = txtApellido.Text;
cliente.Nombre = txtNombre.Text;
cliente.Direccion = txtDireccion.Text;
cliente.Correo = txtCorreo.Text;
cliente.Cuit = long.Parse(numCuit.Text.ToString());
msg = ControladoraClientes.Instance.Modificar(cliente);
}
MessageBox.Show(msg, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
Close();
}
}
private void numCuit_ValueChanged(object sender, EventArgs e)
{
}
}
}

120
Vista/FrmCliente.resx Normal file
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>

118
Vista/FrmClientes.Designer.cs generated Normal file
View File

@@ -0,0 +1,118 @@
namespace Vista
{
partial class FrmClientes
{
/// <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()
{
BtnModificar = new Button();
BtnEliminar = new Button();
groupBox1 = new GroupBox();
BtnAceptar = new Button();
dataGridView1 = new DataGridView();
groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
SuspendLayout();
//
// BtnModificar
//
BtnModificar.Location = new Point(108, 302);
BtnModificar.Name = "BtnModificar";
BtnModificar.Size = new Size(75, 23);
BtnModificar.TabIndex = 1;
BtnModificar.Text = "Modificar";
BtnModificar.UseVisualStyleBackColor = true;
BtnModificar.Click += BtnModificar_Click;
//
// BtnEliminar
//
BtnEliminar.Location = new Point(215, 302);
BtnEliminar.Name = "BtnEliminar";
BtnEliminar.Size = new Size(75, 23);
BtnEliminar.TabIndex = 2;
BtnEliminar.Text = "Eliminar";
BtnEliminar.UseVisualStyleBackColor = true;
BtnEliminar.Click += BtnEliminar_Click;
//
// groupBox1
//
groupBox1.Controls.Add(BtnAceptar);
groupBox1.Controls.Add(dataGridView1);
groupBox1.Controls.Add(BtnEliminar);
groupBox1.Controls.Add(BtnModificar);
groupBox1.Location = new Point(12, 2);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(776, 351);
groupBox1.TabIndex = 3;
groupBox1.TabStop = false;
//
// BtnAceptar
//
BtnAceptar.Location = new Point(6, 302);
BtnAceptar.Name = "BtnAceptar";
BtnAceptar.Size = new Size(75, 23);
BtnAceptar.TabIndex = 4;
BtnAceptar.Text = "Añadir";
BtnAceptar.UseVisualStyleBackColor = true;
BtnAceptar.Click += BtnAceptar_Click;
//
// dataGridView1
//
dataGridView1.AllowUserToAddRows = false;
dataGridView1.AllowUserToDeleteRows = false;
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Location = new Point(6, 22);
dataGridView1.MultiSelect = false;
dataGridView1.Name = "dataGridView1";
dataGridView1.ReadOnly = true;
dataGridView1.RowTemplate.Height = 25;
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView1.Size = new Size(737, 235);
dataGridView1.TabIndex = 3;
//
// FrmClientes
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(groupBox1);
Name = "FrmClientes";
Text = "Clientes";
WindowState = FormWindowState.Maximized;
groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
ResumeLayout(false);
}
#endregion
private Button BtnModificar;
private Button BtnEliminar;
private GroupBox groupBox1;
private DataGridView dataGridView1;
private Button BtnAceptar;
}
}

68
Vista/FrmClientes.cs Normal file
View File

@@ -0,0 +1,68 @@
using Entidades;
using Controladora;
namespace Vista
{
public partial class FrmClientes : Form
{
Cliente cliente;
public FrmClientes()
{
InitializeComponent();
ActualizarGrilla();
}
private void ActualizarGrilla()
{
dataGridView1.DataSource = null;
dataGridView1.DataSource = ControladoraClientes.Instance.Listar();
}
private void BtnAceptar_Click(object sender, EventArgs e)
{
var form = new FrmCliente();
form.ShowDialog();
ActualizarGrilla();
}
private void BtnModificar_Click(object sender, EventArgs e)
{
if (dataGridView1.SelectedRows.Count < 1)
{
MessageBox.Show("Seleccione una linea para modificar");
return;
}
Cliente cliente = new Cliente()
{
Nombre = dataGridView1.SelectedRows[0].Cells["Nombre"].Value.ToString(),
Cuit = (Int64)dataGridView1.SelectedRows[0].Cells["Cuit"].Value,
Apellido = dataGridView1.SelectedRows[0].Cells["Apellido"].Value.ToString(),
Direccion = dataGridView1.SelectedRows[0].Cells["Direccion"].Value.ToString(),
Correo = dataGridView1.SelectedRows[0].Cells["Correo"].Value.ToString(),
};
var formModificar = new FrmCliente(cliente);
formModificar.ShowDialog();
ActualizarGrilla();
}
private void BtnEliminar_Click(object sender, EventArgs e)
{
if (dataGridView1.SelectedRows.Count < 0)
{
MessageBox.Show("Seleccione una linea para eliminar");
return;
}
foreach (DataGridViewRow Fila in dataGridView1.SelectedRows)
{ // itera por un loop y elimina las lineas seleccionadas 1 a la vez.
string devolucion = ControladoraClientes.Instance.Eliminar(long.Parse(Fila.Cells["Cuit"].Value.ToString()));
MessageBox.Show(devolucion);
ActualizarGrilla();
}
}
}
}

120
Vista/FrmClientes.resx Normal file
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>

169
Vista/FrmFactura.Designer.cs generated Normal file
View File

@@ -0,0 +1,169 @@
namespace Vista
{
partial class FrmFactura
{
/// <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()
{
button1 = new Button();
button2 = new Button();
numericUpDown1 = new NumericUpDown();
label1 = new Label();
numericUpDown2 = new NumericUpDown();
label2 = new Label();
dateTimePicker1 = new DateTimePicker();
label3 = new Label();
label4 = new Label();
comboBox1 = new ComboBox();
((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDown2).BeginInit();
SuspendLayout();
//
// button1
//
button1.Location = new Point(12, 213);
button1.Name = "button1";
button1.Size = new Size(75, 23);
button1.TabIndex = 0;
button1.Text = "Aceptar";
button1.UseVisualStyleBackColor = true;
button1.Click += button1_Click;
//
// button2
//
button2.Location = new Point(123, 213);
button2.Name = "button2";
button2.Size = new Size(75, 23);
button2.TabIndex = 1;
button2.Text = "Cancelar";
button2.UseVisualStyleBackColor = true;
button2.Click += button2_Click;
//
// numericUpDown1
//
numericUpDown1.Location = new Point(97, 26);
numericUpDown1.Maximum = new decimal(new int[] { 1215752191, 23, 0, 0 });
numericUpDown1.Name = "numericUpDown1";
numericUpDown1.Size = new Size(120, 23);
numericUpDown1.TabIndex = 2;
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(69, 34);
label1.Name = "label1";
label1.Size = new Size(18, 15);
label1.TabIndex = 3;
label1.Text = "ID";
//
// numericUpDown2
//
numericUpDown2.Location = new Point(97, 57);
numericUpDown2.Maximum = new decimal(new int[] { 1215752191, 23, 0, 0 });
numericUpDown2.Name = "numericUpDown2";
numericUpDown2.Size = new Size(120, 23);
numericUpDown2.TabIndex = 4;
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(59, 65);
label2.Name = "label2";
label2.Size = new Size(32, 15);
label2.TabIndex = 5;
label2.Text = "Total";
//
// dateTimePicker1
//
dateTimePicker1.Location = new Point(97, 88);
dateTimePicker1.Name = "dateTimePicker1";
dateTimePicker1.Size = new Size(120, 23);
dateTimePicker1.TabIndex = 6;
//
// label3
//
label3.AutoSize = true;
label3.Location = new Point(49, 94);
label3.Name = "label3";
label3.Size = new Size(38, 15);
label3.TabIndex = 7;
label3.Text = "Fecha";
//
// label4
//
label4.AutoSize = true;
label4.Location = new Point(49, 124);
label4.Name = "label4";
label4.Size = new Size(44, 15);
label4.TabIndex = 8;
label4.Text = "Cliente";
//
// comboBox1
//
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox1.FormattingEnabled = true;
comboBox1.Location = new Point(99, 121);
comboBox1.Name = "comboBox1";
comboBox1.Size = new Size(121, 23);
comboBox1.TabIndex = 10;
//
// FrmFactura
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(458, 265);
Controls.Add(comboBox1);
Controls.Add(label4);
Controls.Add(label3);
Controls.Add(dateTimePicker1);
Controls.Add(label2);
Controls.Add(numericUpDown2);
Controls.Add(label1);
Controls.Add(numericUpDown1);
Controls.Add(button2);
Controls.Add(button1);
Name = "FrmFactura";
Text = "Form1";
((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDown2).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Button button1;
private Button button2;
private NumericUpDown numericUpDown1;
private Label label1;
private NumericUpDown numericUpDown2;
private Label label2;
private DateTimePicker dateTimePicker1;
private Label label3;
private Label label4;
private ComboBox comboBox1;
}
}

151
Vista/FrmFactura.cs Normal file
View File

@@ -0,0 +1,151 @@
using Controladora;
using Entidades;
using Modelo;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Vista
{
public partial class FrmFactura : Form
{
private Cliente clienteSeleccionado;
Factura factura;
public FrmFactura(Factura? factura = null)
{
InitializeComponent();
CargarClientes();
comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged;
// Para el primer control NumericUpDown
numericUpDown1.Maximum = int.MaxValue; // Esto permitirá IDs muy grandes
// Para el segundo control NumericUpDown
numericUpDown2.Maximum = decimal.MaxValue; // Esto permitirá totales muy grandes
if (factura != null)
{
this.factura = factura;
this.Text = "Modificar Factura";
CargarDatos();
}
else
{
this.Text = "Agregar Factura";
}
}
private void CargarClientes()
{
// Obtener la lista de clientes desde el repositorio
ReadOnlyCollection<Cliente> clientes = RepositorioClientes.Instance.Listar();
// Asignar la lista de clientes como origen de datos para el ComboBox
comboBox1.DataSource = clientes;
// Establecer la propiedad para mostrar el nombre del cliente en el ComboBox
comboBox1.DisplayMember = "NombreCompleto";
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
clienteSeleccionado = (Cliente)comboBox1.SelectedItem;
}
private void CargarDatos()
{
numericUpDown1.Value = factura.Id;
numericUpDown2.Value = (decimal)factura.Total;
dateTimePicker1.Value = factura.Fecha;
// Asignar el cliente seleccionado en el ComboBox
if (factura.Cliente != null)
{
comboBox1.SelectedItem = factura.Cliente;
}
}
private bool ValidarDatos()
{
string devolucion = "";
if (string.IsNullOrEmpty(numericUpDown1.Text)) devolucion += "El ID no puede ser nulo o vacío\n";
if (numericUpDown2.Value <= 0) devolucion += "El total debe ser mayor que cero\n";
if (clienteSeleccionado == null) devolucion += "Debe seleccionar un cliente\n";
if (devolucion == "")
{
return true;
}
else
{
MessageBox.Show(devolucion, "Errores de Validación", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return false;
}
}
private void button1_Click(object sender, EventArgs e)
{
if (ValidarDatos())
{
try
{
if (factura == null)
{
// Crear una nueva factura con los datos proporcionados
factura = new Factura
{
Id = (int)numericUpDown1.Value,
Total = (double)numericUpDown2.Value,
Fecha = dateTimePicker1.Value,
Cliente = (Cliente)comboBox1.SelectedItem,
};
// Agregar la factura a la colección
ControladoraFacturas.Instance.Añadir(factura);
}
else
{
// Actualizar los datos de la factura existente
factura.Id = (int)numericUpDown1.Value;
factura.Total = (double)numericUpDown2.Value;
factura.Fecha = dateTimePicker1.Value;
factura.Cliente = (Cliente)comboBox1.SelectedItem;
// Modificar la factura en la colección
ControladoraFacturas.Instance.Modificar(factura);
}
MessageBox.Show("Operación realizada con éxito", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
Close();
}
catch (InvalidOperationException ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (Exception ex)
{
// Captura cualquier otra excepción que pueda ocurrir
MessageBox.Show("Ocurrió un error inesperado: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
}
}

120
Vista/FrmFactura.resx Normal file
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>

89
Vista/FrmFacturas.Designer.cs generated Normal file
View File

@@ -0,0 +1,89 @@
namespace Vista
{
partial class FrmFacturas
{
/// <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()
{
groupBox1 = new GroupBox();
dataGridView1 = new DataGridView();
BtnAdd = new Button();
groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
SuspendLayout();
//
// groupBox1
//
groupBox1.Controls.Add(dataGridView1);
groupBox1.Controls.Add(BtnAdd);
groupBox1.Location = new Point(12, 12);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(776, 351);
groupBox1.TabIndex = 5;
groupBox1.TabStop = false;
//
// dataGridView1
//
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Location = new Point(6, 22);
dataGridView1.Name = "dataGridView1";
dataGridView1.RowTemplate.Height = 25;
dataGridView1.Size = new Size(594, 235);
dataGridView1.TabIndex = 3;
dataGridView1.CellBorderStyleChanged += dataGridView1_CellBorderStyleChanged;
//
// BtnAdd
//
BtnAdd.Location = new Point(6, 299);
BtnAdd.Name = "BtnAdd";
BtnAdd.Size = new Size(75, 23);
BtnAdd.TabIndex = 0;
BtnAdd.Text = "Añadir";
BtnAdd.UseVisualStyleBackColor = true;
BtnAdd.Click += BtnAdd_Click;
//
// FrmFacturas
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(groupBox1);
Name = "FrmFacturas";
Text = "Ventas";
WindowState = FormWindowState.Maximized;
groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
ResumeLayout(false);
}
#endregion
private GroupBox groupBox1;
private DataGridView dataGridView1;
private Button BtnAdd;
}
}

30
Vista/FrmFacturas.cs Normal file
View File

@@ -0,0 +1,30 @@
using Controladora;
namespace Vista
{
public partial class FrmFacturas : Form
{
public FrmFacturas()
{
InitializeComponent();
ActualizarGrilla();
}
private void ActualizarGrilla()
{
dataGridView1.DataSource = null;
dataGridView1.DataSource = ControladoraFacturas.Instance.Listar();
}
private void BtnAdd_Click(object sender, EventArgs e)
{
var form = new FrmFactura();
form.ShowDialog();
ActualizarGrilla();
}
private void dataGridView1_CellBorderStyleChanged(object sender, EventArgs e)
{
}
}
}

120
Vista/FrmFacturas.resx Normal file
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>

100
Vista/FrmOrdenDeCompra.Designer.cs generated Normal file
View File

@@ -0,0 +1,100 @@
namespace Vista
{
partial class FrmOrdenDeCompra
{
/// <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()
{
groupBox1 = new GroupBox();
dataGridView1 = new DataGridView();
BtnAdd = new Button();
BtnEliminar = new Button();
groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
SuspendLayout();
//
// groupBox1
//
groupBox1.Controls.Add(dataGridView1);
groupBox1.Controls.Add(BtnAdd);
groupBox1.Controls.Add(BtnEliminar);
groupBox1.Location = new Point(12, 3);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(776, 351);
groupBox1.TabIndex = 4;
groupBox1.TabStop = false;
//
// dataGridView1
//
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Location = new Point(6, 22);
dataGridView1.Name = "dataGridView1";
dataGridView1.RowTemplate.Height = 25;
dataGridView1.Size = new Size(550, 235);
dataGridView1.TabIndex = 3;
//
// BtnAdd
//
BtnAdd.Location = new Point(6, 302);
BtnAdd.Name = "BtnAdd";
BtnAdd.Size = new Size(75, 23);
BtnAdd.TabIndex = 0;
BtnAdd.Text = "Añadir";
BtnAdd.UseVisualStyleBackColor = true;
BtnAdd.Click += BtnAdd_Click;
//
// BtnEliminar
//
BtnEliminar.Location = new Point(215, 302);
BtnEliminar.Name = "BtnEliminar";
BtnEliminar.Size = new Size(75, 23);
BtnEliminar.TabIndex = 2;
BtnEliminar.Text = "Eliminar";
BtnEliminar.UseVisualStyleBackColor = true;
//
// FrmOrdenDeCompra
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(groupBox1);
Name = "FrmOrdenDeCompra";
Text = "OrdenDeCompra";
WindowState = FormWindowState.Maximized;
groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
ResumeLayout(false);
}
#endregion
private GroupBox groupBox1;
private DataGridView dataGridView1;
private Button BtnAdd;
private Button BtnEliminar;
}
}

25
Vista/FrmOrdenDeCompra.cs Normal file
View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Vista
{
public partial class FrmOrdenDeCompra : Form
{
public FrmOrdenDeCompra()
{
InitializeComponent();
}
private void BtnAdd_Click(object sender, EventArgs e)
{
}
}
}

120
Vista/FrmOrdenDeCompra.resx Normal file
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>

115
Vista/FrmPedidosDePresupuestos.Designer.cs generated Normal file
View File

@@ -0,0 +1,115 @@
namespace Vista
{
partial class FrmPedidosDePresupuestos
{
/// <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()
{
groupBox1 = new GroupBox();
dataGridView1 = new DataGridView();
BtnAdd = new Button();
BtnEliminar = new Button();
dataGridView2 = new DataGridView();
groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
((System.ComponentModel.ISupportInitialize)dataGridView2).BeginInit();
SuspendLayout();
//
// groupBox1
//
groupBox1.Controls.Add(dataGridView2);
groupBox1.Controls.Add(dataGridView1);
groupBox1.Controls.Add(BtnAdd);
groupBox1.Controls.Add(BtnEliminar);
groupBox1.Location = new Point(12, 2);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(946, 377);
groupBox1.TabIndex = 4;
groupBox1.TabStop = false;
//
// dataGridView1
//
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Location = new Point(6, 22);
dataGridView1.Name = "dataGridView1";
dataGridView1.RowTemplate.Height = 25;
dataGridView1.Size = new Size(284, 235);
dataGridView1.TabIndex = 3;
//
// BtnAdd
//
BtnAdd.Location = new Point(6, 302);
BtnAdd.Name = "BtnAdd";
BtnAdd.Size = new Size(75, 23);
BtnAdd.TabIndex = 0;
BtnAdd.Text = "Añadir";
BtnAdd.UseVisualStyleBackColor = true;
BtnAdd.Click += BtnAdd_Click;
//
// BtnEliminar
//
BtnEliminar.Location = new Point(215, 302);
BtnEliminar.Name = "BtnEliminar";
BtnEliminar.Size = new Size(75, 23);
BtnEliminar.TabIndex = 2;
BtnEliminar.Text = "Eliminar";
BtnEliminar.UseVisualStyleBackColor = true;
//
// dataGridView2
//
dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView2.Location = new Point(355, 22);
dataGridView2.Name = "dataGridView2";
dataGridView2.RowTemplate.Height = 25;
dataGridView2.Size = new Size(585, 281);
dataGridView2.TabIndex = 4;
//
// FrmPedidosDePresupuestos
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(970, 450);
Controls.Add(groupBox1);
Name = "FrmPedidosDePresupuestos";
Text = "PedidosDePresupuestos";
WindowState = FormWindowState.Maximized;
groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
((System.ComponentModel.ISupportInitialize)dataGridView2).EndInit();
ResumeLayout(false);
}
#endregion
private GroupBox groupBox1;
private DataGridView dataGridView1;
private Button BtnAdd;
private Button BtnEliminar;
private DataGridView dataGridView2;
}
}

View File

@@ -0,0 +1,32 @@
using Controladora;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Vista
{
public partial class FrmPedidosDePresupuestos : Form
{
public FrmPedidosDePresupuestos()
{
InitializeComponent();
}
private void ActualizarGrilla()
{
dataGridView1.DataSource = null;
dataGridView1.DataSource = ControladoraPedidoDePresupuestos.Instance.Listar();
}
private void BtnAdd_Click(object sender, EventArgs e)
{
var form = new FrmPresupuesto();
form.ShowDialog();
ActualizarGrilla();
}
}
}

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>

181
Vista/FrmPresupuesto.Designer.cs generated Normal file
View File

@@ -0,0 +1,181 @@
namespace Vista
{
partial class FrmPresupuesto
{
/// <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()
{
dataGridView2 = new DataGridView();
ID = new Label();
label2 = new Label();
label3 = new Label();
dateTimePicker1 = new DateTimePicker();
comboBox1 = new ComboBox();
numericUpDown1 = new NumericUpDown();
button1 = new Button();
button2 = new Button();
button3 = new Button();
button4 = new Button();
((System.ComponentModel.ISupportInitialize)dataGridView2).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
//
// dataGridView2
//
dataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView2.Location = new Point(407, 12);
dataGridView2.Name = "dataGridView2";
dataGridView2.RowTemplate.Height = 25;
dataGridView2.Size = new Size(475, 413);
dataGridView2.TabIndex = 1;
//
// ID
//
ID.AutoSize = true;
ID.Location = new Point(34, 197);
ID.Name = "ID";
ID.Size = new Size(18, 15);
ID.TabIndex = 2;
ID.Text = "ID";
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(34, 234);
label2.Name = "label2";
label2.Size = new Size(55, 15);
label2.TabIndex = 3;
label2.Text = "Provedor";
//
// label3
//
label3.AutoSize = true;
label3.Location = new Point(34, 270);
label3.Name = "label3";
label3.Size = new Size(38, 15);
label3.TabIndex = 4;
label3.Text = "Fecha";
//
// dateTimePicker1
//
dateTimePicker1.Location = new Point(100, 264);
dateTimePicker1.Name = "dateTimePicker1";
dateTimePicker1.Size = new Size(121, 23);
dateTimePicker1.TabIndex = 6;
//
// comboBox1
//
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox1.FormattingEnabled = true;
comboBox1.Location = new Point(100, 226);
comboBox1.Name = "comboBox1";
comboBox1.Size = new Size(121, 23);
comboBox1.TabIndex = 7;
//
// numericUpDown1
//
numericUpDown1.Location = new Point(101, 197);
numericUpDown1.Maximum = new decimal(new int[] { 1410065407, 2, 0, 0 });
numericUpDown1.Name = "numericUpDown1";
numericUpDown1.Size = new Size(120, 23);
numericUpDown1.TabIndex = 8;
//
// button1
//
button1.Location = new Point(34, 383);
button1.Name = "button1";
button1.Size = new Size(154, 42);
button1.TabIndex = 9;
button1.Text = "Guardar";
button1.UseVisualStyleBackColor = true;
//
// button2
//
button2.Location = new Point(247, 383);
button2.Name = "button2";
button2.Size = new Size(154, 42);
button2.TabIndex = 10;
button2.Text = "Cancelar";
button2.UseVisualStyleBackColor = true;
//
// button3
//
button3.Location = new Point(34, 42);
button3.Name = "button3";
button3.Size = new Size(128, 47);
button3.TabIndex = 11;
button3.Text = "Agregar Producto";
button3.UseVisualStyleBackColor = true;
//
// button4
//
button4.Location = new Point(34, 106);
button4.Name = "button4";
button4.Size = new Size(128, 47);
button4.TabIndex = 12;
button4.Text = "Eliminar Producto";
button4.UseVisualStyleBackColor = true;
//
// FrmPresupuesto
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(925, 446);
Controls.Add(button4);
Controls.Add(button3);
Controls.Add(button2);
Controls.Add(button1);
Controls.Add(numericUpDown1);
Controls.Add(comboBox1);
Controls.Add(dateTimePicker1);
Controls.Add(label3);
Controls.Add(label2);
Controls.Add(ID);
Controls.Add(dataGridView2);
Name = "FrmPresupuesto";
Text = "Form1";
((System.ComponentModel.ISupportInitialize)dataGridView2).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private DataGridView dataGridView2;
private Label ID;
private Label label2;
private Label label3;
private DateTimePicker dateTimePicker1;
private ComboBox comboBox1;
private NumericUpDown numericUpDown1;
private Button button1;
private Button button2;
private Button button3;
private Button button4;
}
}

37
Vista/FrmPresupuesto.cs Normal file
View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Vista
{
public partial class FrmPresupuesto : Form
{
public FrmPresupuesto()
{
InitializeComponent();
}
private void button3_Click(object sender, EventArgs e)
{
var form = new AddProducto();
form.ShowDialog();
}
private void button2_Click(object sender, EventArgs e)
{
Close();
}
private void button1_Click(object sender, EventArgs e)
{
//guardar
Close();
}
}
}

120
Vista/FrmPresupuesto.resx Normal file
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>

194
Vista/FrmProducto.Designer.cs generated Normal file
View File

@@ -0,0 +1,194 @@
namespace Vista
{
partial class FrmProducto
{
/// <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()
{
label1 = new Label();
label2 = new Label();
label3 = new Label();
label4 = new Label();
label5 = new Label();
numericUpDown1 = new NumericUpDown();
textBox1 = new TextBox();
numericUpDown2 = new NumericUpDown();
checkBox1 = new CheckBox();
comboBox1 = new ComboBox();
button1 = new Button();
button2 = new Button();
((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDown2).BeginInit();
SuspendLayout();
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(47, 44);
label1.Name = "label1";
label1.Size = new Size(18, 15);
label1.TabIndex = 0;
label1.Text = "ID";
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(14, 73);
label2.Name = "label2";
label2.Size = new Size(51, 15);
label2.TabIndex = 1;
label2.Text = "Nombre";
//
// label3
//
label3.AutoSize = true;
label3.Location = new Point(25, 105);
label3.Name = "label3";
label3.Size = new Size(40, 15);
label3.TabIndex = 2;
label3.Text = "Precio";
//
// label4
//
label4.AutoSize = true;
label4.Location = new Point(7, 136);
label4.Name = "label4";
label4.Size = new Size(62, 15);
label4.TabIndex = 3;
label4.Text = "Habilitado";
//
// label5
//
label5.AutoSize = true;
label5.Location = new Point(7, 167);
label5.Name = "label5";
label5.Size = new Size(58, 15);
label5.TabIndex = 4;
label5.Text = "Categoria";
//
// numericUpDown1
//
numericUpDown1.Location = new Point(71, 36);
numericUpDown1.Maximum = new decimal(new int[] { 1215752191, 23, 0, 0 });
numericUpDown1.Name = "numericUpDown1";
numericUpDown1.Size = new Size(120, 23);
numericUpDown1.TabIndex = 5;
//
// textBox1
//
textBox1.Location = new Point(71, 65);
textBox1.Name = "textBox1";
textBox1.Size = new Size(120, 23);
textBox1.TabIndex = 6;
//
// numericUpDown2
//
numericUpDown2.Location = new Point(71, 97);
numericUpDown2.Maximum = new decimal(new int[] { 100000000, 0, 0, 0 });
numericUpDown2.Name = "numericUpDown2";
numericUpDown2.Size = new Size(120, 23);
numericUpDown2.TabIndex = 7;
//
// checkBox1
//
checkBox1.AutoSize = true;
checkBox1.Location = new Point(71, 137);
checkBox1.Name = "checkBox1";
checkBox1.Size = new Size(15, 14);
checkBox1.TabIndex = 8;
checkBox1.UseVisualStyleBackColor = true;
//
// comboBox1
//
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox1.FormattingEnabled = true;
comboBox1.Location = new Point(70, 159);
comboBox1.Name = "comboBox1";
comboBox1.Size = new Size(121, 23);
comboBox1.TabIndex = 9;
comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged;
//
// button1
//
button1.Location = new Point(14, 239);
button1.Name = "button1";
button1.Size = new Size(92, 35);
button1.TabIndex = 10;
button1.Text = "Aceptar";
button1.UseVisualStyleBackColor = true;
button1.Click += button1_Click;
//
// button2
//
button2.Location = new Point(154, 239);
button2.Name = "button2";
button2.Size = new Size(92, 35);
button2.TabIndex = 11;
button2.Text = "Cancelar";
button2.UseVisualStyleBackColor = true;
button2.Click += button2_Click;
//
// FrmProducto
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(471, 313);
Controls.Add(button2);
Controls.Add(button1);
Controls.Add(comboBox1);
Controls.Add(checkBox1);
Controls.Add(numericUpDown2);
Controls.Add(textBox1);
Controls.Add(numericUpDown1);
Controls.Add(label5);
Controls.Add(label4);
Controls.Add(label3);
Controls.Add(label2);
Controls.Add(label1);
Name = "FrmProducto";
Text = "Producto";
((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDown2).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label label1;
private Label label2;
private Label label3;
private Label label4;
private Label label5;
private NumericUpDown numericUpDown1;
private TextBox textBox1;
private NumericUpDown numericUpDown2;
private CheckBox checkBox1;
private ComboBox comboBox1;
private Button button1;
private Button button2;
}
}

113
Vista/FrmProducto.cs Normal file
View File

@@ -0,0 +1,113 @@
using Controladora;
using Entidades;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace Vista
{
public partial class FrmProducto : Form
{
public FrmProducto()
{
InitializeComponent();
CargarCategorias();
}
private void CargarCategorias()
{
// Obtener la lista de categorías desde la controladora
var categorias = ControladoraCategorias.Instance.Listar();
// Configurar el ComboBox para categorías
comboBox1.DisplayMember = "Descripcion"; // Mostrar la propiedad Descripcion
comboBox1.ValueMember = "Id"; // Usar la propiedad Id como valor
// Asignar la lista de categorías al ComboBox
comboBox1.DataSource = categorias;
}
private bool ValidarDatos()
{
string devolucion = "";
// Validar Nombre
if (string.IsNullOrEmpty(textBox1.Text))
{
devolucion += "El nombre del producto no puede estar vacío.\n";
}
else if (textBox1.Text.Length > 100) // Limite de caracteres
{
devolucion += "El nombre del producto no puede superar los 100 caracteres.\n";
}
// Validar Precio
if (numericUpDown2.Value <= 0)
{
devolucion += "El precio debe ser mayor a cero.\n";
}
// Validar ID (Si es necesario)
if (ControladoraProductos.Instance.Listar().Any(p => p.Id == (int)numericUpDown1.Value))
{
devolucion += "Ya existe un producto con el mismo ID.\n";
}
// Validar Categoría Seleccionada
if (comboBox1.SelectedItem == null)
{
devolucion += "Debe seleccionar una categoría.\n";
}
if (devolucion == "")
{
return true;
}
else
{
MessageBox.Show(devolucion, "Errores de Validación", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
}
private void button1_Click(object sender, EventArgs e)
{
if (ValidarDatos())
{
// Crear nuevo producto
var nuevoProducto = new Producto
{
Id = (int)numericUpDown1.Value,
Nombre = textBox1.Text,
Precio = (double)numericUpDown2.Value,
Habilitado = checkBox1.Checked,
Categoria = (Categoria)comboBox1.SelectedItem, // Asignar categoría seleccionada
};
// Agregar el producto usando la controladora
string mensaje = ControladoraProductos.Instance.Añadir(nuevoProducto);
MessageBox.Show(mensaje, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
Close();
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
// Puedes usar este método para manejar cambios en el ComboBox si es necesario
// No es necesario mantener una variable separada para la categoría seleccionada
}
}
}

120
Vista/FrmProducto.resx Normal file
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>

156
Vista/FrmProductos.Designer.cs generated Normal file
View File

@@ -0,0 +1,156 @@
namespace Vista
{
partial class FrmProductos
{
/// <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()
{
groupBox1 = new GroupBox();
button1 = new Button();
dataGridView1 = new DataGridView();
BtnAdd = new Button();
BtnEliminar = new Button();
dataGridView2 = new DataGridView();
label1 = new Label();
label2 = new Label();
groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
((System.ComponentModel.ISupportInitialize)dataGridView2).BeginInit();
SuspendLayout();
//
// groupBox1
//
groupBox1.Controls.Add(label2);
groupBox1.Controls.Add(dataGridView1);
groupBox1.Controls.Add(BtnAdd);
groupBox1.Controls.Add(BtnEliminar);
groupBox1.Location = new Point(12, 0);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(776, 351);
groupBox1.TabIndex = 5;
groupBox1.TabStop = false;
//
// button1
//
button1.Location = new Point(794, 302);
button1.Name = "button1";
button1.Size = new Size(128, 23);
button1.TabIndex = 4;
button1.Text = "Crear Categoria";
button1.UseVisualStyleBackColor = true;
button1.Click += button1_Click;
//
// dataGridView1
//
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Location = new Point(6, 22);
dataGridView1.Name = "dataGridView1";
dataGridView1.RowTemplate.Height = 25;
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView1.Size = new Size(690, 235);
dataGridView1.TabIndex = 3;
//
// BtnAdd
//
BtnAdd.Location = new Point(6, 302);
BtnAdd.Name = "BtnAdd";
BtnAdd.Size = new Size(75, 23);
BtnAdd.TabIndex = 0;
BtnAdd.Text = "Añadir";
BtnAdd.UseVisualStyleBackColor = true;
BtnAdd.Click += BtnAdd_Click;
//
// BtnEliminar
//
BtnEliminar.Location = new Point(137, 302);
BtnEliminar.Name = "BtnEliminar";
BtnEliminar.Size = new Size(75, 23);
BtnEliminar.TabIndex = 2;
BtnEliminar.Text = "Eliminar";
BtnEliminar.UseVisualStyleBackColor = true;
BtnEliminar.Click += BtnEliminar_Click;
//
// dataGridView2
//
dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView2.Location = new Point(794, 22);
dataGridView2.Name = "dataGridView2";
dataGridView2.RowTemplate.Height = 25;
dataGridView2.Size = new Size(250, 235);
dataGridView2.TabIndex = 6;
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(797, 4);
label1.Name = "label1";
label1.Size = new Size(63, 15);
label1.TabIndex = 7;
label1.Text = "Categorias";
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(6, 4);
label2.Name = "label2";
label2.Size = new Size(61, 15);
label2.TabIndex = 8;
label2.Text = "Productos";
//
// FrmProductos
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1071, 450);
Controls.Add(label1);
Controls.Add(button1);
Controls.Add(dataGridView2);
Controls.Add(groupBox1);
Name = "FrmProductos";
Text = "Productos";
WindowState = FormWindowState.Maximized;
groupBox1.ResumeLayout(false);
groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
((System.ComponentModel.ISupportInitialize)dataGridView2).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private GroupBox groupBox1;
private DataGridView dataGridView1;
private Button BtnAdd;
private Button BtnEliminar;
private Button button1;
private DataGridView dataGridView2;
private Label label2;
private Label label1;
}
}

160
Vista/FrmProductos.cs Normal file
View File

@@ -0,0 +1,160 @@
using Controladora;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows.Forms;
using Controladora;
using Entidades;
namespace Vista
{
public partial class FrmProductos : Form
{
public FrmProductos()
{
InitializeComponent();
ConfigurarDataGridView();
ActualizarGrilla();
}
private void ConfigurarDataGridView()
{
dataGridView1.AutoGenerateColumns = false;
// Crear una columna para el ID
var colId = new DataGridViewTextBoxColumn
{
DataPropertyName = "Id",
HeaderText = "ID",
Name = "colId"
};
// Crear una columna para el nombre
var colNombre = new DataGridViewTextBoxColumn
{
DataPropertyName = "Nombre",
HeaderText = "Nombre",
Name = "colNombre"
};
// Crear una columna para el precio
var colPrecio = new DataGridViewTextBoxColumn
{
DataPropertyName = "Precio",
HeaderText = "Precio",
Name = "colPrecio"
};
var colHabilitado = new DataGridViewTextBoxColumn
{
DataPropertyName = "Habilitado",
HeaderText = "Habilitado",
Name = "colHabilitado"
};
// Crear una columna para la categoría (mostrando la descripción)
var colCategoria = new DataGridViewTextBoxColumn
{
DataPropertyName = "CategoriaDescripcion",
HeaderText = "Categoría",
Name = "colCategoria"
};
// Agregar las columnas al DataGridView
dataGridView1.Columns.Add(colId);
dataGridView1.Columns.Add(colNombre);
dataGridView1.Columns.Add(colPrecio);
dataGridView1.Columns.Add(colHabilitado);
dataGridView1.Columns.Add(colCategoria);
}
private void ActualizarGrilla()
{
dataGridView1.DataSource = null;
dataGridView2.DataSource = null;
var categorias = ControladoraCategorias.Instance.Listar();
dataGridView2.DataSource = categorias;
// Obtener la lista de productos y proyectar los datos
var productos = ControladoraProductos.Instance.Listar()
.Select(p => new
{
p.Id,
p.Nombre,
p.Precio,
p.Habilitado,
CategoriaDescripcion = p.Categoria != null ? p.Categoria.Descripcion : string.Empty
})
.ToList();
dataGridView1.DataSource = productos;
}
private void BtnAdd_Click(object sender, EventArgs e)
{
var form = new FrmProducto();
form.ShowDialog();
ActualizarGrilla();
}
private void button1_Click(object sender, EventArgs e)
{
var form = new CategoriaCreate();
form.ShowDialog();
ActualizarGrilla();
}
private void BtnEliminar_Click(object sender, EventArgs e)
{
if (dataGridView1.SelectedRows.Count == 0)
{
MessageBox.Show("Seleccione una línea para eliminar");
return;
}
// Recorre las filas seleccionadas
foreach (DataGridViewRow fila in dataGridView1.SelectedRows)
{
try
{
// Obtén el ID del producto desde la columna "colId"
int id = Convert.ToInt32(fila.Cells["colId"].Value);
// Busca el producto con el ID correspondiente
var producto = ControladoraProductos.Instance.Listar().FirstOrDefault(p => p.Id == id);
if (producto != null)
{
// Llama al método Eliminar pasando el objeto Producto
string devolucion = ControladoraProductos.Instance.Eliminar(producto);
MessageBox.Show(devolucion);
}
else
{
MessageBox.Show($"No se encontró el producto con el ID {id}");
}
}
catch (Exception ex)
{
MessageBox.Show($"Error al eliminar el producto: {ex.Message}");
}
}
// Actualiza la grilla después de eliminar
ActualizarGrilla();
}
}
}

120
Vista/FrmProductos.resx Normal file
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>

192
Vista/FrmProveedor.Designer.cs generated Normal file
View File

@@ -0,0 +1,192 @@
namespace Vista
{
partial class FrmProveedor
{
/// <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()
{
BtnAceptar = new Button();
txtNombre = new TextBox();
txtDireccion = new TextBox();
txtSocial = new TextBox();
numCuit = new NumericUpDown();
Nombre = new Label();
label1 = new Label();
label2 = new Label();
label3 = new Label();
checkBoxHabilitado = new CheckBox();
label4 = new Label();
BtnCancelar = new Button();
((System.ComponentModel.ISupportInitialize)numCuit).BeginInit();
SuspendLayout();
//
// BtnAceptar
//
BtnAceptar.Location = new Point(19, 195);
BtnAceptar.Name = "BtnAceptar";
BtnAceptar.Size = new Size(75, 23);
BtnAceptar.TabIndex = 0;
BtnAceptar.Text = "Aceptar";
BtnAceptar.UseVisualStyleBackColor = true;
BtnAceptar.Click += BtnAceptar_Click;
//
// txtNombre
//
txtNombre.Location = new Point(110, 19);
txtNombre.Name = "txtNombre";
txtNombre.Size = new Size(100, 23);
txtNombre.TabIndex = 1;
//
// txtDireccion
//
txtDireccion.Location = new Point(110, 53);
txtDireccion.Name = "txtDireccion";
txtDireccion.Size = new Size(100, 23);
txtDireccion.TabIndex = 2;
//
// txtSocial
//
txtSocial.Location = new Point(110, 88);
txtSocial.Name = "txtSocial";
txtSocial.Size = new Size(100, 23);
txtSocial.TabIndex = 3;
//
// numCuit
//
numCuit.Location = new Point(110, 117);
numCuit.Maximum = new decimal(new int[] { 1215752191, 23, 0, 0 });
numCuit.Name = "numCuit";
numCuit.Size = new Size(100, 23);
numCuit.TabIndex = 4;
//
// Nombre
//
Nombre.AutoSize = true;
Nombre.Location = new Point(24, 22);
Nombre.Name = "Nombre";
Nombre.Size = new Size(51, 15);
Nombre.TabIndex = 5;
Nombre.Text = "Nombre";
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(24, 61);
label1.Name = "label1";
label1.Size = new Size(57, 15);
label1.TabIndex = 6;
label1.Text = "Direccion";
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(24, 88);
label2.Name = "label2";
label2.Size = new Size(70, 15);
label2.TabIndex = 7;
label2.Text = "RazonSocial";
//
// label3
//
label3.AutoSize = true;
label3.Location = new Point(24, 117);
label3.Name = "label3";
label3.Size = new Size(29, 15);
label3.TabIndex = 8;
label3.Text = "Cuit";
//
// checkBoxHabilitado
//
checkBoxHabilitado.AutoSize = true;
checkBoxHabilitado.Location = new Point(110, 154);
checkBoxHabilitado.Name = "checkBoxHabilitado";
checkBoxHabilitado.Size = new Size(15, 14);
checkBoxHabilitado.TabIndex = 9;
checkBoxHabilitado.UseVisualStyleBackColor = true;
//
// label4
//
label4.AutoSize = true;
label4.Location = new Point(19, 153);
label4.Name = "label4";
label4.Size = new Size(62, 15);
label4.TabIndex = 10;
label4.Text = "Habilitado";
//
// BtnCancelar
//
BtnCancelar.Location = new Point(322, 195);
BtnCancelar.Name = "BtnCancelar";
BtnCancelar.Size = new Size(75, 23);
BtnCancelar.TabIndex = 11;
BtnCancelar.Text = "Cancelar";
BtnCancelar.UseVisualStyleBackColor = true;
BtnCancelar.Click += BtnCancelar_Click;
//
// FrmProveedor
//
AcceptButton = BtnAceptar;
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
CancelButton = BtnCancelar;
ClientSize = new Size(409, 230);
Controls.Add(BtnCancelar);
Controls.Add(label4);
Controls.Add(checkBoxHabilitado);
Controls.Add(label3);
Controls.Add(label2);
Controls.Add(label1);
Controls.Add(Nombre);
Controls.Add(numCuit);
Controls.Add(txtSocial);
Controls.Add(txtDireccion);
Controls.Add(txtNombre);
Controls.Add(BtnAceptar);
Name = "FrmProveedor";
Text = "Form1";
((System.ComponentModel.ISupportInitialize)numCuit).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Button btnAceptar;
private Button BtnAceptarr;
private TextBox txtNombre;
private TextBox txtDireccion;
private TextBox txtSocial;
private NumericUpDown numCuit;
private Label Nombre;
private Label label1;
private Label label2;
private Label label3;
private CheckBox checkBoxHabilitado;
private Label label4;
private Button BtnCancelar;
private Button BtnAceptar;
}
}

102
Vista/FrmProveedor.cs Normal file
View File

@@ -0,0 +1,102 @@
using Entidades;
using Controladora;
namespace Vista
{
public partial class FrmProveedor : Form
{
Proveedor proveedor;
public FrmProveedor(Proveedor? proveedor = null)
{
InitializeComponent();
if (proveedor != null)
{
this.proveedor = proveedor;
this.Text = "Modificar Proveedor";
CargarDatos();
}
else
{
this.Text = "Agregar Proveedor";
}
}
private void CargarDatos()
{
txtDireccion.Text = proveedor.Direccion;
txtNombre.Text = proveedor.Nombre;
txtSocial.Text = proveedor.RazonSocial;
numCuit.Value = proveedor.Cuit;
numCuit.ReadOnly = true;
checkBoxHabilitado.Checked = proveedor.Habilitado;
}
private bool ValidarDatos()
{
string devolucion = "";
/*
* complicado de leer pero en estas lineas estan todas las comprobaciones
* que pude pensar en el momento.
*/
if (string.IsNullOrEmpty(txtDireccion.Text)) devolucion += "La direccion no deberia ser nulo o vacio\n";
if (txtDireccion.Text.Length > 200) devolucion += "La direccion no puede superar los 200 chars\n";
if (string.IsNullOrEmpty(txtSocial.Text)) devolucion += "La razon social no puede ser nulo o vacio\n";
if (txtSocial.Text.Length > 50) devolucion += "La razon social no puede superar los 50 chars\n";
if (string.IsNullOrEmpty(txtNombre.Text)) devolucion += "El Nombre no puede ser nulo o vacio\n";
if (devolucion == "")
{
return true;
}
else
{
MessageBox.Show(devolucion);
return false;
}
}
private void BtnAceptar_Click(object sender, EventArgs e)
{
string msg;
if (ValidarDatos())
{
if (proveedor == null)
{
proveedor = new Proveedor
{
Nombre = txtNombre.Text,
Cuit = (Int64)numCuit.Value,
Direccion = txtDireccion.Text,
RazonSocial = txtSocial.Text,
Habilitado = checkBoxHabilitado.Checked,
};
msg = ControladoraProveedores.Instance.Añadir(proveedor);
}
else
{
proveedor.Nombre = txtNombre.Text;
proveedor.Direccion = txtDireccion.Text;
proveedor.RazonSocial = txtSocial.Text;
proveedor.Cuit = (Int64)numCuit.Value;
msg = ControladoraProveedores.Instance.Modificar(proveedor);
}
MessageBox.Show(msg, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
Close();
}
}
private void BtnCancelar_Click(object sender, EventArgs e)
{
this.Close();
}
}
}

120
Vista/FrmProveedor.resx Normal file
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>

120
Vista/FrmProveedores.Designer.cs generated Normal file
View File

@@ -0,0 +1,120 @@
namespace Vista
{
partial class FrmProveedores
{
/// <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()
{
groupBox1 = new GroupBox();
dataGridView1 = new DataGridView();
BtnAdd = new Button();
BtnEliminar = new Button();
BtnModificar = new Button();
groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
SuspendLayout();
//
// groupBox1
//
groupBox1.Controls.Add(dataGridView1);
groupBox1.Controls.Add(BtnAdd);
groupBox1.Controls.Add(BtnEliminar);
groupBox1.Controls.Add(BtnModificar);
groupBox1.Location = new Point(12, 12);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(776, 351);
groupBox1.TabIndex = 5;
groupBox1.TabStop = false;
//
// dataGridView1
//
dataGridView1.AllowUserToAddRows = false;
dataGridView1.AllowUserToDeleteRows = false;
dataGridView1.AllowUserToResizeColumns = false;
dataGridView1.AllowUserToResizeRows = false;
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Location = new Point(6, 22);
dataGridView1.Name = "dataGridView1";
dataGridView1.ReadOnly = true;
dataGridView1.RowTemplate.Height = 25;
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView1.Size = new Size(550, 235);
dataGridView1.TabIndex = 3;
//
// BtnAdd
//
BtnAdd.Location = new Point(6, 302);
BtnAdd.Name = "BtnAdd";
BtnAdd.Size = new Size(75, 23);
BtnAdd.TabIndex = 0;
BtnAdd.Text = "Añadir";
BtnAdd.UseVisualStyleBackColor = true;
BtnAdd.Click += BtnAdd_Click;
//
// BtnEliminar
//
BtnEliminar.Location = new Point(215, 302);
BtnEliminar.Name = "BtnEliminar";
BtnEliminar.Size = new Size(75, 23);
BtnEliminar.TabIndex = 2;
BtnEliminar.Text = "Eliminar";
BtnEliminar.UseVisualStyleBackColor = true;
BtnEliminar.Click += BtnEliminar_Click;
//
// BtnModificar
//
BtnModificar.Location = new Point(108, 302);
BtnModificar.Name = "BtnModificar";
BtnModificar.Size = new Size(75, 23);
BtnModificar.TabIndex = 1;
BtnModificar.Text = "Modificar";
BtnModificar.UseVisualStyleBackColor = true;
BtnModificar.Click += BtnModificar_Click;
//
// FrmProveedores
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 382);
Controls.Add(groupBox1);
Name = "FrmProveedores";
Text = "Proveedores";
WindowState = FormWindowState.Maximized;
groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
ResumeLayout(false);
}
#endregion
private GroupBox groupBox1;
private DataGridView dataGridView1;
private Button BtnAdd;
private Button BtnEliminar;
private Button BtnModificar;
}
}

67
Vista/FrmProveedores.cs Normal file
View File

@@ -0,0 +1,67 @@
using Entidades;
using Controladora;
namespace Vista
{
public partial class FrmProveedores : Form
{
public FrmProveedores()
{
InitializeComponent();
ActualizarGrilla();
}
private void ActualizarGrilla()
{
dataGridView1.DataSource = null;
dataGridView1.DataSource = ControladoraProveedores.Instance.Listar();
}
private void BtnAdd_Click(object sender, EventArgs e)
{
var form = new FrmProveedor();
form.ShowDialog();
ActualizarGrilla();
}
private void BtnModificar_Click(object sender, EventArgs e)
{
if (dataGridView1.SelectedRows.Count < 1)
{
MessageBox.Show("Seleccione una linea para modificar");
return;
}
Proveedor proveedor = new Proveedor()
{
Nombre = dataGridView1.SelectedRows[0].Cells["Nombre"].Value.ToString(),
Cuit = (Int64)dataGridView1.SelectedRows[0].Cells["Cuit"].Value,
RazonSocial = dataGridView1.SelectedRows[0].Cells["RazonSocial"].Value.ToString(),
Direccion = dataGridView1.SelectedRows[0].Cells["Direccion"].Value.ToString(),
Habilitado = bool.Parse(dataGridView1.SelectedRows[0].Cells["Habilitado"].Value.ToString())
};
var formModificar = new FrmProveedor(proveedor);
formModificar.ShowDialog();
ActualizarGrilla();
}
private void BtnEliminar_Click(object sender, EventArgs e)
{
if (dataGridView1.SelectedRows.Count < 0)
{
MessageBox.Show("Seleccione una linea para eliminar");
return;
}
foreach (DataGridViewRow Fila in dataGridView1.SelectedRows)
{ // itera por un loop y elimina las lineas seleccionadas 1 a la vez.
string devolucion = ControladoraProveedores.Instance.Eliminar(Int64.Parse(Fila.Cells["Cuit"].Value.ToString()));
MessageBox.Show(devolucion);
ActualizarGrilla();
}
}
}
}

120
Vista/FrmProveedores.resx Normal file
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>

87
Vista/FrmRemitos.Designer.cs generated Normal file
View File

@@ -0,0 +1,87 @@
namespace Vista
{
partial class FrmRemitos
{
/// <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()
{
groupBox1 = new GroupBox();
dataGridView1 = new DataGridView();
BtnAdd = new Button();
groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
SuspendLayout();
//
// groupBox1
//
groupBox1.Controls.Add(dataGridView1);
groupBox1.Controls.Add(BtnAdd);
groupBox1.Location = new Point(12, 12);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(776, 351);
groupBox1.TabIndex = 5;
groupBox1.TabStop = false;
//
// dataGridView1
//
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Location = new Point(6, 22);
dataGridView1.Name = "dataGridView1";
dataGridView1.RowTemplate.Height = 25;
dataGridView1.Size = new Size(550, 235);
dataGridView1.TabIndex = 3;
//
// BtnAdd
//
BtnAdd.Location = new Point(6, 302);
BtnAdd.Name = "BtnAdd";
BtnAdd.Size = new Size(75, 23);
BtnAdd.TabIndex = 0;
BtnAdd.Text = "Añadir";
BtnAdd.UseVisualStyleBackColor = true;
//
// FrmRemitos
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(groupBox1);
Name = "FrmRemitos";
Text = "Remitos";
WindowState = FormWindowState.Maximized;
groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
ResumeLayout(false);
}
#endregion
private GroupBox groupBox1;
private DataGridView dataGridView1;
private Button BtnAdd;
}
}

20
Vista/FrmRemitos.cs Normal file
View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Vista
{
public partial class FrmRemitos : Form
{
public FrmRemitos()
{
InitializeComponent();
}
}
}

120
Vista/FrmRemitos.resx Normal file
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>

137
Vista/PantallaPrincipal.Designer.cs generated Normal file
View File

@@ -0,0 +1,137 @@
namespace Vista
{
partial class PantallaPrincipal
{
/// <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()
{
menuStrip1 = new MenuStrip();
gestionarToolStripMenuItem = new ToolStripMenuItem();
clientesToolStripMenuItem = new ToolStripMenuItem();
ventasToolStripMenuItem = new ToolStripMenuItem();
proveedoresToolStripMenuItem = new ToolStripMenuItem();
productosToolStripMenuItem = new ToolStripMenuItem();
remitosToolStripMenuItem = new ToolStripMenuItem();
ordenDeCompraToolStripMenuItem = new ToolStripMenuItem();
pedidosPresupuestoToolStripMenuItem = new ToolStripMenuItem();
menuStrip1.SuspendLayout();
SuspendLayout();
//
// menuStrip1
//
menuStrip1.Items.AddRange(new ToolStripItem[] { gestionarToolStripMenuItem });
menuStrip1.Location = new Point(0, 0);
menuStrip1.Name = "menuStrip1";
menuStrip1.Size = new Size(800, 24);
menuStrip1.TabIndex = 0;
menuStrip1.Text = "menuStrip1";
//
// gestionarToolStripMenuItem
//
gestionarToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { clientesToolStripMenuItem, ventasToolStripMenuItem, proveedoresToolStripMenuItem, productosToolStripMenuItem, remitosToolStripMenuItem, ordenDeCompraToolStripMenuItem, pedidosPresupuestoToolStripMenuItem });
gestionarToolStripMenuItem.Name = "gestionarToolStripMenuItem";
gestionarToolStripMenuItem.Size = new Size(69, 20);
gestionarToolStripMenuItem.Text = "Gestionar";
//
// clientesToolStripMenuItem
//
clientesToolStripMenuItem.Name = "clientesToolStripMenuItem";
clientesToolStripMenuItem.Size = new Size(181, 22);
clientesToolStripMenuItem.Text = "Clientes";
clientesToolStripMenuItem.Click += clientesToolStripMenuItem_Click;
//
// ventasToolStripMenuItem
//
ventasToolStripMenuItem.Name = "ventasToolStripMenuItem";
ventasToolStripMenuItem.Size = new Size(181, 22);
ventasToolStripMenuItem.Text = "Ventas";
ventasToolStripMenuItem.Click += ventasToolStripMenuItem_Click;
//
// proveedoresToolStripMenuItem
//
proveedoresToolStripMenuItem.Name = "proveedoresToolStripMenuItem";
proveedoresToolStripMenuItem.Size = new Size(181, 22);
proveedoresToolStripMenuItem.Text = "Proveedores";
proveedoresToolStripMenuItem.Click += proveedoresToolStripMenuItem_Click;
//
// productosToolStripMenuItem
//
productosToolStripMenuItem.Name = "productosToolStripMenuItem";
productosToolStripMenuItem.Size = new Size(181, 22);
productosToolStripMenuItem.Text = "Productos";
productosToolStripMenuItem.Click += productosToolStripMenuItem_Click;
//
// remitosToolStripMenuItem
//
remitosToolStripMenuItem.Name = "remitosToolStripMenuItem";
remitosToolStripMenuItem.Size = new Size(181, 22);
remitosToolStripMenuItem.Text = "Remitos";
remitosToolStripMenuItem.Click += remitosToolStripMenuItem_Click;
//
// ordenDeCompraToolStripMenuItem
//
ordenDeCompraToolStripMenuItem.Name = "ordenDeCompraToolStripMenuItem";
ordenDeCompraToolStripMenuItem.Size = new Size(181, 22);
ordenDeCompraToolStripMenuItem.Text = "OrdenDeCompra";
ordenDeCompraToolStripMenuItem.Click += ordenDeCompraToolStripMenuItem_Click;
//
// pedidosPresupuestoToolStripMenuItem
//
pedidosPresupuestoToolStripMenuItem.Name = "pedidosPresupuestoToolStripMenuItem";
pedidosPresupuestoToolStripMenuItem.Size = new Size(181, 22);
pedidosPresupuestoToolStripMenuItem.Text = "PedidosPresupuesto";
pedidosPresupuestoToolStripMenuItem.Click += pedidosPresupuestoToolStripMenuItem_Click;
//
// PantallaPrincipal
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(menuStrip1);
IsMdiContainer = true;
MainMenuStrip = menuStrip1;
Name = "PantallaPrincipal";
Text = "Form1";
WindowState = FormWindowState.Maximized;
menuStrip1.ResumeLayout(false);
menuStrip1.PerformLayout();
ResumeLayout(false);
PerformLayout();
}
#endregion
private MenuStrip menuStrip1;
private ToolStripMenuItem gestionarToolStripMenuItem;
private ToolStripMenuItem ventasToolStripMenuItem;
private ToolStripMenuItem proveedoresToolStripMenuItem;
private ToolStripMenuItem productosToolStripMenuItem;
private ToolStripMenuItem remitosToolStripMenuItem;
private ToolStripMenuItem ordenDeCompraToolStripMenuItem;
private ToolStripMenuItem pedidosPresupuestoToolStripMenuItem;
private ToolStripMenuItem clientesToolStripMenuItem;
}
}

View File

@@ -0,0 +1,89 @@
namespace Vista
{
public partial class PantallaPrincipal : Form
{
public PantallaPrincipal()
{
InitializeComponent();
}
private void clientesToolStripMenuItem_Click(object sender, EventArgs e)
{
// Cerrar el formulario secundario actual si hay alguno
if (ActiveMdiChild != null)
{
ActiveMdiChild.Close();
}
var Frm = new FrmClientes();
Frm.MdiParent = this;
Frm.Show();
}
private void ventasToolStripMenuItem_Click(object sender, EventArgs e)
{
if (ActiveMdiChild != null)
{
ActiveMdiChild.Close();
}
var Frm = new FrmFacturas();
Frm.MdiParent = this;
Frm.Show();
}
private void proveedoresToolStripMenuItem_Click(object sender, EventArgs e)
{
if (ActiveMdiChild != null)
{
ActiveMdiChild.Close();
}
var Frm = new FrmProveedores();
Frm.MdiParent = this;
Frm.Show();
}
private void productosToolStripMenuItem_Click(object sender, EventArgs e)
{
if (ActiveMdiChild != null)
{
ActiveMdiChild.Close();
}
var Frm = new FrmProductos();
Frm.MdiParent = this;
Frm.Show();
}
private void remitosToolStripMenuItem_Click(object sender, EventArgs e)
{
if (ActiveMdiChild != null)
{
ActiveMdiChild.Close();
}
var Frm = new FrmRemitos();
Frm.MdiParent = this;
Frm.Show();
}
private void ordenDeCompraToolStripMenuItem_Click(object sender, EventArgs e)
{
if (ActiveMdiChild != null)
{
ActiveMdiChild.Close();
}
var Frm = new FrmOrdenDeCompra();
Frm.MdiParent = this;
Frm.Show();
}
private void pedidosPresupuestoToolStripMenuItem_Click(object sender, EventArgs e)
{
if (ActiveMdiChild != null)
{
ActiveMdiChild.Close();
}
var Frm = new FrmPedidosDePresupuestos();
Frm.MdiParent = this;
Frm.Show();
}
}
}

View File

@@ -0,0 +1,126 @@
<?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>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
</metadata>
</root>

View File

@@ -11,7 +11,7 @@ namespace Vista
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
Application.Run(new PantallaPrincipal());
}
}
}

View File

@@ -14,4 +14,9 @@
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Controladora\Controladora.csproj" />
<ProjectReference Include="..\Entidades\Entidades.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,8 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Compile Update="Form1.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup>
</Project>
<ItemGroup>
<Compile Update="CategoriaCreate.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="AddProducto.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmPresupuesto.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmCliente.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmFactura.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmPedidosDePresupuestos.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmOrdenDeCompra.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmProducto.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmProveedor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmRemitos.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmProductos.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmProveedores.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmFacturas.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmClientes.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="PantallaPrincipal.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup>
</Project>

View File

@@ -1,22 +0,0 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
},
{
"name": "Microsoft.WindowsDesktop.App",
"version": "6.0.0"
}
],
"additionalProbingPaths": [
"C:\\Users\\fedpo\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\Nacho\\.nuget\\packages"
],
"configProperties": {
"Microsoft.NETCore.DotNetHostPolicy.SetAppPaths": true
}
}
}

View File

@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// Este código fue generado por una herramienta.
// Versión de runtime:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
// se vuelve a generar el código.
// </auto-generated>
//------------------------------------------------------------------------------
@@ -14,12 +14,12 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Vista")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+abfd18e86f40a98925507ec03c2e8832ee47a3eb")]
[assembly: System.Reflection.AssemblyProductAttribute("Vista")]
[assembly: System.Reflection.AssemblyTitleAttribute("Vista")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
[assembly: System.Runtime.Versioning.TargetPlatformAttribute("Windows7.0")]
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("Windows7.0")]
// Generated by the MSBuild WriteCodeFragment class.
// Generado por la clase WriteCodeFragment de MSBuild.

View File

@@ -1 +1 @@
5c7eeffe8c03c0c0400edc2779c1a5f49505ced7
281e45d05d567e56bd25031aebcd2e38799f1146d63fd738a708cca7c575e649

View File

@@ -14,4 +14,6 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Vista
build_property.ProjectDir = C:\Users\fedpo\source\repos\Final_OOP\Vista\
build_property.ProjectDir = C:\Users\Nacho\source\repos\Final\Vista\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =

View File

@@ -1,32 +1,96 @@
{
"format": 1,
"restore": {
"C:\\Users\\Nacho\\Desktop\\Final\\Vista\\Vista.csproj": {}
"C:\\Users\\fedpo\\Downloads\\Final\\Final\\Vista\\Vista.csproj": {}
},
"projects": {
"C:\\Users\\Nacho\\Desktop\\Final\\Vista\\Vista.csproj": {
"C:\\Users\\fedpo\\Downloads\\Final\\Final\\Controladora\\Controladora.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\Nacho\\Desktop\\Final\\Vista\\Vista.csproj",
"projectName": "Vista",
"projectPath": "C:\\Users\\Nacho\\Desktop\\Final\\Vista\\Vista.csproj",
"packagesPath": "C:\\Users\\Nacho\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Nacho\\Desktop\\Final\\Vista\\obj\\",
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Controladora\\Controladora.csproj",
"projectName": "Controladora",
"projectPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Controladora\\Controladora.csproj",
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
"outputPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Controladora\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Nacho\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0-windows"
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
"https://api.nuget.org/v3/index.json": {},
"https://fedesrv.ddns.net/git/api/packages/fede/nuget/index.json": {}
},
"frameworks": {
"net6.0-windows7.0": {
"targetAlias": "net6.0-windows",
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {
"C:\\Users\\fedpo\\Downloads\\Final\\Final\\Entidades\\Entidades.csproj": {
"projectPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Entidades\\Entidades.csproj"
},
"C:\\Users\\fedpo\\Downloads\\Final\\Final\\Modelo\\Modelo.csproj": {
"projectPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Modelo\\Modelo.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.306\\RuntimeIdentifierGraph.json"
}
}
},
"C:\\Users\\fedpo\\Downloads\\Final\\Final\\Entidades\\Entidades.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Entidades\\Entidades.csproj",
"projectName": "Entidades",
"projectPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Entidades\\Entidades.csproj",
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
"outputPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Entidades\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {},
"https://fedesrv.ddns.net/git/api/packages/fede/nuget/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
@@ -34,11 +98,129 @@
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.306\\RuntimeIdentifierGraph.json"
}
}
},
"C:\\Users\\fedpo\\Downloads\\Final\\Final\\Modelo\\Modelo.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Modelo\\Modelo.csproj",
"projectName": "Modelo",
"projectPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Modelo\\Modelo.csproj",
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
"outputPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Modelo\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {},
"https://fedesrv.ddns.net/git/api/packages/fede/nuget/index.json": {}
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {
"C:\\Users\\fedpo\\Downloads\\Final\\Final\\Entidades\\Entidades.csproj": {
"projectPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Entidades\\Entidades.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.306\\RuntimeIdentifierGraph.json"
}
}
},
"C:\\Users\\fedpo\\Downloads\\Final\\Final\\Vista\\Vista.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Vista\\Vista.csproj",
"projectName": "Vista",
"projectPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Vista\\Vista.csproj",
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
"outputPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Vista\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0-windows"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {},
"https://fedesrv.ddns.net/git/api/packages/fede/nuget/index.json": {}
},
"frameworks": {
"net6.0-windows7.0": {
"targetAlias": "net6.0-windows",
"projectReferences": {
"C:\\Users\\fedpo\\Downloads\\Final\\Final\\Controladora\\Controladora.csproj": {
"projectPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Controladora\\Controladora.csproj"
},
"C:\\Users\\fedpo\\Downloads\\Final\\Final\\Entidades\\Entidades.csproj": {
"projectPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Entidades\\Entidades.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
@@ -63,7 +245,7 @@
"privateAssets": "none"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.306\\RuntimeIdentifierGraph.json"
}
}
}

View File

@@ -5,11 +5,11 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Nacho\.nuget\packages\</NuGetPackageFolders>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\fedpo\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.9.2</NuGetToolVersion>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.6.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Nacho\.nuget\packages\" />
<SourceRoot Include="C:\Users\fedpo\.nuget\packages\" />
</ItemGroup>
</Project>

View File

@@ -1,26 +1,83 @@
{
"version": 3,
"targets": {
"net6.0-windows7.0": {}
"net6.0-windows7.0": {
"Controladora/1.0.0": {
"type": "project",
"framework": ".NETCoreApp,Version=v6.0",
"dependencies": {
"Entidades": "1.0.0",
"Modelo": "1.0.0"
},
"compile": {
"bin/placeholder/Controladora.dll": {}
},
"runtime": {
"bin/placeholder/Controladora.dll": {}
}
},
"Entidades/1.0.0": {
"type": "project",
"framework": ".NETCoreApp,Version=v6.0",
"compile": {
"bin/placeholder/Entidades.dll": {}
},
"runtime": {
"bin/placeholder/Entidades.dll": {}
}
},
"Modelo/1.0.0": {
"type": "project",
"framework": ".NETCoreApp,Version=v6.0",
"dependencies": {
"Entidades": "1.0.0"
},
"compile": {
"bin/placeholder/Modelo.dll": {}
},
"runtime": {
"bin/placeholder/Modelo.dll": {}
}
}
}
},
"libraries": {
"Controladora/1.0.0": {
"type": "project",
"path": "../Controladora/Controladora.csproj",
"msbuildProject": "../Controladora/Controladora.csproj"
},
"Entidades/1.0.0": {
"type": "project",
"path": "../Entidades/Entidades.csproj",
"msbuildProject": "../Entidades/Entidades.csproj"
},
"Modelo/1.0.0": {
"type": "project",
"path": "../Modelo/Modelo.csproj",
"msbuildProject": "../Modelo/Modelo.csproj"
}
},
"libraries": {},
"projectFileDependencyGroups": {
"net6.0-windows7.0": []
"net6.0-windows7.0": [
"Controladora >= 1.0.0",
"Entidades >= 1.0.0"
]
},
"packageFolders": {
"C:\\Users\\Nacho\\.nuget\\packages\\": {}
"C:\\Users\\fedpo\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\Nacho\\Desktop\\Final\\Vista\\Vista.csproj",
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Vista\\Vista.csproj",
"projectName": "Vista",
"projectPath": "C:\\Users\\Nacho\\Desktop\\Final\\Vista\\Vista.csproj",
"packagesPath": "C:\\Users\\Nacho\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Nacho\\Desktop\\Final\\Vista\\obj\\",
"projectPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Vista\\Vista.csproj",
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
"outputPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Vista\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Nacho\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
@@ -28,23 +85,26 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
"https://api.nuget.org/v3/index.json": {},
"https://fedesrv.ddns.net/git/api/packages/fede/nuget/index.json": {}
},
"frameworks": {
"net6.0-windows7.0": {
"targetAlias": "net6.0-windows",
"projectReferences": {}
"projectReferences": {
"C:\\Users\\fedpo\\Downloads\\Final\\Final\\Controladora\\Controladora.csproj": {
"projectPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Controladora\\Controladora.csproj"
},
"C:\\Users\\fedpo\\Downloads\\Final\\Final\\Entidades\\Entidades.csproj": {
"projectPath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Entidades\\Entidades.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
@@ -69,7 +129,7 @@
"privateAssets": "none"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.306\\RuntimeIdentifierGraph.json"
}
}
}

View File

@@ -1,8 +1,8 @@
{
"version": 2,
"dgSpecHash": "GvFIhnLV+eDoJXFobv7XbjhgizA7qmjVkI/l9hLGcuE4ZXsDbaDBUfVNjwf6kQUhJPOE8sqPQ34DYEuGGdBNOw==",
"dgSpecHash": "aNFbNdDa22Mg1jfOxDzb7N16RdBndEphnWuh1X0WK6h4YNDptQDhQUjqbwCKBPcpGb6LmtlDSztOIxoXuc2UXQ==",
"success": true,
"projectFilePath": "C:\\Users\\Nacho\\Desktop\\Final\\Vista\\Vista.csproj",
"projectFilePath": "C:\\Users\\fedpo\\Downloads\\Final\\Final\\Vista\\Vista.csproj",
"expectedPackageFiles": [],
"logs": []
}