asdas
This commit is contained in:
7
Vista/FrmClientes.Designer.cs
generated
7
Vista/FrmClientes.Designer.cs
generated
@@ -65,7 +65,7 @@
|
||||
groupBox1.Controls.Add(BtnModificar);
|
||||
groupBox1.Location = new Point(12, 2);
|
||||
groupBox1.Name = "groupBox1";
|
||||
groupBox1.Size = new Size(776, 351);
|
||||
groupBox1.Size = new Size(1206, 341);
|
||||
groupBox1.TabIndex = 3;
|
||||
groupBox1.TabStop = false;
|
||||
//
|
||||
@@ -89,16 +89,15 @@
|
||||
dgvCliente.MultiSelect = false;
|
||||
dgvCliente.Name = "dgvCliente";
|
||||
dgvCliente.ReadOnly = true;
|
||||
dgvCliente.RowTemplate.Height = 25;
|
||||
dgvCliente.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvCliente.Size = new Size(737, 235);
|
||||
dgvCliente.Size = new Size(1194, 235);
|
||||
dgvCliente.TabIndex = 3;
|
||||
//
|
||||
// FrmClientes
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
ClientSize = new Size(1230, 509);
|
||||
Controls.Add(groupBox1);
|
||||
Name = "FrmClientes";
|
||||
Text = "Clientes";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<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="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>
|
||||
@@ -48,7 +48,7 @@
|
||||
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
|
||||
|
||||
8
Vista/FrmFacturas.Designer.cs
generated
8
Vista/FrmFacturas.Designer.cs
generated
@@ -48,7 +48,7 @@
|
||||
groupBox1.Controls.Add(BtnAdd);
|
||||
groupBox1.Location = new Point(12, 12);
|
||||
groupBox1.Name = "groupBox1";
|
||||
groupBox1.Size = new Size(1041, 426);
|
||||
groupBox1.Size = new Size(1223, 426);
|
||||
groupBox1.TabIndex = 5;
|
||||
groupBox1.TabStop = false;
|
||||
//
|
||||
@@ -80,9 +80,8 @@
|
||||
dgvDetalles.ImeMode = ImeMode.On;
|
||||
dgvDetalles.Location = new Point(520, 40);
|
||||
dgvDetalles.Name = "dgvDetalles";
|
||||
dgvDetalles.RowTemplate.Height = 25;
|
||||
dgvDetalles.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvDetalles.Size = new Size(384, 241);
|
||||
dgvDetalles.Size = new Size(697, 241);
|
||||
dgvDetalles.TabIndex = 4;
|
||||
//
|
||||
// dgvFacturas
|
||||
@@ -94,7 +93,6 @@
|
||||
dgvFacturas.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
dgvFacturas.Location = new Point(6, 40);
|
||||
dgvFacturas.Name = "dgvFacturas";
|
||||
dgvFacturas.RowTemplate.Height = 25;
|
||||
dgvFacturas.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvFacturas.Size = new Size(508, 241);
|
||||
dgvFacturas.TabIndex = 3;
|
||||
@@ -114,7 +112,7 @@
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(1068, 450);
|
||||
ClientSize = new Size(1247, 465);
|
||||
Controls.Add(groupBox1);
|
||||
Name = "FrmFacturas";
|
||||
Text = "Ventas";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<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="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>
|
||||
@@ -48,7 +48,7 @@
|
||||
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
|
||||
|
||||
@@ -151,7 +151,6 @@ namespace Vista
|
||||
{
|
||||
if (Validaciones()) return;
|
||||
|
||||
orden.Id = Convert.ToInt32(numId.Value);
|
||||
orden.Proveedor = (Proveedor)dgvProveedor.SelectedRows[0].DataBoundItem;
|
||||
string msg = ControladoraOrdenDeCompras.Instance.Añadir(orden);
|
||||
MessageBox.Show(msg);
|
||||
|
||||
14
Vista/FrmOrdenesDeCompras.Designer.cs
generated
14
Vista/FrmOrdenesDeCompras.Designer.cs
generated
@@ -50,7 +50,7 @@
|
||||
groupBox1.Controls.Add(BtnEliminar);
|
||||
groupBox1.Location = new Point(12, 3);
|
||||
groupBox1.Name = "groupBox1";
|
||||
groupBox1.Size = new Size(938, 351);
|
||||
groupBox1.Size = new Size(1211, 351);
|
||||
groupBox1.TabIndex = 4;
|
||||
groupBox1.TabStop = false;
|
||||
//
|
||||
@@ -66,7 +66,7 @@
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(404, 4);
|
||||
label1.Location = new Point(484, 4);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(48, 15);
|
||||
label1.TabIndex = 5;
|
||||
@@ -78,11 +78,10 @@
|
||||
dgvDetalles.AllowUserToDeleteRows = false;
|
||||
dgvDetalles.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgvDetalles.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
dgvDetalles.Location = new Point(404, 22);
|
||||
dgvDetalles.Location = new Point(484, 22);
|
||||
dgvDetalles.Name = "dgvDetalles";
|
||||
dgvDetalles.RowTemplate.Height = 25;
|
||||
dgvDetalles.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvDetalles.Size = new Size(525, 235);
|
||||
dgvDetalles.Size = new Size(714, 235);
|
||||
dgvDetalles.TabIndex = 4;
|
||||
//
|
||||
// dgvOrdenDeCompra
|
||||
@@ -94,9 +93,8 @@
|
||||
dgvOrdenDeCompra.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
dgvOrdenDeCompra.Location = new Point(6, 22);
|
||||
dgvOrdenDeCompra.Name = "dgvOrdenDeCompra";
|
||||
dgvOrdenDeCompra.RowTemplate.Height = 25;
|
||||
dgvOrdenDeCompra.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvOrdenDeCompra.Size = new Size(392, 235);
|
||||
dgvOrdenDeCompra.Size = new Size(472, 235);
|
||||
dgvOrdenDeCompra.TabIndex = 3;
|
||||
dgvOrdenDeCompra.CellClick += dgvOrdenDeCompra_CellClick;
|
||||
//
|
||||
@@ -124,7 +122,7 @@
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(953, 450);
|
||||
ClientSize = new Size(1250, 450);
|
||||
Controls.Add(groupBox1);
|
||||
Name = "FrmOrdenesDeCompras";
|
||||
Text = "OrdenDeCompra";
|
||||
|
||||
@@ -102,5 +102,7 @@ namespace Vista
|
||||
|| column.Name == "Cantidad" || column.Name == "SubTotal";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<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="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>
|
||||
@@ -48,7 +48,7 @@
|
||||
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
|
||||
|
||||
41
Vista/FrmPresupuesto.Designer.cs
generated
41
Vista/FrmPresupuesto.Designer.cs
generated
@@ -58,10 +58,9 @@
|
||||
dgvProducto.AllowUserToDeleteRows = false;
|
||||
dgvProducto.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgvProducto.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
dgvProducto.Location = new Point(631, 32);
|
||||
dgvProducto.Location = new Point(349, 32);
|
||||
dgvProducto.MultiSelect = false;
|
||||
dgvProducto.Name = "dgvProducto";
|
||||
dgvProducto.RowTemplate.Height = 25;
|
||||
dgvProducto.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvProducto.Size = new Size(347, 338);
|
||||
dgvProducto.TabIndex = 1;
|
||||
@@ -70,7 +69,7 @@
|
||||
// ID
|
||||
//
|
||||
ID.AutoSize = true;
|
||||
ID.Location = new Point(26, 20);
|
||||
ID.Location = new Point(119, 407);
|
||||
ID.Name = "ID";
|
||||
ID.Size = new Size(18, 15);
|
||||
ID.TabIndex = 2;
|
||||
@@ -79,7 +78,7 @@
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new Point(249, 14);
|
||||
label2.Location = new Point(12, 14);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(55, 15);
|
||||
label2.TabIndex = 3;
|
||||
@@ -87,7 +86,7 @@
|
||||
//
|
||||
// numId
|
||||
//
|
||||
numId.Location = new Point(50, 18);
|
||||
numId.Location = new Point(143, 405);
|
||||
numId.Maximum = new decimal(new int[] { 1410065407, 2, 0, 0 });
|
||||
numId.Name = "numId";
|
||||
numId.Size = new Size(120, 23);
|
||||
@@ -95,7 +94,7 @@
|
||||
//
|
||||
// btnGuardar
|
||||
//
|
||||
btnGuardar.Location = new Point(12, 407);
|
||||
btnGuardar.Location = new Point(14, 449);
|
||||
btnGuardar.Name = "btnGuardar";
|
||||
btnGuardar.Size = new Size(77, 26);
|
||||
btnGuardar.TabIndex = 9;
|
||||
@@ -105,7 +104,7 @@
|
||||
//
|
||||
// btnCerrar
|
||||
//
|
||||
btnCerrar.Location = new Point(892, 407);
|
||||
btnCerrar.Location = new Point(1159, 449);
|
||||
btnCerrar.Name = "btnCerrar";
|
||||
btnCerrar.Size = new Size(81, 26);
|
||||
btnCerrar.TabIndex = 10;
|
||||
@@ -115,7 +114,7 @@
|
||||
//
|
||||
// btnAddProducto
|
||||
//
|
||||
btnAddProducto.Location = new Point(12, 246);
|
||||
btnAddProducto.Location = new Point(520, 376);
|
||||
btnAddProducto.Name = "btnAddProducto";
|
||||
btnAddProducto.Size = new Size(115, 29);
|
||||
btnAddProducto.TabIndex = 11;
|
||||
@@ -125,7 +124,7 @@
|
||||
//
|
||||
// btnrmProducto
|
||||
//
|
||||
btnrmProducto.Location = new Point(12, 281);
|
||||
btnrmProducto.Location = new Point(520, 411);
|
||||
btnrmProducto.Name = "btnrmProducto";
|
||||
btnrmProducto.Size = new Size(115, 29);
|
||||
btnrmProducto.TabIndex = 12;
|
||||
@@ -139,29 +138,27 @@
|
||||
dgvProveedor.AllowUserToDeleteRows = false;
|
||||
dgvProveedor.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgvProveedor.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
dgvProveedor.Location = new Point(249, 32);
|
||||
dgvProveedor.Location = new Point(12, 32);
|
||||
dgvProveedor.MultiSelect = false;
|
||||
dgvProveedor.Name = "dgvProveedor";
|
||||
dgvProveedor.RowTemplate.Height = 25;
|
||||
dgvProveedor.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvProveedor.Size = new Size(376, 338);
|
||||
dgvProveedor.Size = new Size(331, 338);
|
||||
dgvProveedor.TabIndex = 13;
|
||||
dgvProveedor.CellClick += dgvProveedor_CellClick;
|
||||
//
|
||||
// dgvPedido
|
||||
//
|
||||
dgvPedido.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgvPedido.Location = new Point(11, 67);
|
||||
dgvPedido.Location = new Point(702, 32);
|
||||
dgvPedido.Name = "dgvPedido";
|
||||
dgvPedido.RowTemplate.Height = 25;
|
||||
dgvPedido.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvPedido.Size = new Size(227, 171);
|
||||
dgvPedido.Size = new Size(538, 408);
|
||||
dgvPedido.TabIndex = 14;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(626, 9);
|
||||
label1.Location = new Point(349, 14);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(56, 15);
|
||||
label1.TabIndex = 15;
|
||||
@@ -170,7 +167,7 @@
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new Point(11, 49);
|
||||
label3.Location = new Point(702, 14);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(44, 15);
|
||||
label3.TabIndex = 16;
|
||||
@@ -178,7 +175,7 @@
|
||||
//
|
||||
// numCantidad
|
||||
//
|
||||
numCantidad.Location = new Point(310, 376);
|
||||
numCantidad.Location = new Point(75, 376);
|
||||
numCantidad.Maximum = new decimal(new int[] { 1410065407, 2, 0, 0 });
|
||||
numCantidad.Name = "numCantidad";
|
||||
numCantidad.Size = new Size(120, 23);
|
||||
@@ -187,7 +184,7 @@
|
||||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Location = new Point(249, 378);
|
||||
label4.Location = new Point(14, 378);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new Size(55, 15);
|
||||
label4.TabIndex = 18;
|
||||
@@ -195,7 +192,7 @@
|
||||
//
|
||||
// numPreciopropuesto
|
||||
//
|
||||
numPreciopropuesto.Location = new Point(562, 376);
|
||||
numPreciopropuesto.Location = new Point(298, 378);
|
||||
numPreciopropuesto.Maximum = new decimal(new int[] { 1410065407, 2, 0, 0 });
|
||||
numPreciopropuesto.Name = "numPreciopropuesto";
|
||||
numPreciopropuesto.Size = new Size(120, 23);
|
||||
@@ -204,7 +201,7 @@
|
||||
// label5
|
||||
//
|
||||
label5.AutoSize = true;
|
||||
label5.Location = new Point(466, 378);
|
||||
label5.Location = new Point(202, 380);
|
||||
label5.Name = "label5";
|
||||
label5.Size = new Size(94, 15);
|
||||
label5.TabIndex = 20;
|
||||
@@ -216,7 +213,7 @@
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
CancelButton = btnCerrar;
|
||||
ClientSize = new Size(985, 445);
|
||||
ClientSize = new Size(1252, 484);
|
||||
Controls.Add(label5);
|
||||
Controls.Add(numPreciopropuesto);
|
||||
Controls.Add(label4);
|
||||
|
||||
@@ -42,32 +42,24 @@ namespace Vista
|
||||
|
||||
private void btnGuardar_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Crear una nueva instancia de Presupuesto
|
||||
var presupuesto = new Presupuesto();
|
||||
|
||||
// Obtener el ID del NumericUpDown
|
||||
int idPresupuesto = (int)numId.Value; // Asegúrate de que numId es el nombre correcto del NumericUpDown
|
||||
presupuesto.Id = idPresupuesto;
|
||||
|
||||
// Obtener la fecha actual
|
||||
presupuesto.Fecha = DateTime.Now;
|
||||
|
||||
// Obtener el proveedor seleccionado del DataGridView
|
||||
if (dgvProveedor.SelectedRows.Count == 0)
|
||||
{
|
||||
MessageBox.Show("Por favor, seleccione un proveedor.");
|
||||
return;
|
||||
}
|
||||
|
||||
var proveedorSeleccionado = (Proveedor)dgvProveedor.SelectedRows[0].DataBoundItem;
|
||||
presupuesto.Proveedor = proveedorSeleccionado;
|
||||
proveedorSeleccionado = ControladoraProveedores.Instance.Listar().First(x => x.Cuit == proveedorSeleccionado.Cuit);
|
||||
|
||||
// Obtener el estado habilitado y aceptado desde los controles si es necesario
|
||||
presupuesto.Habilitado = true; // Ajusta según el estado actual
|
||||
presupuesto.Aceptado = false; // Ajusta según el estado actual
|
||||
// Crear una nueva instancia de Presupuesto
|
||||
var presupuesto = new Presupuesto
|
||||
{
|
||||
Fecha = DateTime.Now,
|
||||
Proveedor = proveedorSeleccionado,
|
||||
Habilitado = true,
|
||||
Aceptado = false,
|
||||
};
|
||||
|
||||
// Aquí deberías tener la lógica para asegurarte de que los detalles están añadidos al presupuesto
|
||||
// Si ya tienes los detalles en un DataGridView, puedes hacerlo así:
|
||||
foreach (var detalle in GetDetallesFromDataGridView())
|
||||
{
|
||||
presupuesto.AñadirDetalle(detalle);
|
||||
@@ -134,7 +126,7 @@ namespace Vista
|
||||
// Crear el detalle del presupuesto
|
||||
DetallePresupuesto detalle = new DetallePresupuesto
|
||||
{
|
||||
Id = (int)numId.Value,
|
||||
Id = id++,
|
||||
Producto = producto,
|
||||
Cantidad = cantidad,
|
||||
MontoCUPropuesto = Convert.ToDouble(numPreciopropuesto.Value),
|
||||
@@ -153,11 +145,11 @@ namespace Vista
|
||||
dgvPedido.DataSource = presupuesto.MostrarDetalles();
|
||||
|
||||
// Configura las columnas a mostrar y sus encabezados
|
||||
foreach (DataGridViewColumn column in dgvPedido.Columns)
|
||||
{
|
||||
column.Visible = column.Name == "IdPresupuesto" || column.Name == "Cantidad"
|
||||
|| column.Name == "NombreDelProducto";
|
||||
}
|
||||
//foreach (DataGridViewColumn column in dgvPedido.Columns)
|
||||
//{
|
||||
// column.Visible = column.Name == "IdPresupuesto" || column.Name == "Cantidad"
|
||||
// || column.Name == "NombreDelProducto";
|
||||
//}
|
||||
}
|
||||
catch (OverflowException ex)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<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="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>
|
||||
@@ -48,7 +48,7 @@
|
||||
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
|
||||
|
||||
118
Vista/FrmProducto.Designer.cs
generated
118
Vista/FrmProducto.Designer.cs
generated
@@ -45,12 +45,12 @@
|
||||
dgvProveedor = new DataGridView();
|
||||
btnaddProveedor = new Button();
|
||||
btnrmProveedor = new Button();
|
||||
checkBox1 = new CheckBox();
|
||||
checkpercedero = new CheckBox();
|
||||
label8 = new Label();
|
||||
label9 = new Label();
|
||||
label10 = new Label();
|
||||
numericUpDown1 = new NumericUpDown();
|
||||
numericUpDown2 = new NumericUpDown();
|
||||
numConsumoPreferente = new NumericUpDown();
|
||||
numvencimiento = new NumericUpDown();
|
||||
cmbEnvase = new ComboBox();
|
||||
dgvCategoria = new DataGridView();
|
||||
label11 = new Label();
|
||||
@@ -61,8 +61,8 @@
|
||||
((System.ComponentModel.ISupportInitialize)numPrecio).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvProveedorAñadido).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvProveedor).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown2).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numConsumoPreferente).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numvencimiento).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvCategoria).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvCategoriaAñadida).BeginInit();
|
||||
SuspendLayout();
|
||||
@@ -148,9 +148,9 @@
|
||||
//
|
||||
// btnacept
|
||||
//
|
||||
btnacept.Location = new Point(13, 311);
|
||||
btnacept.Location = new Point(14, 475);
|
||||
btnacept.Name = "btnacept";
|
||||
btnacept.Size = new Size(72, 21);
|
||||
btnacept.Size = new Size(72, 30);
|
||||
btnacept.TabIndex = 10;
|
||||
btnacept.Text = "Aceptar";
|
||||
btnacept.UseVisualStyleBackColor = true;
|
||||
@@ -158,9 +158,9 @@
|
||||
//
|
||||
// btncancel
|
||||
//
|
||||
btncancel.Location = new Point(105, 311);
|
||||
btncancel.Location = new Point(92, 475);
|
||||
btncancel.Name = "btncancel";
|
||||
btncancel.Size = new Size(68, 21);
|
||||
btncancel.Size = new Size(69, 30);
|
||||
btncancel.TabIndex = 11;
|
||||
btncancel.Text = "Cancelar";
|
||||
btncancel.UseVisualStyleBackColor = true;
|
||||
@@ -169,7 +169,7 @@
|
||||
// label6
|
||||
//
|
||||
label6.AutoSize = true;
|
||||
label6.Location = new Point(652, 216);
|
||||
label6.Location = new Point(679, 275);
|
||||
label6.Name = "label6";
|
||||
label6.Size = new Size(123, 15);
|
||||
label6.TabIndex = 12;
|
||||
@@ -178,7 +178,7 @@
|
||||
// label7
|
||||
//
|
||||
label7.AutoSize = true;
|
||||
label7.Location = new Point(652, 9);
|
||||
label7.Location = new Point(679, 9);
|
||||
label7.Name = "label7";
|
||||
label7.Size = new Size(72, 15);
|
||||
label7.TabIndex = 13;
|
||||
@@ -190,25 +190,25 @@
|
||||
dgvProveedorAñadido.AllowUserToDeleteRows = false;
|
||||
dgvProveedorAñadido.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgvProveedorAñadido.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
dgvProveedorAñadido.Location = new Point(652, 234);
|
||||
dgvProveedorAñadido.Location = new Point(679, 293);
|
||||
dgvProveedorAñadido.Name = "dgvProveedorAñadido";
|
||||
dgvProveedorAñadido.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvProveedorAñadido.Size = new Size(240, 150);
|
||||
dgvProveedorAñadido.Size = new Size(510, 212);
|
||||
dgvProveedorAñadido.TabIndex = 14;
|
||||
//
|
||||
// dgvProveedor
|
||||
//
|
||||
dgvProveedor.AllowUserToAddRows = false;
|
||||
dgvProveedor.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgvProveedor.Location = new Point(652, 30);
|
||||
dgvProveedor.Location = new Point(679, 30);
|
||||
dgvProveedor.Name = "dgvProveedor";
|
||||
dgvProveedor.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvProveedor.Size = new Size(240, 150);
|
||||
dgvProveedor.Size = new Size(510, 215);
|
||||
dgvProveedor.TabIndex = 15;
|
||||
//
|
||||
// btnaddProveedor
|
||||
//
|
||||
btnaddProveedor.Location = new Point(652, 186);
|
||||
btnaddProveedor.Location = new Point(679, 251);
|
||||
btnaddProveedor.Name = "btnaddProveedor";
|
||||
btnaddProveedor.Size = new Size(72, 21);
|
||||
btnaddProveedor.TabIndex = 16;
|
||||
@@ -218,7 +218,7 @@
|
||||
//
|
||||
// btnrmProveedor
|
||||
//
|
||||
btnrmProveedor.Location = new Point(820, 186);
|
||||
btnrmProveedor.Location = new Point(757, 251);
|
||||
btnrmProveedor.Name = "btnrmProveedor";
|
||||
btnrmProveedor.Size = new Size(72, 21);
|
||||
btnrmProveedor.TabIndex = 17;
|
||||
@@ -226,21 +226,21 @@
|
||||
btnrmProveedor.UseVisualStyleBackColor = true;
|
||||
btnrmProveedor.Click += btnrmProveedor_Click;
|
||||
//
|
||||
// checkBox1
|
||||
// checkpercedero
|
||||
//
|
||||
checkBox1.AutoSize = true;
|
||||
checkBox1.Location = new Point(6, 183);
|
||||
checkBox1.Name = "checkBox1";
|
||||
checkBox1.Size = new Size(79, 19);
|
||||
checkBox1.TabIndex = 18;
|
||||
checkBox1.Text = "Percedero";
|
||||
checkBox1.UseVisualStyleBackColor = true;
|
||||
checkBox1.CheckedChanged += checkBox1_CheckedChanged;
|
||||
checkpercedero.AutoSize = true;
|
||||
checkpercedero.Location = new Point(14, 196);
|
||||
checkpercedero.Name = "checkpercedero";
|
||||
checkpercedero.Size = new Size(79, 19);
|
||||
checkpercedero.TabIndex = 18;
|
||||
checkpercedero.Text = "Percedero";
|
||||
checkpercedero.UseVisualStyleBackColor = true;
|
||||
checkpercedero.CheckedChanged += checkpercedero_CheckedChanged;
|
||||
//
|
||||
// label8
|
||||
//
|
||||
label8.AutoSize = true;
|
||||
label8.Location = new Point(24, 205);
|
||||
label8.Location = new Point(12, 218);
|
||||
label8.Name = "label8";
|
||||
label8.Size = new Size(185, 15);
|
||||
label8.TabIndex = 20;
|
||||
@@ -249,7 +249,7 @@
|
||||
// label9
|
||||
//
|
||||
label9.AutoSize = true;
|
||||
label9.Location = new Point(140, 264);
|
||||
label9.Location = new Point(128, 277);
|
||||
label9.Name = "label9";
|
||||
label9.Size = new Size(69, 15);
|
||||
label9.TabIndex = 21;
|
||||
@@ -258,35 +258,33 @@
|
||||
// label10
|
||||
//
|
||||
label10.AutoSize = true;
|
||||
label10.Location = new Point(67, 234);
|
||||
label10.Location = new Point(55, 247);
|
||||
label10.Name = "label10";
|
||||
label10.Size = new Size(142, 15);
|
||||
label10.TabIndex = 22;
|
||||
label10.Text = "Meses Hasta Vencimiento";
|
||||
//
|
||||
// numericUpDown1
|
||||
// numConsumoPreferente
|
||||
//
|
||||
numericUpDown1.Enabled = false;
|
||||
numericUpDown1.Location = new Point(229, 197);
|
||||
numericUpDown1.Name = "numericUpDown1";
|
||||
numericUpDown1.Size = new Size(120, 23);
|
||||
numericUpDown1.TabIndex = 23;
|
||||
numericUpDown1.ValueChanged += numericUpDown1_ValueChanged;
|
||||
numConsumoPreferente.Enabled = false;
|
||||
numConsumoPreferente.Location = new Point(217, 210);
|
||||
numConsumoPreferente.Name = "numConsumoPreferente";
|
||||
numConsumoPreferente.Size = new Size(120, 23);
|
||||
numConsumoPreferente.TabIndex = 23;
|
||||
//
|
||||
// numericUpDown2
|
||||
// numvencimiento
|
||||
//
|
||||
numericUpDown2.Enabled = false;
|
||||
numericUpDown2.Location = new Point(228, 227);
|
||||
numericUpDown2.Name = "numericUpDown2";
|
||||
numericUpDown2.Size = new Size(120, 23);
|
||||
numericUpDown2.TabIndex = 24;
|
||||
numericUpDown2.ValueChanged += numericUpDown2_ValueChanged;
|
||||
numvencimiento.Enabled = false;
|
||||
numvencimiento.Location = new Point(216, 240);
|
||||
numvencimiento.Name = "numvencimiento";
|
||||
numvencimiento.Size = new Size(120, 23);
|
||||
numvencimiento.TabIndex = 24;
|
||||
//
|
||||
// cmbEnvase
|
||||
//
|
||||
cmbEnvase.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cmbEnvase.FormattingEnabled = true;
|
||||
cmbEnvase.Location = new Point(227, 256);
|
||||
cmbEnvase.Location = new Point(215, 269);
|
||||
cmbEnvase.Name = "cmbEnvase";
|
||||
cmbEnvase.Size = new Size(121, 23);
|
||||
cmbEnvase.TabIndex = 25;
|
||||
@@ -300,13 +298,13 @@
|
||||
dgvCategoria.Location = new Point(373, 30);
|
||||
dgvCategoria.Name = "dgvCategoria";
|
||||
dgvCategoria.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvCategoria.Size = new Size(240, 150);
|
||||
dgvCategoria.Size = new Size(300, 215);
|
||||
dgvCategoria.TabIndex = 26;
|
||||
//
|
||||
// label11
|
||||
//
|
||||
label11.AutoSize = true;
|
||||
label11.Location = new Point(373, 216);
|
||||
label11.Location = new Point(373, 275);
|
||||
label11.Name = "label11";
|
||||
label11.Size = new Size(108, 15);
|
||||
label11.TabIndex = 27;
|
||||
@@ -318,29 +316,31 @@
|
||||
dgvCategoriaAñadida.AllowUserToDeleteRows = false;
|
||||
dgvCategoriaAñadida.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgvCategoriaAñadida.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
dgvCategoriaAñadida.Location = new Point(373, 234);
|
||||
dgvCategoriaAñadida.Location = new Point(373, 293);
|
||||
dgvCategoriaAñadida.Name = "dgvCategoriaAñadida";
|
||||
dgvCategoriaAñadida.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvCategoriaAñadida.Size = new Size(240, 150);
|
||||
dgvCategoriaAñadida.Size = new Size(300, 212);
|
||||
dgvCategoriaAñadida.TabIndex = 28;
|
||||
//
|
||||
// btnaddCategoria
|
||||
//
|
||||
btnaddCategoria.Location = new Point(373, 186);
|
||||
btnaddCategoria.Location = new Point(373, 251);
|
||||
btnaddCategoria.Name = "btnaddCategoria";
|
||||
btnaddCategoria.Size = new Size(72, 21);
|
||||
btnaddCategoria.TabIndex = 29;
|
||||
btnaddCategoria.Text = "Añadir";
|
||||
btnaddCategoria.UseVisualStyleBackColor = true;
|
||||
btnaddCategoria.Click += btnaddCategoria_Click;
|
||||
//
|
||||
// btnrmCategoria
|
||||
//
|
||||
btnrmCategoria.Location = new Point(541, 186);
|
||||
btnrmCategoria.Location = new Point(451, 251);
|
||||
btnrmCategoria.Name = "btnrmCategoria";
|
||||
btnrmCategoria.Size = new Size(72, 21);
|
||||
btnrmCategoria.TabIndex = 30;
|
||||
btnrmCategoria.Text = "Eliminar";
|
||||
btnrmCategoria.UseVisualStyleBackColor = true;
|
||||
btnrmCategoria.Click += btnrmCategoria_Click;
|
||||
//
|
||||
// FrmProducto
|
||||
//
|
||||
@@ -348,19 +348,19 @@
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
CancelButton = btncancel;
|
||||
ClientSize = new Size(1219, 517);
|
||||
ClientSize = new Size(1239, 517);
|
||||
Controls.Add(btnrmCategoria);
|
||||
Controls.Add(btnaddCategoria);
|
||||
Controls.Add(dgvCategoriaAñadida);
|
||||
Controls.Add(label11);
|
||||
Controls.Add(dgvCategoria);
|
||||
Controls.Add(cmbEnvase);
|
||||
Controls.Add(numericUpDown2);
|
||||
Controls.Add(numericUpDown1);
|
||||
Controls.Add(numvencimiento);
|
||||
Controls.Add(numConsumoPreferente);
|
||||
Controls.Add(label10);
|
||||
Controls.Add(label9);
|
||||
Controls.Add(label8);
|
||||
Controls.Add(checkBox1);
|
||||
Controls.Add(checkpercedero);
|
||||
Controls.Add(btnrmProveedor);
|
||||
Controls.Add(btnaddProveedor);
|
||||
Controls.Add(dgvProveedor);
|
||||
@@ -384,8 +384,8 @@
|
||||
((System.ComponentModel.ISupportInitialize)numPrecio).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvProveedorAñadido).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvProveedor).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown2).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numConsumoPreferente).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numvencimiento).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvCategoria).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvCategoriaAñadida).EndInit();
|
||||
ResumeLayout(false);
|
||||
@@ -411,12 +411,12 @@
|
||||
private DataGridView dgvProveedor;
|
||||
private Button btnaddProveedor;
|
||||
private Button btnrmProveedor;
|
||||
private CheckBox checkBox1;
|
||||
private CheckBox checkpercedero;
|
||||
private Label label8;
|
||||
private Label label9;
|
||||
private Label label10;
|
||||
private NumericUpDown numericUpDown1;
|
||||
private NumericUpDown numericUpDown2;
|
||||
private NumericUpDown numConsumoPreferente;
|
||||
private NumericUpDown numvencimiento;
|
||||
private ComboBox cmbEnvase;
|
||||
private DataGridView dgvCategoria;
|
||||
private Label label11;
|
||||
|
||||
@@ -20,13 +20,13 @@ namespace Vista
|
||||
public FrmProducto(Producto? producto = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
CargarCategorias();
|
||||
CargarNumid();
|
||||
CargarTabla();
|
||||
cargarcombo();
|
||||
|
||||
if (producto != null)
|
||||
{
|
||||
nuevoproducto = producto;
|
||||
nuevoproducto = ControladoraProductos.Instance.MostrarPorId(producto);
|
||||
mod = true;
|
||||
InicializarFormulario();
|
||||
}
|
||||
@@ -43,7 +43,19 @@ namespace Vista
|
||||
numPrecio.Value = (decimal)nuevoproducto.Precio;
|
||||
checkHabilitado.Checked = nuevoproducto.Habilitado;
|
||||
dgvProveedorAñadido.DataSource = nuevoproducto.proveedores.AsReadOnly();
|
||||
checkpercedero.Checked = nuevoproducto.EsPerecedero;
|
||||
checkpercedero.Enabled = false;
|
||||
|
||||
if (nuevoproducto.EsPerecedero)
|
||||
{
|
||||
var Prodperc = (ProductoPercedero)nuevoproducto;
|
||||
numConsumoPreferente.Value = Prodperc.MesesHastaConsumoPreferente;
|
||||
numvencimiento.Value = Prodperc.MesesHastaVencimiento;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void CargarTabla()
|
||||
@@ -52,16 +64,22 @@ namespace Vista
|
||||
dgvProveedor.DataSource = ControladoraProductos.Instance.ListarProveedores();
|
||||
if (mod)
|
||||
{
|
||||
foreach (Proveedor prov in ControladoraProductos.Instance.ListarProveedores(nuevoproducto))
|
||||
{
|
||||
nuevoproducto.AñadirProveedor(prov);
|
||||
}
|
||||
dgvProveedorAñadido.DataSource = ControladoraProductos.Instance.ListarProveedores(nuevoproducto);
|
||||
|
||||
}
|
||||
|
||||
dgvCategoria.DataSource = null;
|
||||
dgvCategoria.DataSource = ControladoraCategorias.Instance.Listar();
|
||||
if (mod)
|
||||
{
|
||||
dgvCategoriaAñadida.DataSource = ControladoraProductos.Instance.ListarCategorias(nuevoproducto);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void CargarCategorias()
|
||||
private void CargarNumid()
|
||||
{
|
||||
|
||||
var listprod = ControladoraProductos.Instance.Listar();
|
||||
numId.Value = (listprod.Count > 0) ?
|
||||
listprod.Max(x => x.Id + 1) :
|
||||
@@ -91,17 +109,17 @@ namespace Vista
|
||||
}
|
||||
|
||||
// Validar Categoría Seleccionada (wip)
|
||||
//devolucion += "Debe seleccionar una categoría.\n";
|
||||
//devolucion += "Debe seleccionar una categoría.\n";
|
||||
|
||||
// Validar Tipo de Producto
|
||||
if (!checkBox1.Checked && cmbEnvase.SelectedItem == null)
|
||||
if (!checkpercedero.Checked && cmbEnvase.SelectedItem == null)
|
||||
{
|
||||
devolucion += "Debe seleccionar un tipo de envase para el producto no perecedero.\n";
|
||||
}
|
||||
|
||||
if (checkBox1.Checked) // Producto Perecedero
|
||||
if (checkpercedero.Checked) // Producto Perecedero
|
||||
{
|
||||
if (numericUpDown1.Value <= 0 || numericUpDown2.Value <= 0)
|
||||
if (numConsumoPreferente.Value <= 0 || numvencimiento.Value <= 0)
|
||||
{
|
||||
devolucion += "Los meses hasta consumo preferente y vencimiento deben ser mayores a cero.\n";
|
||||
}
|
||||
@@ -123,23 +141,31 @@ namespace Vista
|
||||
if (ValidarDatos())
|
||||
{
|
||||
|
||||
if (checkBox1.Checked) // Producto Perecedero
|
||||
if (checkpercedero.Checked) // Producto Perecedero
|
||||
{
|
||||
var productoPerecedero = new ProductoPercedero
|
||||
{
|
||||
Id = (int)numId.Value,
|
||||
|
||||
Nombre = txtNombre.Text,
|
||||
Precio = (double)numPrecio.Value,
|
||||
Habilitado = checkHabilitado.Checked,
|
||||
MesesHastaConsumoPreferente = (int)numericUpDown1.Value,
|
||||
MesesHastaVencimiento = (int)numericUpDown2.Value,
|
||||
MesesHastaConsumoPreferente = (int)numConsumoPreferente.Value,
|
||||
MesesHastaVencimiento = (int)numvencimiento.Value,
|
||||
EsPerecedero = checkpercedero.Checked
|
||||
};
|
||||
|
||||
foreach (var proveedor in nuevoproducto.proveedores.AsReadOnly())
|
||||
if (mod) productoPerecedero.Id = (int)numId.Value;
|
||||
|
||||
foreach (var proveedor in nuevoproducto.proveedores)
|
||||
{
|
||||
productoPerecedero.AñadirProveedor(proveedor);
|
||||
}
|
||||
|
||||
foreach (var cat in nuevoproducto.categorias)
|
||||
{
|
||||
productoPerecedero.AñadirCategoria(cat);
|
||||
}
|
||||
|
||||
string mensaje = mod
|
||||
? ControladoraProductoPercedero.Instance.Modificar(productoPerecedero)
|
||||
: ControladoraProductoPercedero.Instance.Añadir(productoPerecedero);
|
||||
@@ -150,17 +176,23 @@ namespace Vista
|
||||
{
|
||||
var productoNoPerecedero = new ProductoNoPercedero
|
||||
{
|
||||
Id = (int)numId.Value,
|
||||
Nombre = txtNombre.Text,
|
||||
Precio = (double)numPrecio.Value,
|
||||
Habilitado = checkHabilitado.Checked,
|
||||
TipoDeEnvase = (EnvaseTipo)cmbEnvase.SelectedItem,
|
||||
};
|
||||
|
||||
foreach (var proveedor in nuevoproducto.proveedores.AsReadOnly())
|
||||
|
||||
if (mod) productoNoPerecedero.Id = (int)numId.Value;
|
||||
|
||||
foreach (var proveedor in nuevoproducto.proveedores)
|
||||
{
|
||||
productoNoPerecedero.AñadirProveedor(proveedor);
|
||||
}
|
||||
foreach (var cat in nuevoproducto.categorias)
|
||||
{
|
||||
productoNoPerecedero.AñadirCategoria(cat);
|
||||
}
|
||||
|
||||
string mensaje = mod
|
||||
? ControladoraProductoNoPercedero.Instance.Modificar(productoNoPerecedero)
|
||||
: ControladoraProductoNoPercedero.Instance.Añadir(productoNoPerecedero);
|
||||
@@ -177,11 +209,6 @@ namespace Vista
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void btnaddProveedor_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dgvProveedor.SelectedRows.Count > 0)
|
||||
@@ -205,7 +232,7 @@ namespace Vista
|
||||
MessageBox.Show("Por favor, selecciona una fila para añadir Proveedor al producto.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void btnrmProveedor_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -232,23 +259,62 @@ namespace Vista
|
||||
}
|
||||
}
|
||||
|
||||
private void checkBox1_CheckedChanged(object sender, EventArgs e)
|
||||
private void btnaddCategoria_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool esPerecedero = checkBox1.Checked;
|
||||
if (dgvCategoria.SelectedRows.Count > 0)
|
||||
{
|
||||
foreach (DataGridViewRow selectedRow in dgvCategoria.SelectedRows)
|
||||
{
|
||||
var cat = (Categoria)selectedRow.DataBoundItem;
|
||||
var checkcolicion = nuevoproducto.categorias.Contains(cat);
|
||||
if (checkcolicion)
|
||||
{
|
||||
MessageBox.Show("La Categoria ya fue cargada");
|
||||
return;
|
||||
}
|
||||
nuevoproducto.AñadirCategoria(cat);
|
||||
dgvCategoriaAñadida.DataSource = null;
|
||||
dgvCategoriaAñadida.DataSource = nuevoproducto.categorias.AsReadOnly();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Por favor, selecciona una fila para añadir Categoria al producto.");
|
||||
}
|
||||
}
|
||||
|
||||
numericUpDown1.Enabled = esPerecedero;
|
||||
numericUpDown2.Enabled = esPerecedero;
|
||||
private void checkpercedero_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
bool esPerecedero = checkpercedero.Checked;
|
||||
|
||||
numConsumoPreferente.Enabled = esPerecedero;
|
||||
numvencimiento.Enabled = esPerecedero;
|
||||
cmbEnvase.Enabled = !esPerecedero;
|
||||
}
|
||||
|
||||
private void numericUpDown2_ValueChanged(object sender, EventArgs e)
|
||||
private void btnrmCategoria_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
if (dgvCategoriaAñadida.SelectedRows.Count > 0)
|
||||
{
|
||||
foreach (DataGridViewRow selectedRow in dgvCategoriaAñadida.SelectedRows)
|
||||
{
|
||||
var cat = (Categoria)selectedRow.DataBoundItem;
|
||||
nuevoproducto.EliminarCategoria(cat);
|
||||
dgvCategoriaAñadida.DataSource = null;
|
||||
dgvCategoriaAñadida.DataSource = nuevoproducto.categorias.AsReadOnly();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Por favor, selecciona una fila para eliminar Categoria del producto.");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Error al eliminar proveedor: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
12
Vista/FrmProductos.Designer.cs
generated
12
Vista/FrmProductos.Designer.cs
generated
@@ -72,7 +72,7 @@
|
||||
groupBox1.Controls.Add(BtnEliminar);
|
||||
groupBox1.Location = new Point(12, 0);
|
||||
groupBox1.Name = "groupBox1";
|
||||
groupBox1.Size = new Size(1196, 305);
|
||||
groupBox1.Size = new Size(1258, 305);
|
||||
groupBox1.TabIndex = 5;
|
||||
groupBox1.TabStop = false;
|
||||
//
|
||||
@@ -106,7 +106,7 @@
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new Point(613, 9);
|
||||
label3.Location = new Point(675, 9);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(72, 15);
|
||||
label3.TabIndex = 10;
|
||||
@@ -115,7 +115,7 @@
|
||||
// dgvProveedores
|
||||
//
|
||||
dgvProveedores.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgvProveedores.Location = new Point(613, 22);
|
||||
dgvProveedores.Location = new Point(675, 22);
|
||||
dgvProveedores.Name = "dgvProveedores";
|
||||
dgvProveedores.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvProveedores.Size = new Size(577, 235);
|
||||
@@ -138,7 +138,7 @@
|
||||
dgvProductos.Location = new Point(6, 22);
|
||||
dgvProductos.Name = "dgvProductos";
|
||||
dgvProductos.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvProductos.Size = new Size(591, 235);
|
||||
dgvProductos.Size = new Size(663, 235);
|
||||
dgvProductos.TabIndex = 3;
|
||||
dgvProductos.CellClick += dgvProductos_CellClick;
|
||||
//
|
||||
@@ -187,6 +187,7 @@
|
||||
numConsumoPreferente.Enabled = false;
|
||||
numConsumoPreferente.Location = new Point(164, 33);
|
||||
numConsumoPreferente.Name = "numConsumoPreferente";
|
||||
numConsumoPreferente.ReadOnly = true;
|
||||
numConsumoPreferente.Size = new Size(120, 23);
|
||||
numConsumoPreferente.TabIndex = 15;
|
||||
//
|
||||
@@ -195,6 +196,7 @@
|
||||
numHastaVencimiento.Enabled = false;
|
||||
numHastaVencimiento.Location = new Point(164, 68);
|
||||
numHastaVencimiento.Name = "numHastaVencimiento";
|
||||
numHastaVencimiento.ReadOnly = true;
|
||||
numHastaVencimiento.Size = new Size(120, 23);
|
||||
numHastaVencimiento.TabIndex = 17;
|
||||
//
|
||||
@@ -261,7 +263,7 @@
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(1237, 616);
|
||||
ClientSize = new Size(1274, 616);
|
||||
Controls.Add(groupBox3);
|
||||
Controls.Add(groupBox2);
|
||||
Controls.Add(label1);
|
||||
|
||||
@@ -59,13 +59,6 @@ namespace Vista
|
||||
HeaderText = "Habilitado",
|
||||
Name = "Habilitado"
|
||||
};
|
||||
// Crear una columna para la categoría (mostrando la descripción)
|
||||
var colCategoria = new DataGridViewTextBoxColumn
|
||||
{
|
||||
DataPropertyName = "CategoriaDescripcion",
|
||||
HeaderText = "Categoría",
|
||||
Name = "Categoria"
|
||||
};
|
||||
|
||||
var colPercedero = new DataGridViewTextBoxColumn
|
||||
{
|
||||
@@ -80,20 +73,12 @@ namespace Vista
|
||||
dgvProductos.Columns.Add(colNombre);
|
||||
dgvProductos.Columns.Add(colPrecio);
|
||||
dgvProductos.Columns.Add(colHabilitado);
|
||||
dgvProductos.Columns.Add(colCategoria);
|
||||
dgvProductos.Columns.Add(colPercedero);
|
||||
}
|
||||
|
||||
private void ActualizarGrilla()
|
||||
{
|
||||
// Obtén todos los productos de la controladora o la fuente de datos
|
||||
var todosLosProductos = ControladoraProductos.Instance.Listar();
|
||||
|
||||
|
||||
dgvProductos.DataSource = null;
|
||||
dgvCategorias.DataSource = null;
|
||||
var categorias = ControladoraProductos.Instance.ListarCategorias();
|
||||
dgvCategorias.DataSource = categorias;
|
||||
|
||||
// Obtener la lista de productos y proyectar los datos
|
||||
var productos = ControladoraProductos.Instance.Listar()
|
||||
@@ -169,13 +154,17 @@ namespace Vista
|
||||
{
|
||||
Id = Convert.ToInt32(selectedRow.Cells["Id"].Value)
|
||||
};
|
||||
bool esPercedero = Convert.ToBoolean(selectedRow.Cells["EsPerecedero"].Value);
|
||||
|
||||
bool esPercedero = (ControladoraProductos.Instance.MostrarPorId(Producto).GetType().ToString() == "Entidades.ProductoPercedero") ?
|
||||
true : false;
|
||||
// Nacho evadamos usar esto porque da error mejor usa el classname
|
||||
//bool esPercedero = Convert.ToBoolean(selectedRow.Cells["EsPerecedero"].Value);
|
||||
if (esPercedero)
|
||||
{
|
||||
ProductoPercedero prod = (ProductoPercedero)ControladoraProductos.Instance.MostrarPorId(Producto);
|
||||
if (prod == null) return;
|
||||
|
||||
|
||||
|
||||
numConsumoPreferente.Value = prod.MesesHastaConsumoPreferente;
|
||||
numHastaVencimiento.Value = prod.MesesHastaVencimiento;
|
||||
|
||||
@@ -188,7 +177,7 @@ namespace Vista
|
||||
if (prod == null) return;
|
||||
|
||||
cmbTipoEnvase.Items.Clear();
|
||||
cmbTipoEnvase.Items.Add(prod.TipoDeEnvase.GetType().FullName);
|
||||
cmbTipoEnvase.Items.Add(prod.TipoDeEnvase.ToString());
|
||||
cmbTipoEnvase.SelectedIndex = 0;
|
||||
|
||||
numHastaVencimiento.Value = 0;
|
||||
@@ -211,10 +200,23 @@ namespace Vista
|
||||
{
|
||||
if (dgvProductos.SelectedRows.Count == 0) return;
|
||||
ActualizarGrillaProveedores();
|
||||
ActualizarGrillaCategorias();
|
||||
ActualizarGeneralizaciones();
|
||||
MostrarStock();
|
||||
}
|
||||
|
||||
private void ActualizarGrillaCategorias()
|
||||
{
|
||||
if (dgvProductos.SelectedRows.Count > 0)
|
||||
{
|
||||
Producto producto = new Producto
|
||||
{
|
||||
Id = Convert.ToInt32(dgvProductos.SelectedRows[0].Cells["Id"].Value),
|
||||
};
|
||||
dgvCategorias.DataSource = ControladoraProductos.Instance.ListarCategorias(producto);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnModificar_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dgvProductos.SelectedRows.Count < 1)
|
||||
@@ -226,9 +228,10 @@ namespace Vista
|
||||
Producto producto = new Producto
|
||||
{
|
||||
Id = Convert.ToInt32(dgvProductos.SelectedRows[0].Cells["Id"].Value),
|
||||
Nombre = dgvProductos.SelectedRows[0].Cells["Nombre"].Value as String,
|
||||
Precio = Convert.ToDouble(dgvProductos.SelectedRows[0].Cells["Precio"].Value),
|
||||
Habilitado = Convert.ToBoolean(dgvProductos.SelectedRows[0].Cells["Habilitado"].Value),
|
||||
//Nombre = dgvProductos.SelectedRows[0].Cells["Nombre"].Value as String,
|
||||
//Precio = Convert.ToDouble(dgvProductos.SelectedRows[0].Cells["Precio"].Value),
|
||||
//Habilitado = Convert.ToBoolean(dgvProductos.SelectedRows[0].Cells["Habilitado"].Value),
|
||||
//EsPerecedero = Convert.ToBoolean(dgvProductos.SelectedRows[0].Cells["EsPerecedero"].Value)
|
||||
};
|
||||
foreach (Proveedor prov in ControladoraProductos.Instance.ListarProveedores(producto))
|
||||
{
|
||||
|
||||
4
Vista/FrmProveedor.Designer.cs
generated
4
Vista/FrmProveedor.Designer.cs
generated
@@ -140,7 +140,7 @@
|
||||
//
|
||||
// BtnCancelar
|
||||
//
|
||||
BtnCancelar.Location = new Point(322, 195);
|
||||
BtnCancelar.Location = new Point(135, 195);
|
||||
BtnCancelar.Name = "BtnCancelar";
|
||||
BtnCancelar.Size = new Size(75, 23);
|
||||
BtnCancelar.TabIndex = 11;
|
||||
@@ -154,7 +154,7 @@
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
CancelButton = BtnCancelar;
|
||||
ClientSize = new Size(409, 230);
|
||||
ClientSize = new Size(228, 230);
|
||||
Controls.Add(BtnCancelar);
|
||||
Controls.Add(label4);
|
||||
Controls.Add(checkBoxHabilitado);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<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="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>
|
||||
@@ -48,7 +48,7 @@
|
||||
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
|
||||
|
||||
7
Vista/FrmProveedores.Designer.cs
generated
7
Vista/FrmProveedores.Designer.cs
generated
@@ -45,7 +45,7 @@
|
||||
groupBox1.Controls.Add(BtnModificar);
|
||||
groupBox1.Location = new Point(12, 12);
|
||||
groupBox1.Name = "groupBox1";
|
||||
groupBox1.Size = new Size(776, 351);
|
||||
groupBox1.Size = new Size(1228, 351);
|
||||
groupBox1.TabIndex = 5;
|
||||
groupBox1.TabStop = false;
|
||||
//
|
||||
@@ -60,9 +60,8 @@
|
||||
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.Size = new Size(1216, 235);
|
||||
dataGridView1.TabIndex = 3;
|
||||
//
|
||||
// BtnAdd
|
||||
@@ -99,7 +98,7 @@
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 382);
|
||||
ClientSize = new Size(1252, 382);
|
||||
Controls.Add(groupBox1);
|
||||
Name = "FrmProveedores";
|
||||
Text = "Proveedores";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
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
|
||||
|
||||
@@ -67,14 +67,12 @@ namespace Vista
|
||||
|
||||
var remito = new Remito
|
||||
{
|
||||
Id = Convert.ToInt32(numId.Value),
|
||||
Proveedor = orden.Proveedor
|
||||
};
|
||||
foreach (var detalle in ControladoraRemito.Instance.ListarDetallesOrdenesDeCompra(orden))
|
||||
{
|
||||
Lote lote = new Lote
|
||||
{
|
||||
Id = detalle.Id,
|
||||
Cantidad = detalle.Cantidad,
|
||||
Fecha = DateTime.Now,
|
||||
Habilitado = true,
|
||||
|
||||
11
Vista/FrmRemitos.Designer.cs
generated
11
Vista/FrmRemitos.Designer.cs
generated
@@ -53,7 +53,7 @@
|
||||
groupBox1.Controls.Add(BtnAdd);
|
||||
groupBox1.Location = new Point(12, 12);
|
||||
groupBox1.Name = "groupBox1";
|
||||
groupBox1.Size = new Size(1183, 432);
|
||||
groupBox1.Size = new Size(1257, 478);
|
||||
groupBox1.TabIndex = 5;
|
||||
groupBox1.TabStop = false;
|
||||
//
|
||||
@@ -91,11 +91,10 @@
|
||||
dgvTodosLotes.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||
dgvTodosLotes.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgvTodosLotes.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
dgvTodosLotes.Location = new Point(0, 319);
|
||||
dgvTodosLotes.Location = new Point(6, 319);
|
||||
dgvTodosLotes.Name = "dgvTodosLotes";
|
||||
dgvTodosLotes.RowTemplate.Height = 25;
|
||||
dgvTodosLotes.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvTodosLotes.Size = new Size(1171, 107);
|
||||
dgvTodosLotes.Size = new Size(1165, 153);
|
||||
dgvTodosLotes.TabIndex = 5;
|
||||
//
|
||||
// dgvDetallesRemito
|
||||
@@ -107,7 +106,6 @@
|
||||
dgvDetallesRemito.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
dgvDetallesRemito.Location = new Point(562, 22);
|
||||
dgvDetallesRemito.Name = "dgvDetallesRemito";
|
||||
dgvDetallesRemito.RowTemplate.Height = 25;
|
||||
dgvDetallesRemito.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvDetallesRemito.Size = new Size(609, 235);
|
||||
dgvDetallesRemito.TabIndex = 4;
|
||||
@@ -121,7 +119,6 @@
|
||||
dgvRemito.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
dgvRemito.Location = new Point(6, 22);
|
||||
dgvRemito.Name = "dgvRemito";
|
||||
dgvRemito.RowTemplate.Height = 25;
|
||||
dgvRemito.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvRemito.Size = new Size(550, 235);
|
||||
dgvRemito.TabIndex = 3;
|
||||
@@ -141,7 +138,7 @@
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(1281, 450);
|
||||
ClientSize = new Size(1281, 502);
|
||||
Controls.Add(groupBox1);
|
||||
Name = "FrmRemitos";
|
||||
Text = "Remitos";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<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="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>
|
||||
@@ -48,7 +48,7 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user