correcciones sobre los forms

This commit is contained in:
2024-08-03 22:03:54 +01:00
parent 8de480aed5
commit 84d414b536
18 changed files with 214 additions and 153 deletions

Binary file not shown.

View File

@@ -1,6 +1,6 @@
namespace Vista namespace Vista
{ {
partial class CategoriaCreate partial class AddCategoria
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@@ -90,18 +90,18 @@
button1.UseVisualStyleBackColor = true; button1.UseVisualStyleBackColor = true;
button1.Click += button1_Click; button1.Click += button1_Click;
// //
// CategoriaCreate // AddCategoria
// //
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(517, 235); ClientSize = new Size(278, 235);
Controls.Add(button1); Controls.Add(button1);
Controls.Add(textBox1); Controls.Add(textBox1);
Controls.Add(numericUpDown1); Controls.Add(numericUpDown1);
Controls.Add(label2); Controls.Add(label2);
Controls.Add(label1); Controls.Add(label1);
Controls.Add(button2); Controls.Add(button2);
Name = "CategoriaCreate"; Name = "AddCategoria";
Text = "Form1"; Text = "Form1";
((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit(); ((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
ResumeLayout(false); ResumeLayout(false);

View File

@@ -12,10 +12,10 @@ using System.Windows.Forms;
namespace Vista namespace Vista
{ {
public partial class CategoriaCreate : Form public partial class AddCategoria : Form
{ {
private Categoria? categoria; private Categoria? categoria;
public CategoriaCreate() public AddCategoria()
{ {
InitializeComponent(); InitializeComponent();
} }
@@ -87,6 +87,6 @@ namespace Vista
MessageBox.Show(msg, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show(msg, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
Close(); Close();
} }
} }
} }
} }

View File

@@ -18,7 +18,7 @@
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>

View File

@@ -41,7 +41,7 @@
// //
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList; comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox1.FormattingEnabled = true; comboBox1.FormattingEnabled = true;
comboBox1.Location = new Point(164, 36); comboBox1.Location = new Point(98, 37);
comboBox1.Name = "comboBox1"; comboBox1.Name = "comboBox1";
comboBox1.Size = new Size(121, 23); comboBox1.Size = new Size(121, 23);
comboBox1.TabIndex = 0; comboBox1.TabIndex = 0;
@@ -49,7 +49,7 @@
// label1 // label1
// //
label1.AutoSize = true; label1.AutoSize = true;
label1.Location = new Point(92, 39); label1.Location = new Point(26, 40);
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new Size(56, 15); label1.Size = new Size(56, 15);
label1.TabIndex = 1; label1.TabIndex = 1;
@@ -58,7 +58,7 @@
// label2 // label2
// //
label2.AutoSize = true; label2.AutoSize = true;
label2.Location = new Point(93, 85); label2.Location = new Point(27, 86);
label2.Name = "label2"; label2.Name = "label2";
label2.Size = new Size(55, 15); label2.Size = new Size(55, 15);
label2.TabIndex = 2; label2.TabIndex = 2;
@@ -66,7 +66,7 @@
// //
// numericUpDown1 // numericUpDown1
// //
numericUpDown1.Location = new Point(165, 77); numericUpDown1.Location = new Point(99, 78);
numericUpDown1.Maximum = new decimal(new int[] { 10000000, 0, 0, 0 }); numericUpDown1.Maximum = new decimal(new int[] { 10000000, 0, 0, 0 });
numericUpDown1.Name = "numericUpDown1"; numericUpDown1.Name = "numericUpDown1";
numericUpDown1.Size = new Size(120, 23); numericUpDown1.Size = new Size(120, 23);
@@ -74,9 +74,9 @@
// //
// button1 // button1
// //
button1.Location = new Point(12, 191); button1.Location = new Point(12, 160);
button1.Name = "button1"; button1.Name = "button1";
button1.Size = new Size(85, 42); button1.Size = new Size(71, 23);
button1.TabIndex = 4; button1.TabIndex = 4;
button1.Text = "Guardar"; button1.Text = "Guardar";
button1.UseVisualStyleBackColor = true; button1.UseVisualStyleBackColor = true;
@@ -84,9 +84,9 @@
// //
// button2 // button2
// //
button2.Location = new Point(354, 191); button2.Location = new Point(146, 160);
button2.Name = "button2"; button2.Name = "button2";
button2.Size = new Size(85, 42); button2.Size = new Size(73, 23);
button2.TabIndex = 5; button2.TabIndex = 5;
button2.Text = "Cancelar"; button2.Text = "Cancelar";
button2.UseVisualStyleBackColor = true; button2.UseVisualStyleBackColor = true;
@@ -96,7 +96,7 @@
// //
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(451, 245); ClientSize = new Size(236, 201);
Controls.Add(button2); Controls.Add(button2);
Controls.Add(button1); Controls.Add(button1);
Controls.Add(numericUpDown1); Controls.Add(numericUpDown1);

View File

@@ -30,21 +30,21 @@
{ {
button1 = new Button(); button1 = new Button();
button2 = new Button(); button2 = new Button();
numericUpDown1 = new NumericUpDown(); numid = new NumericUpDown();
label1 = new Label(); label1 = new Label();
numericUpDown2 = new NumericUpDown(); numtotal = new NumericUpDown();
label2 = new Label(); label2 = new Label();
dateTimePicker1 = new DateTimePicker(); datepick = new DateTimePicker();
label3 = new Label(); label3 = new Label();
label4 = new Label(); label4 = new Label();
comboBox1 = new ComboBox(); cmbCliente = new ComboBox();
((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit(); ((System.ComponentModel.ISupportInitialize)numid).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDown2).BeginInit(); ((System.ComponentModel.ISupportInitialize)numtotal).BeginInit();
SuspendLayout(); SuspendLayout();
// //
// button1 // button1
// //
button1.Location = new Point(12, 213); button1.Location = new Point(12, 172);
button1.Name = "button1"; button1.Name = "button1";
button1.Size = new Size(75, 23); button1.Size = new Size(75, 23);
button1.TabIndex = 0; button1.TabIndex = 0;
@@ -54,7 +54,7 @@
// //
// button2 // button2
// //
button2.Location = new Point(123, 213); button2.Location = new Point(142, 172);
button2.Name = "button2"; button2.Name = "button2";
button2.Size = new Size(75, 23); button2.Size = new Size(75, 23);
button2.TabIndex = 1; button2.TabIndex = 1;
@@ -62,13 +62,13 @@
button2.UseVisualStyleBackColor = true; button2.UseVisualStyleBackColor = true;
button2.Click += button2_Click; button2.Click += button2_Click;
// //
// numericUpDown1 // numid
// //
numericUpDown1.Location = new Point(97, 26); numid.Location = new Point(97, 26);
numericUpDown1.Maximum = new decimal(new int[] { 1215752191, 23, 0, 0 }); numid.Maximum = new decimal(new int[] { 1215752191, 23, 0, 0 });
numericUpDown1.Name = "numericUpDown1"; numid.Name = "numid";
numericUpDown1.Size = new Size(120, 23); numid.Size = new Size(120, 23);
numericUpDown1.TabIndex = 2; numid.TabIndex = 2;
// //
// label1 // label1
// //
@@ -79,13 +79,13 @@
label1.TabIndex = 3; label1.TabIndex = 3;
label1.Text = "ID"; label1.Text = "ID";
// //
// numericUpDown2 // numtotal
// //
numericUpDown2.Location = new Point(97, 57); numtotal.Location = new Point(97, 57);
numericUpDown2.Maximum = new decimal(new int[] { 1215752191, 23, 0, 0 }); numtotal.Maximum = new decimal(new int[] { 1215752191, 23, 0, 0 });
numericUpDown2.Name = "numericUpDown2"; numtotal.Name = "numtotal";
numericUpDown2.Size = new Size(120, 23); numtotal.Size = new Size(120, 23);
numericUpDown2.TabIndex = 4; numtotal.TabIndex = 4;
// //
// label2 // label2
// //
@@ -96,12 +96,12 @@
label2.TabIndex = 5; label2.TabIndex = 5;
label2.Text = "Total"; label2.Text = "Total";
// //
// dateTimePicker1 // datepick
// //
dateTimePicker1.Location = new Point(97, 88); datepick.Location = new Point(97, 88);
dateTimePicker1.Name = "dateTimePicker1"; datepick.Name = "datepick";
dateTimePicker1.Size = new Size(120, 23); datepick.Size = new Size(120, 23);
dateTimePicker1.TabIndex = 6; datepick.TabIndex = 6;
// //
// label3 // label3
// //
@@ -121,34 +121,34 @@
label4.TabIndex = 8; label4.TabIndex = 8;
label4.Text = "Cliente"; label4.Text = "Cliente";
// //
// comboBox1 // cmbCliente
// //
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList; cmbCliente.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox1.FormattingEnabled = true; cmbCliente.FormattingEnabled = true;
comboBox1.Location = new Point(99, 121); cmbCliente.Location = new Point(99, 121);
comboBox1.Name = "comboBox1"; cmbCliente.Name = "cmbCliente";
comboBox1.Size = new Size(121, 23); cmbCliente.Size = new Size(121, 23);
comboBox1.TabIndex = 10; cmbCliente.TabIndex = 10;
// //
// FrmFactura // FrmFactura
// //
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(458, 265); ClientSize = new Size(652, 205);
Controls.Add(comboBox1); Controls.Add(cmbCliente);
Controls.Add(label4); Controls.Add(label4);
Controls.Add(label3); Controls.Add(label3);
Controls.Add(dateTimePicker1); Controls.Add(datepick);
Controls.Add(label2); Controls.Add(label2);
Controls.Add(numericUpDown2); Controls.Add(numtotal);
Controls.Add(label1); Controls.Add(label1);
Controls.Add(numericUpDown1); Controls.Add(numid);
Controls.Add(button2); Controls.Add(button2);
Controls.Add(button1); Controls.Add(button1);
Name = "FrmFactura"; Name = "FrmFactura";
Text = "Form1"; Text = "Form1";
((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit(); ((System.ComponentModel.ISupportInitialize)numid).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDown2).EndInit(); ((System.ComponentModel.ISupportInitialize)numtotal).EndInit();
ResumeLayout(false); ResumeLayout(false);
PerformLayout(); PerformLayout();
} }
@@ -157,13 +157,13 @@
private Button button1; private Button button1;
private Button button2; private Button button2;
private NumericUpDown numericUpDown1; private NumericUpDown numid;
private Label label1; private Label label1;
private NumericUpDown numericUpDown2; private NumericUpDown numtotal;
private Label label2; private Label label2;
private DateTimePicker dateTimePicker1; private DateTimePicker datepick;
private Label label3; private Label label3;
private Label label4; private Label label4;
private ComboBox comboBox1; private ComboBox cmbCliente;
} }
} }

View File

@@ -16,19 +16,21 @@ namespace Vista
{ {
public partial class FrmFactura : Form public partial class FrmFactura : Form
{ {
private Factura factura;
private Cliente clienteSeleccionado; private Cliente clienteSeleccionado;
Factura factura;
public FrmFactura(Factura? factura = null) public FrmFactura(Factura? factura = null)
{ {
InitializeComponent(); InitializeComponent();
CargarClientes(); CargarClientes();
comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged; cmbCliente.SelectedIndexChanged += comboBox1_SelectedIndexChanged;
// Para el primer control NumericUpDown // Para el primer control NumericUpDown
numericUpDown1.Maximum = int.MaxValue; // Esto permitirá IDs muy grandes numid.Maximum = int.MaxValue; // Esto permitirá IDs muy grandes
// Para el segundo control NumericUpDown // Para el segundo control NumericUpDown
numericUpDown2.Maximum = decimal.MaxValue; // Esto permitirá totales muy grandes numtotal.Maximum = decimal.MaxValue; // Esto permitirá totales muy grandes
cmbCliente.DisplayMember = "Cliente";
cmbCliente.SelectedIndex = -1;
if (factura != null) if (factura != null)
{ {
@@ -47,30 +49,33 @@ namespace Vista
// Obtener la lista de clientes desde el repositorio // Obtener la lista de clientes desde el repositorio
ReadOnlyCollection<Cliente> clientes = RepositorioClientes.Instance.Listar(); ReadOnlyCollection<Cliente> clientes = RepositorioClientes.Instance.Listar();
// Asignar la lista de clientes como origen de datos para el ComboBox // Asignar la lista de clientes como origen de datos para el ComboBox
comboBox1.DataSource = clientes; cmbCliente.DataSource = clientes;
// Establecer la propiedad para mostrar el nombre del cliente en el ComboBox // Establecer la propiedad para mostrar el nombre del cliente en el ComboBox
comboBox1.DisplayMember = "NombreCompleto"; cmbCliente.DisplayMember = "NombreCompleto";
} }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{ {
clienteSeleccionado = (Cliente)comboBox1.SelectedItem; clienteSeleccionado = (Cliente)cmbCliente.SelectedItem;
} }
private void CargarDatos() private void CargarDatos()
{ {
numericUpDown1.Value = factura.Id; numid.Value = factura.Id;
numericUpDown2.Value = (decimal)factura.Total; numtotal.Value = (decimal)factura.Total;
dateTimePicker1.Value = factura.Fecha; datepick.Value = factura.Fecha;
// Asignar el cliente seleccionado en el ComboBox // Asignar el cliente seleccionado en el ComboBox
if (factura.Cliente != null) if (factura.Cliente != null)
{ {
comboBox1.SelectedItem = factura.Cliente; cmbCliente.SelectedItem = factura.Cliente;
} }
} }
@@ -79,8 +84,9 @@ namespace Vista
{ {
string devolucion = ""; string devolucion = "";
if (string.IsNullOrEmpty(numericUpDown1.Text)) devolucion += "El ID no puede ser nulo o vacío\n"; if (string.IsNullOrEmpty(numid.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 (numtotal.Value <= 0) devolucion += "El total debe ser mayor que cero\n";
if (clienteSeleccionado == null) devolucion += "Debe seleccionar un cliente\n"; if (clienteSeleccionado == null) devolucion += "Debe seleccionar un cliente\n";
if (devolucion == "") if (devolucion == "")
@@ -107,10 +113,10 @@ namespace Vista
// Crear una nueva factura con los datos proporcionados // Crear una nueva factura con los datos proporcionados
factura = new Factura factura = new Factura
{ {
Id = (int)numericUpDown1.Value, Id = (int)numid.Value,
Total = (double)numericUpDown2.Value, Total = (double)numtotal.Value,
Fecha = dateTimePicker1.Value, Fecha = datepick.Value,
Cliente = (Cliente)comboBox1.SelectedItem, Cliente = (Cliente)cmbCliente.SelectedItem,
}; };
// Agregar la factura a la colección // Agregar la factura a la colección
ControladoraFacturas.Instance.Añadir(factura); ControladoraFacturas.Instance.Añadir(factura);
@@ -118,10 +124,10 @@ namespace Vista
else else
{ {
// Actualizar los datos de la factura existente // Actualizar los datos de la factura existente
factura.Id = (int)numericUpDown1.Value; factura.Id = (int)numid.Value;
factura.Total = (double)numericUpDown2.Value; factura.Total = (double)numtotal.Value;
factura.Fecha = dateTimePicker1.Value; factura.Fecha = datepick.Value;
factura.Cliente = (Cliente)comboBox1.SelectedItem; factura.Cliente = (Cliente)cmbCliente.SelectedItem;
// Modificar la factura en la colección // Modificar la factura en la colección
ControladoraFacturas.Instance.Modificar(factura); ControladoraFacturas.Instance.Modificar(factura);
} }

View File

@@ -18,7 +18,7 @@
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>

View File

@@ -38,8 +38,8 @@
numericUpDown2 = new NumericUpDown(); numericUpDown2 = new NumericUpDown();
checkBox1 = new CheckBox(); checkBox1 = new CheckBox();
comboBox1 = new ComboBox(); comboBox1 = new ComboBox();
button1 = new Button(); btnacept = new Button();
button2 = new Button(); btncancel = new Button();
((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit(); ((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDown2).BeginInit(); ((System.ComponentModel.ISupportInitialize)numericUpDown2).BeginInit();
SuspendLayout(); SuspendLayout();
@@ -47,7 +47,7 @@
// label1 // label1
// //
label1.AutoSize = true; label1.AutoSize = true;
label1.Location = new Point(47, 44); label1.Location = new Point(46, 20);
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new Size(18, 15); label1.Size = new Size(18, 15);
label1.TabIndex = 0; label1.TabIndex = 0;
@@ -56,7 +56,7 @@
// label2 // label2
// //
label2.AutoSize = true; label2.AutoSize = true;
label2.Location = new Point(14, 73); label2.Location = new Point(14, 48);
label2.Name = "label2"; label2.Name = "label2";
label2.Size = new Size(51, 15); label2.Size = new Size(51, 15);
label2.TabIndex = 1; label2.TabIndex = 1;
@@ -65,7 +65,7 @@
// label3 // label3
// //
label3.AutoSize = true; label3.AutoSize = true;
label3.Location = new Point(25, 105); label3.Location = new Point(25, 80);
label3.Name = "label3"; label3.Name = "label3";
label3.Size = new Size(40, 15); label3.Size = new Size(40, 15);
label3.TabIndex = 2; label3.TabIndex = 2;
@@ -74,7 +74,7 @@
// label4 // label4
// //
label4.AutoSize = true; label4.AutoSize = true;
label4.Location = new Point(7, 136); label4.Location = new Point(7, 111);
label4.Name = "label4"; label4.Name = "label4";
label4.Size = new Size(62, 15); label4.Size = new Size(62, 15);
label4.TabIndex = 3; label4.TabIndex = 3;
@@ -83,7 +83,7 @@
// label5 // label5
// //
label5.AutoSize = true; label5.AutoSize = true;
label5.Location = new Point(7, 167); label5.Location = new Point(7, 142);
label5.Name = "label5"; label5.Name = "label5";
label5.Size = new Size(58, 15); label5.Size = new Size(58, 15);
label5.TabIndex = 4; label5.TabIndex = 4;
@@ -91,7 +91,7 @@
// //
// numericUpDown1 // numericUpDown1
// //
numericUpDown1.Location = new Point(71, 36); numericUpDown1.Location = new Point(70, 12);
numericUpDown1.Maximum = new decimal(new int[] { 1215752191, 23, 0, 0 }); numericUpDown1.Maximum = new decimal(new int[] { 1215752191, 23, 0, 0 });
numericUpDown1.Name = "numericUpDown1"; numericUpDown1.Name = "numericUpDown1";
numericUpDown1.Size = new Size(120, 23); numericUpDown1.Size = new Size(120, 23);
@@ -99,14 +99,14 @@
// //
// textBox1 // textBox1
// //
textBox1.Location = new Point(71, 65); textBox1.Location = new Point(71, 40);
textBox1.Name = "textBox1"; textBox1.Name = "textBox1";
textBox1.Size = new Size(120, 23); textBox1.Size = new Size(120, 23);
textBox1.TabIndex = 6; textBox1.TabIndex = 6;
// //
// numericUpDown2 // numericUpDown2
// //
numericUpDown2.Location = new Point(71, 97); numericUpDown2.Location = new Point(71, 72);
numericUpDown2.Maximum = new decimal(new int[] { 100000000, 0, 0, 0 }); numericUpDown2.Maximum = new decimal(new int[] { 100000000, 0, 0, 0 });
numericUpDown2.Name = "numericUpDown2"; numericUpDown2.Name = "numericUpDown2";
numericUpDown2.Size = new Size(120, 23); numericUpDown2.Size = new Size(120, 23);
@@ -115,7 +115,7 @@
// checkBox1 // checkBox1
// //
checkBox1.AutoSize = true; checkBox1.AutoSize = true;
checkBox1.Location = new Point(71, 137); checkBox1.Location = new Point(71, 112);
checkBox1.Name = "checkBox1"; checkBox1.Name = "checkBox1";
checkBox1.Size = new Size(15, 14); checkBox1.Size = new Size(15, 14);
checkBox1.TabIndex = 8; checkBox1.TabIndex = 8;
@@ -125,39 +125,41 @@
// //
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList; comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox1.FormattingEnabled = true; comboBox1.FormattingEnabled = true;
comboBox1.Location = new Point(70, 159); comboBox1.Location = new Point(70, 134);
comboBox1.Name = "comboBox1"; comboBox1.Name = "comboBox1";
comboBox1.Size = new Size(121, 23); comboBox1.Size = new Size(121, 23);
comboBox1.TabIndex = 9; comboBox1.TabIndex = 9;
comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged; comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged;
// //
// button1 // btnacept
// //
button1.Location = new Point(14, 239); btnacept.Location = new Point(13, 194);
button1.Name = "button1"; btnacept.Name = "btnacept";
button1.Size = new Size(92, 35); btnacept.Size = new Size(72, 21);
button1.TabIndex = 10; btnacept.TabIndex = 10;
button1.Text = "Aceptar"; btnacept.Text = "Aceptar";
button1.UseVisualStyleBackColor = true; btnacept.UseVisualStyleBackColor = true;
button1.Click += button1_Click; btnacept.Click += button1_Click;
// //
// button2 // btncancel
// //
button2.Location = new Point(154, 239); btncancel.Location = new Point(122, 194);
button2.Name = "button2"; btncancel.Name = "btncancel";
button2.Size = new Size(92, 35); btncancel.Size = new Size(68, 21);
button2.TabIndex = 11; btncancel.TabIndex = 11;
button2.Text = "Cancelar"; btncancel.Text = "Cancelar";
button2.UseVisualStyleBackColor = true; btncancel.UseVisualStyleBackColor = true;
button2.Click += button2_Click; btncancel.Click += button2_Click;
// //
// FrmProducto // FrmProducto
// //
AcceptButton = btnacept;
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(471, 313); CancelButton = btncancel;
Controls.Add(button2); ClientSize = new Size(210, 228);
Controls.Add(button1); Controls.Add(btncancel);
Controls.Add(btnacept);
Controls.Add(comboBox1); Controls.Add(comboBox1);
Controls.Add(checkBox1); Controls.Add(checkBox1);
Controls.Add(numericUpDown2); Controls.Add(numericUpDown2);
@@ -188,7 +190,7 @@
private NumericUpDown numericUpDown2; private NumericUpDown numericUpDown2;
private CheckBox checkBox1; private CheckBox checkBox1;
private ComboBox comboBox1; private ComboBox comboBox1;
private Button button1; private Button btnacept;
private Button button2; private Button btncancel;
} }
} }

View File

@@ -18,7 +18,7 @@
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>

View File

@@ -29,13 +29,13 @@
private void InitializeComponent() private void InitializeComponent()
{ {
groupBox1 = new GroupBox(); groupBox1 = new GroupBox();
button1 = new Button(); label2 = new Label();
dataGridView1 = new DataGridView(); dataGridView1 = new DataGridView();
BtnAdd = new Button(); BtnAdd = new Button();
BtnEliminar = new Button(); BtnEliminar = new Button();
button1 = new Button();
dataGridView2 = new DataGridView(); dataGridView2 = new DataGridView();
label1 = new Label(); label1 = new Label();
label2 = new Label();
groupBox1.SuspendLayout(); groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit(); ((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
((System.ComponentModel.ISupportInitialize)dataGridView2).BeginInit(); ((System.ComponentModel.ISupportInitialize)dataGridView2).BeginInit();
@@ -53,20 +53,20 @@
groupBox1.TabIndex = 5; groupBox1.TabIndex = 5;
groupBox1.TabStop = false; groupBox1.TabStop = false;
// //
// button1 // label2
// //
button1.Location = new Point(794, 302); label2.AutoSize = true;
button1.Name = "button1"; label2.Location = new Point(6, 4);
button1.Size = new Size(128, 23); label2.Name = "label2";
button1.TabIndex = 4; label2.Size = new Size(61, 15);
button1.Text = "Crear Categoria"; label2.TabIndex = 8;
button1.UseVisualStyleBackColor = true; label2.Text = "Productos";
button1.Click += button1_Click;
// //
// dataGridView1 // dataGridView1
// //
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.EditMode = DataGridViewEditMode.EditProgrammatically;
dataGridView1.Location = new Point(6, 22); dataGridView1.Location = new Point(6, 22);
dataGridView1.Name = "dataGridView1"; dataGridView1.Name = "dataGridView1";
dataGridView1.RowTemplate.Height = 25; dataGridView1.RowTemplate.Height = 25;
@@ -94,13 +94,25 @@
BtnEliminar.UseVisualStyleBackColor = true; BtnEliminar.UseVisualStyleBackColor = true;
BtnEliminar.Click += BtnEliminar_Click; BtnEliminar.Click += BtnEliminar_Click;
// //
// 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;
//
// dataGridView2 // dataGridView2
// //
dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView2.EditMode = DataGridViewEditMode.EditProgrammatically;
dataGridView2.Location = new Point(794, 22); dataGridView2.Location = new Point(794, 22);
dataGridView2.Name = "dataGridView2"; dataGridView2.Name = "dataGridView2";
dataGridView2.RowTemplate.Height = 25; dataGridView2.RowTemplate.Height = 25;
dataGridView2.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView2.Size = new Size(250, 235); dataGridView2.Size = new Size(250, 235);
dataGridView2.TabIndex = 6; dataGridView2.TabIndex = 6;
// //
@@ -113,15 +125,6 @@
label1.TabIndex = 7; label1.TabIndex = 7;
label1.Text = "Categorias"; 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 // FrmProductos
// //
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);

View File

@@ -106,7 +106,7 @@ namespace Vista
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
{ {
var form = new CategoriaCreate(); var form = new AddCategoria();
form.ShowDialog(); form.ShowDialog();
ActualizarGrilla(); ActualizarGrilla();
} }

View File

@@ -18,7 +18,7 @@
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>

View File

@@ -29,15 +29,15 @@
private void InitializeComponent() private void InitializeComponent()
{ {
groupBox1 = new GroupBox(); groupBox1 = new GroupBox();
dataGridView1 = new DataGridView(); dgvRemito = new DataGridView();
BtnAdd = new Button(); BtnAdd = new Button();
groupBox1.SuspendLayout(); groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit(); ((System.ComponentModel.ISupportInitialize)dgvRemito).BeginInit();
SuspendLayout(); SuspendLayout();
// //
// groupBox1 // groupBox1
// //
groupBox1.Controls.Add(dataGridView1); groupBox1.Controls.Add(dgvRemito);
groupBox1.Controls.Add(BtnAdd); groupBox1.Controls.Add(BtnAdd);
groupBox1.Location = new Point(12, 12); groupBox1.Location = new Point(12, 12);
groupBox1.Name = "groupBox1"; groupBox1.Name = "groupBox1";
@@ -45,15 +45,17 @@
groupBox1.TabIndex = 5; groupBox1.TabIndex = 5;
groupBox1.TabStop = false; groupBox1.TabStop = false;
// //
// dataGridView1 // dgvRemito
// //
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dgvRemito.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dgvRemito.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Location = new Point(6, 22); dgvRemito.EditMode = DataGridViewEditMode.EditProgrammatically;
dataGridView1.Name = "dataGridView1"; dgvRemito.Location = new Point(6, 22);
dataGridView1.RowTemplate.Height = 25; dgvRemito.Name = "dgvRemito";
dataGridView1.Size = new Size(550, 235); dgvRemito.RowTemplate.Height = 25;
dataGridView1.TabIndex = 3; dgvRemito.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dgvRemito.Size = new Size(550, 235);
dgvRemito.TabIndex = 3;
// //
// BtnAdd // BtnAdd
// //
@@ -74,14 +76,14 @@
Text = "Remitos"; Text = "Remitos";
WindowState = FormWindowState.Maximized; WindowState = FormWindowState.Maximized;
groupBox1.ResumeLayout(false); groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); ((System.ComponentModel.ISupportInitialize)dgvRemito).EndInit();
ResumeLayout(false); ResumeLayout(false);
} }
#endregion #endregion
private GroupBox groupBox1; private GroupBox groupBox1;
private DataGridView dataGridView1; private DataGridView dgvRemito;
private Button BtnAdd; private Button BtnAdd;
} }
} }

View File

@@ -18,7 +18,7 @@
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>

View File

@@ -1,3 +1,6 @@
using Controladora;
using Entidades;
namespace Vista namespace Vista
{ {
internal static class Program internal static class Program
@@ -10,8 +13,53 @@ namespace Vista
{ {
// To customize application configuration such as set high DPI settings or default font, // To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration. // see https://aka.ms/applicationconfiguration.
PrecargarDatos();
ApplicationConfiguration.Initialize(); ApplicationConfiguration.Initialize();
Application.Run(new PantallaPrincipal()); Application.Run(new PantallaPrincipal());
} }
private static void PrecargarDatos()
{
/*ControladoraClientes.Instance.A<>adir(new Cliente
{
Cuit = 0,
Apellido = " ",
Nombre = " ",
Correo = " ",
Direccion = " ",
Habilitado = true
});*/
ControladoraClientes.Instance.A<EFBFBD>adir(new Cliente{
Cuit = 23453659239,
Apellido = "Polidoro",
Nombre = "Federico",
Correo = "federico.nicolas.polidoro@gmail.com",
Direccion = "nose",
Habilitado = true
});
ControladoraClientes.Instance.A<EFBFBD>adir(new Cliente{
Cuit = 17385912736,
Apellido = "Diana",
Nombre = "Ignacio",
Correo = "Ignaciodiana@gmail.com",
Direccion = "nose",
Habilitado = true
});
ControladoraCategorias.Instance.A<EFBFBD>adir(new Entidades.Categoria{
Id = 1,
Descripcion = "Indumentaria"
});
ControladoraCategorias.Instance.A<EFBFBD>adir(new Entidades.Categoria
{
Id = 2,
Descripcion = "Perfumeria"
});
}
} }
} }

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<Compile Update="CategoriaCreate.cs"> <Compile Update="AddCategoria.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Update="AddProducto.cs"> <Compile Update="AddProducto.cs">