por ahora todo menos orden de compra y remito
This commit is contained in:
22
Vista/AddCategoria.Designer.cs
generated
22
Vista/AddCategoria.Designer.cs
generated
@@ -31,10 +31,10 @@
|
||||
button2 = new Button();
|
||||
label1 = new Label();
|
||||
label2 = new Label();
|
||||
numericUpDown1 = new NumericUpDown();
|
||||
numid = new NumericUpDown();
|
||||
textBox1 = new TextBox();
|
||||
button1 = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numid).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// button2
|
||||
@@ -65,13 +65,13 @@
|
||||
label2.TabIndex = 3;
|
||||
label2.Text = "Descripcion";
|
||||
//
|
||||
// numericUpDown1
|
||||
// numid
|
||||
//
|
||||
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;
|
||||
numid.Location = new Point(101, 23);
|
||||
numid.Maximum = new decimal(new int[] { 1215752191, 23, 0, 0 });
|
||||
numid.Name = "numid";
|
||||
numid.Size = new Size(120, 23);
|
||||
numid.TabIndex = 4;
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
@@ -97,13 +97,13 @@
|
||||
ClientSize = new Size(278, 235);
|
||||
Controls.Add(button1);
|
||||
Controls.Add(textBox1);
|
||||
Controls.Add(numericUpDown1);
|
||||
Controls.Add(numid);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(label1);
|
||||
Controls.Add(button2);
|
||||
Name = "AddCategoria";
|
||||
Text = "Form1";
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numid).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
@@ -112,7 +112,7 @@
|
||||
private Button button2;
|
||||
private Label label1;
|
||||
private Label label2;
|
||||
private NumericUpDown numericUpDown1;
|
||||
private NumericUpDown numid;
|
||||
private TextBox textBox1;
|
||||
private Button button1;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace Vista
|
||||
public AddCategoria()
|
||||
{
|
||||
InitializeComponent();
|
||||
CargarDatos();
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
@@ -27,11 +28,8 @@ namespace Vista
|
||||
}
|
||||
private void CargarDatos()
|
||||
{
|
||||
if (categoria != null)
|
||||
{
|
||||
textBox1.Text = categoria.Descripcion;
|
||||
numericUpDown1.Value = categoria.Id;
|
||||
}
|
||||
numid.Value = ControladoraCategorias.Instance.Listar().Max(x => x.Id+1);
|
||||
numid.Enabled = false;
|
||||
}
|
||||
|
||||
private bool ValidarDatos()
|
||||
@@ -44,7 +42,7 @@ namespace Vista
|
||||
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))
|
||||
if (categoria == null && ControladoraCategorias.Instance.Listar().Any(c => c.Id == (int)numid.Value))
|
||||
{
|
||||
devolucion += "Ya existe una categoría con el mismo ID\n";
|
||||
}
|
||||
@@ -71,7 +69,7 @@ namespace Vista
|
||||
{
|
||||
categoria = new Categoria
|
||||
{
|
||||
Id = (int)numericUpDown1.Value,
|
||||
Id = (int)numid.Value,
|
||||
Descripcion = textBox1.Text
|
||||
};
|
||||
|
||||
@@ -80,7 +78,7 @@ namespace Vista
|
||||
else
|
||||
{
|
||||
categoria.Descripcion = textBox1.Text;
|
||||
categoria.Id = (int)numericUpDown1.Value; // Solo si quieres permitir modificaciones del ID
|
||||
categoria.Id = (int)numid.Value; // Solo si quieres permitir modificaciones del ID
|
||||
|
||||
msg = ControladoraCategorias.Instance.Modificar(categoria);
|
||||
}
|
||||
|
||||
45
Vista/FrmModProducto.Designer.cs
generated
45
Vista/FrmModProducto.Designer.cs
generated
@@ -1,45 +0,0 @@
|
||||
namespace Vista
|
||||
{
|
||||
partial class FrmModProducto
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
SuspendLayout();
|
||||
//
|
||||
// FrmModProducto
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(527, 271);
|
||||
Name = "FrmModProducto";
|
||||
Text = "Form1";
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
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 FrmModProducto : Form
|
||||
{
|
||||
public FrmModProducto()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?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>
|
||||
52
Vista/FrmPresupuesto.Designer.cs
generated
52
Vista/FrmPresupuesto.Designer.cs
generated
@@ -42,11 +42,14 @@
|
||||
label3 = new Label();
|
||||
numCantidad = new NumericUpDown();
|
||||
label4 = new Label();
|
||||
numPreciopropuesto = new NumericUpDown();
|
||||
label5 = new Label();
|
||||
((System.ComponentModel.ISupportInitialize)dgvProducto).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numId).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvProveedor).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvPedido).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numCantidad).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numPreciopropuesto).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dgvProducto
|
||||
@@ -55,12 +58,12 @@
|
||||
dgvProducto.AllowUserToDeleteRows = false;
|
||||
dgvProducto.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgvProducto.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
dgvProducto.Location = new Point(227, 26);
|
||||
dgvProducto.Location = new Point(244, 26);
|
||||
dgvProducto.MultiSelect = false;
|
||||
dgvProducto.Name = "dgvProducto";
|
||||
dgvProducto.RowTemplate.Height = 25;
|
||||
dgvProducto.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvProducto.Size = new Size(275, 249);
|
||||
dgvProducto.Size = new Size(347, 338);
|
||||
dgvProducto.TabIndex = 1;
|
||||
dgvProducto.CellClick += dgvProducto_CellClick;
|
||||
//
|
||||
@@ -76,7 +79,7 @@
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new Point(508, 8);
|
||||
label2.Location = new Point(597, 8);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(55, 15);
|
||||
label2.TabIndex = 3;
|
||||
@@ -84,7 +87,7 @@
|
||||
//
|
||||
// numId
|
||||
//
|
||||
numId.Location = new Point(78, 26);
|
||||
numId.Location = new Point(50, 18);
|
||||
numId.Maximum = new decimal(new int[] { 1410065407, 2, 0, 0 });
|
||||
numId.Name = "numId";
|
||||
numId.Size = new Size(120, 23);
|
||||
@@ -92,7 +95,7 @@
|
||||
//
|
||||
// btnGuardar
|
||||
//
|
||||
btnGuardar.Location = new Point(11, 316);
|
||||
btnGuardar.Location = new Point(12, 407);
|
||||
btnGuardar.Name = "btnGuardar";
|
||||
btnGuardar.Size = new Size(77, 26);
|
||||
btnGuardar.TabIndex = 9;
|
||||
@@ -102,7 +105,7 @@
|
||||
//
|
||||
// btnCerrar
|
||||
//
|
||||
btnCerrar.Location = new Point(696, 316);
|
||||
btnCerrar.Location = new Point(892, 407);
|
||||
btnCerrar.Name = "btnCerrar";
|
||||
btnCerrar.Size = new Size(81, 26);
|
||||
btnCerrar.TabIndex = 10;
|
||||
@@ -136,12 +139,12 @@
|
||||
dgvProveedor.AllowUserToDeleteRows = false;
|
||||
dgvProveedor.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgvProveedor.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
dgvProveedor.Location = new Point(508, 26);
|
||||
dgvProveedor.Location = new Point(597, 26);
|
||||
dgvProveedor.MultiSelect = false;
|
||||
dgvProveedor.Name = "dgvProveedor";
|
||||
dgvProveedor.RowTemplate.Height = 25;
|
||||
dgvProveedor.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvProveedor.Size = new Size(269, 249);
|
||||
dgvProveedor.Size = new Size(376, 338);
|
||||
dgvProveedor.TabIndex = 13;
|
||||
//
|
||||
// dgvPedido
|
||||
@@ -151,13 +154,14 @@
|
||||
dgvPedido.Name = "dgvPedido";
|
||||
dgvPedido.RowTemplate.Height = 25;
|
||||
dgvPedido.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvPedido.Size = new Size(187, 171);
|
||||
dgvPedido.Size = new Size(227, 171);
|
||||
dgvPedido.TabIndex = 14;
|
||||
dgvPedido.CellContentClick += dgvPedido_CellContentClick;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(227, 8);
|
||||
label1.Location = new Point(244, 8);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(56, 15);
|
||||
label1.TabIndex = 15;
|
||||
@@ -174,7 +178,7 @@
|
||||
//
|
||||
// numCantidad
|
||||
//
|
||||
numCantidad.Location = new Point(317, 281);
|
||||
numCantidad.Location = new Point(310, 376);
|
||||
numCantidad.Maximum = new decimal(new int[] { 1410065407, 2, 0, 0 });
|
||||
numCantidad.Name = "numCantidad";
|
||||
numCantidad.Size = new Size(120, 23);
|
||||
@@ -183,19 +187,38 @@
|
||||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Location = new Point(227, 289);
|
||||
label4.Location = new Point(249, 378);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new Size(55, 15);
|
||||
label4.TabIndex = 18;
|
||||
label4.Text = "Cantidad";
|
||||
//
|
||||
// numPreciopropuesto
|
||||
//
|
||||
numPreciopropuesto.Location = new Point(562, 376);
|
||||
numPreciopropuesto.Maximum = new decimal(new int[] { 1410065407, 2, 0, 0 });
|
||||
numPreciopropuesto.Name = "numPreciopropuesto";
|
||||
numPreciopropuesto.Size = new Size(120, 23);
|
||||
numPreciopropuesto.TabIndex = 19;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
label5.AutoSize = true;
|
||||
label5.Location = new Point(466, 378);
|
||||
label5.Name = "label5";
|
||||
label5.Size = new Size(94, 15);
|
||||
label5.TabIndex = 20;
|
||||
label5.Text = "PrecioPropuesto";
|
||||
//
|
||||
// FrmPresupuesto
|
||||
//
|
||||
AcceptButton = btnGuardar;
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
CancelButton = btnCerrar;
|
||||
ClientSize = new Size(794, 351);
|
||||
ClientSize = new Size(985, 445);
|
||||
Controls.Add(label5);
|
||||
Controls.Add(numPreciopropuesto);
|
||||
Controls.Add(label4);
|
||||
Controls.Add(numCantidad);
|
||||
Controls.Add(label3);
|
||||
@@ -217,6 +240,7 @@
|
||||
((System.ComponentModel.ISupportInitialize)dgvProveedor).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvPedido).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numCantidad).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numPreciopropuesto).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
@@ -236,5 +260,7 @@
|
||||
private Label label3;
|
||||
private NumericUpDown numCantidad;
|
||||
private Label label4;
|
||||
private NumericUpDown numPreciopropuesto;
|
||||
private Label label5;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.DirectoryServices.ActiveDirectory;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -26,6 +27,12 @@ namespace Vista
|
||||
{
|
||||
dgvProducto.DataSource = null;
|
||||
dgvProducto.DataSource = ControladoraProductos.Instance.Listar();
|
||||
|
||||
var presupuestolist = ControladoraPresupuestos.Instance.Listar();
|
||||
numId.Value = (presupuestolist.Count > 0) ?
|
||||
presupuestolist.Max(x => x.Id + 1) :
|
||||
0;
|
||||
numId.Enabled = false;
|
||||
}
|
||||
|
||||
private void btnCerrar_Click(object sender, EventArgs e)
|
||||
@@ -35,50 +42,223 @@ 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;
|
||||
|
||||
// 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
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// Usar la controladora para guardar el presupuesto y sus detalles
|
||||
try
|
||||
{
|
||||
// Guardar el presupuesto usando la controladora
|
||||
string resultado = ControladoraPresupuestos.Instance.Añadir(presupuesto);
|
||||
MessageBox.Show(resultado);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Error al guardar el presupuesto: {ex.Message}");
|
||||
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
|
||||
|
||||
private List<DetallePresupuesto> GetDetallesFromDataGridView()
|
||||
{
|
||||
var detalles = new List<DetallePresupuesto>();
|
||||
|
||||
foreach (DataGridViewRow row in dgvPedido.Rows)
|
||||
{
|
||||
if (row.DataBoundItem is DetallePresupuesto detalle)
|
||||
{
|
||||
detalles.Add(detalle);
|
||||
}
|
||||
}
|
||||
|
||||
return detalles;
|
||||
}
|
||||
|
||||
private void btnAddProducto_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (VerificacionesDetalles()) return;
|
||||
|
||||
if (dgvProducto.SelectedRows.Count > 0 && dgvProveedor.SelectedRows.Count > 0)
|
||||
{
|
||||
var selectedRow = dgvProducto.SelectedRows[0] as DataGridViewRow;
|
||||
|
||||
Producto producto = (Producto)selectedRow.DataBoundItem;
|
||||
DetallePresupuesto detalle = new DetallePresupuesto
|
||||
{
|
||||
Id = id++,
|
||||
Producto = producto,
|
||||
Cantidad = Convert.ToInt32(numCantidad.Value),
|
||||
|
||||
};
|
||||
presupuesto.AñadirDetalle(detalle);
|
||||
dgvPedido.DataSource = null;
|
||||
dgvPedido.DataSource = presupuesto.MostrarDetalles();
|
||||
|
||||
try
|
||||
{
|
||||
// Verifica si el valor de numCantidad está dentro del rango válido para int
|
||||
int cantidad = Convert.ToInt32(numCantidad.Value);
|
||||
if (cantidad < int.MinValue || cantidad > int.MaxValue)
|
||||
{
|
||||
MessageBox.Show("La cantidad está fuera del rango permitido.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Verifica si el producto ya está en los detalles del presupuesto
|
||||
bool productoExistente = presupuesto.MostrarDetalles().Any(d => d.Producto.Id == producto.Id);
|
||||
if (productoExistente)
|
||||
{
|
||||
MessageBox.Show("El producto ya está agregado al presupuesto.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Crear el detalle del presupuesto
|
||||
DetallePresupuesto detalle = new DetallePresupuesto
|
||||
{
|
||||
Id = (int)numId.Value,
|
||||
Producto = producto,
|
||||
Cantidad = cantidad,
|
||||
MontoCUPropuesto = Convert.ToDouble(numPreciopropuesto.Value),
|
||||
IdPresupuesto = (int)numId.Value
|
||||
};
|
||||
|
||||
// Añadir el detalle al presupuesto
|
||||
presupuesto.AñadirDetalle(detalle);
|
||||
|
||||
// Actualizar el DataGridView
|
||||
dgvPedido.DataSource = null;
|
||||
dgvPedido.DataSource = presupuesto.MostrarDetalles();
|
||||
|
||||
// Configura las columnas a mostrar y sus encabezados
|
||||
dgvPedido.Columns["IDPresupuesto"].Visible = true;
|
||||
dgvPedido.Columns["Cantidad"].Visible = true;
|
||||
dgvPedido.Columns["NombreDelProducto"].Visible = true;
|
||||
|
||||
dgvPedido.Columns["IDPresupuesto"].HeaderText = "ID Presupuesto";
|
||||
dgvPedido.Columns["Cantidad"].HeaderText = "Cantidad";
|
||||
dgvPedido.Columns["NombreDelProducto"].HeaderText = "Producto";
|
||||
|
||||
// Oculta todas las demás columnas
|
||||
foreach (DataGridViewColumn column in dgvPedido.Columns)
|
||||
{
|
||||
if (column.Name != "IDPresupuesto" && column.Name != "Cantidad" && column.Name != "NombreDelProducto")
|
||||
{
|
||||
column.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (OverflowException ex)
|
||||
{
|
||||
MessageBox.Show($"Error de desbordamiento: {ex.Message}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Error al agregar producto: {ex.Message}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Por favor, selecciona una fila para eliminar Proveedor del producto.");
|
||||
MessageBox.Show("Por favor, selecciona una fila para agregar el producto.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private bool VerificacionesDetalles()
|
||||
{
|
||||
bool ret = false;
|
||||
return ret;
|
||||
string ret = "";
|
||||
|
||||
if (numCantidad.Value <= 0) ret += "Cantidad de productos invalida";
|
||||
if (numPreciopropuesto.Value <= 0) ret += "Precio C/U Invalido";
|
||||
|
||||
if (ret == "")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
MessageBox.Show("ret");
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
private bool VerificacionesPresupuesto()
|
||||
{
|
||||
bool ret = false;
|
||||
return ret;
|
||||
string ret = "";
|
||||
if (numId.Value < 0) ret += "No es un codigo id Valido";
|
||||
|
||||
if (ret == "")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
MessageBox.Show(ret); return true;
|
||||
}
|
||||
|
||||
private void btnrmProducto_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dgvPedido.SelectedRows.Count == 0)
|
||||
{
|
||||
MessageBox.Show("Por favor, seleccione un producto para eliminar.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Confirmar la eliminación
|
||||
var confirmResult = MessageBox.Show("¿Estás seguro de que quieres eliminar este producto del presupuesto?",
|
||||
"Confirmación de Eliminación",
|
||||
MessageBoxButtons.YesNo);
|
||||
if (confirmResult == DialogResult.Yes)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Obtener el detalle seleccionado
|
||||
var detalleSeleccionado = (DetallePresupuesto)dgvPedido.SelectedRows[0].DataBoundItem;
|
||||
|
||||
// Eliminar el detalle del presupuesto
|
||||
presupuesto.EliminarDetalle(detalleSeleccionado);
|
||||
|
||||
// Actualizar el DataGridView
|
||||
dgvPedido.DataSource = null;
|
||||
dgvPedido.DataSource = presupuesto.MostrarDetalles();
|
||||
|
||||
// Configura las columnas a mostrar y sus encabezados
|
||||
dgvPedido.Columns["IDPresupuesto"].Visible = true;
|
||||
dgvPedido.Columns["Cantidad"].Visible = true;
|
||||
dgvPedido.Columns["NombreDelProducto"].Visible = true;
|
||||
|
||||
dgvPedido.Columns["IDPresupuesto"].HeaderText = "ID Presupuesto";
|
||||
dgvPedido.Columns["Cantidad"].HeaderText = "Cantidad";
|
||||
dgvPedido.Columns["NombreDelProducto"].HeaderText = "Producto";
|
||||
|
||||
// Oculta todas las demás columnas
|
||||
foreach (DataGridViewColumn column in dgvPedido.Columns)
|
||||
{
|
||||
if (column.Name != "IDPresupuesto" && column.Name != "Cantidad" && column.Name != "NombreDelProducto")
|
||||
{
|
||||
column.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Error al eliminar el producto: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void dgvProducto_CellClick(object sender, DataGridViewCellEventArgs e)
|
||||
@@ -94,5 +274,10 @@ namespace Vista
|
||||
dgvProveedor.DataSource = ControladoraProductos.Instance.ListarProveedores(producto);
|
||||
}
|
||||
}
|
||||
|
||||
private void dgvPedido_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
54
Vista/FrmPresupuestos.Designer.cs
generated
54
Vista/FrmPresupuestos.Designer.cs
generated
@@ -29,6 +29,9 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
groupBox1 = new GroupBox();
|
||||
numtotal = new NumericUpDown();
|
||||
label3 = new Label();
|
||||
btnAceptarPresupuesto = new Button();
|
||||
label2 = new Label();
|
||||
label1 = new Label();
|
||||
dgvdetallesPresupuesto = new DataGridView();
|
||||
@@ -36,12 +39,16 @@
|
||||
BtnAdd = new Button();
|
||||
BtnEliminar = new Button();
|
||||
groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)numtotal).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvdetallesPresupuesto).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvPresupuestos).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
groupBox1.Controls.Add(numtotal);
|
||||
groupBox1.Controls.Add(label3);
|
||||
groupBox1.Controls.Add(btnAceptarPresupuesto);
|
||||
groupBox1.Controls.Add(label2);
|
||||
groupBox1.Controls.Add(label1);
|
||||
groupBox1.Controls.Add(dgvdetallesPresupuesto);
|
||||
@@ -50,14 +57,44 @@
|
||||
groupBox1.Controls.Add(BtnEliminar);
|
||||
groupBox1.Location = new Point(12, 2);
|
||||
groupBox1.Name = "groupBox1";
|
||||
groupBox1.Size = new Size(946, 377);
|
||||
groupBox1.Size = new Size(1102, 377);
|
||||
groupBox1.TabIndex = 4;
|
||||
groupBox1.TabStop = false;
|
||||
//
|
||||
// numtotal
|
||||
//
|
||||
numtotal.Enabled = false;
|
||||
numtotal.ImeMode = ImeMode.NoControl;
|
||||
numtotal.InterceptArrowKeys = false;
|
||||
numtotal.Location = new Point(665, 263);
|
||||
numtotal.Maximum = new decimal(new int[] { -727379969, 232, 0, 0 });
|
||||
numtotal.Name = "numtotal";
|
||||
numtotal.Size = new Size(120, 23);
|
||||
numtotal.TabIndex = 9;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new Point(624, 267);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(35, 15);
|
||||
label3.TabIndex = 8;
|
||||
label3.Text = "Total:";
|
||||
//
|
||||
// btnAceptarPresupuesto
|
||||
//
|
||||
btnAceptarPresupuesto.Location = new Point(456, 263);
|
||||
btnAceptarPresupuesto.Name = "btnAceptarPresupuesto";
|
||||
btnAceptarPresupuesto.Size = new Size(128, 23);
|
||||
btnAceptarPresupuesto.TabIndex = 7;
|
||||
btnAceptarPresupuesto.Text = "AceptarPresupuesto";
|
||||
btnAceptarPresupuesto.UseVisualStyleBackColor = true;
|
||||
btnAceptarPresupuesto.Click += btnAceptarPresupuesto_Click;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new Point(323, 4);
|
||||
label2.Location = new Point(481, 7);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(48, 15);
|
||||
label2.TabIndex = 6;
|
||||
@@ -76,11 +113,11 @@
|
||||
//
|
||||
dgvdetallesPresupuesto.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||
dgvdetallesPresupuesto.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgvdetallesPresupuesto.Location = new Point(323, 22);
|
||||
dgvdetallesPresupuesto.Location = new Point(456, 22);
|
||||
dgvdetallesPresupuesto.Name = "dgvdetallesPresupuesto";
|
||||
dgvdetallesPresupuesto.RowTemplate.Height = 25;
|
||||
dgvdetallesPresupuesto.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvdetallesPresupuesto.Size = new Size(321, 235);
|
||||
dgvdetallesPresupuesto.Size = new Size(640, 235);
|
||||
dgvdetallesPresupuesto.TabIndex = 4;
|
||||
//
|
||||
// dgvPresupuestos
|
||||
@@ -91,7 +128,7 @@
|
||||
dgvPresupuestos.Name = "dgvPresupuestos";
|
||||
dgvPresupuestos.RowTemplate.Height = 25;
|
||||
dgvPresupuestos.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvPresupuestos.Size = new Size(284, 235);
|
||||
dgvPresupuestos.Size = new Size(420, 235);
|
||||
dgvPresupuestos.TabIndex = 3;
|
||||
dgvPresupuestos.CellClick += dgvPresupuestos_CellClick;
|
||||
//
|
||||
@@ -113,18 +150,20 @@
|
||||
BtnEliminar.TabIndex = 2;
|
||||
BtnEliminar.Text = "Eliminar";
|
||||
BtnEliminar.UseVisualStyleBackColor = true;
|
||||
BtnEliminar.Click += BtnEliminar_Click;
|
||||
//
|
||||
// FrmPresupuestos
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(970, 450);
|
||||
ClientSize = new Size(1126, 450);
|
||||
Controls.Add(groupBox1);
|
||||
Name = "FrmPresupuestos";
|
||||
Text = "PedidosDePresupuestos";
|
||||
WindowState = FormWindowState.Maximized;
|
||||
groupBox1.ResumeLayout(false);
|
||||
groupBox1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)numtotal).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvdetallesPresupuesto).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgvPresupuestos).EndInit();
|
||||
ResumeLayout(false);
|
||||
@@ -139,5 +178,8 @@
|
||||
private DataGridView dgvdetallesPresupuesto;
|
||||
private Label label2;
|
||||
private Label label1;
|
||||
private Button btnAceptarPresupuesto;
|
||||
private NumericUpDown numtotal;
|
||||
private Label label3;
|
||||
}
|
||||
}
|
||||
@@ -17,31 +17,140 @@ namespace Vista
|
||||
public FrmPresupuestos()
|
||||
{
|
||||
InitializeComponent();
|
||||
ActualizarGrilla();
|
||||
}
|
||||
|
||||
private void ActualizarGrilla()
|
||||
{
|
||||
dgvPresupuestos.DataSource = null;
|
||||
dgvPresupuestos.DataSource = ControladoraPresupuestos.Instance.Listar();
|
||||
// Recupera la lista de presupuestos
|
||||
var presupuestos = ControladoraPresupuestos.Instance.Listar();
|
||||
|
||||
// Establece el DataSource del DataGridView
|
||||
dgvPresupuestos.DataSource = presupuestos;
|
||||
|
||||
// Asegúrate de que solo las columnas que deseas mostrar están visibles
|
||||
foreach (DataGridViewColumn column in dgvPresupuestos.Columns)
|
||||
{
|
||||
column.Visible = column.Name == "Id" || column.Name == "Fecha" || column.Name == "Habilitado"
|
||||
|| column.Name == "Aceptado" || column.Name == "Proveedor";
|
||||
}
|
||||
|
||||
// Configura el formato del proveedor para mostrar solo el nombre
|
||||
if (dgvPresupuestos.Columns["Proveedor"] != null)
|
||||
{
|
||||
dgvPresupuestos.Columns["Proveedor"].DefaultCellStyle.Format = "Proveedor";
|
||||
dgvPresupuestos.Columns["Proveedor"].ValueType = typeof(string);
|
||||
dgvPresupuestos.Columns["Proveedor"].HeaderText = "Proveedor";
|
||||
dgvPresupuestos.CellFormatting += (sender, e) =>
|
||||
{
|
||||
if (e.ColumnIndex == dgvPresupuestos.Columns["Proveedor"].Index)
|
||||
{
|
||||
var proveedor = e.Value as Proveedor;
|
||||
if (proveedor != null)
|
||||
{
|
||||
e.Value = proveedor.Nombre;
|
||||
e.FormattingApplied = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private void BtnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
var form = new FrmPresupuesto();
|
||||
form.ShowDialog();
|
||||
ActualizarGrilla();
|
||||
using (var form = new FrmPresupuesto())
|
||||
{
|
||||
form.ShowDialog();
|
||||
ActualizarGrilla();
|
||||
}
|
||||
}
|
||||
|
||||
private void dgvPresupuestos_CellClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
dgvdetallesPresupuesto.Rows.Clear();
|
||||
// Verifica si hay filas seleccionadas en dgvPresupuestos
|
||||
if (dgvPresupuestos.SelectedRows.Count == 0) return;
|
||||
|
||||
// Recupera el ID del presupuesto seleccionado
|
||||
int presupuestoId = Convert.ToInt32(dgvPresupuestos.SelectedRows[0].Cells["Id"].Value.ToString());
|
||||
|
||||
// recupera Presupuesto con el ID
|
||||
var presupuesto = ControladoraPresupuestos.Instance.Listar().First(x => x.Id == presupuestoId);
|
||||
//var presupuesto = new Presupuesto { Id = presupuestoId };
|
||||
|
||||
// Obtén los detalles del presupuesto usando el método de la controladora
|
||||
var detallesPresupuesto = ControladoraPresupuestos.Instance.ListarDetalles(presupuesto);
|
||||
|
||||
// Asigna la lista de detalles al DataSource de dgvdetallesPresupuesto
|
||||
dgvdetallesPresupuesto.DataSource = null;
|
||||
dgvdetallesPresupuesto.DataSource = detallesPresupuesto;
|
||||
|
||||
foreach (DataGridViewColumn column in dgvdetallesPresupuesto.Columns)
|
||||
{
|
||||
column.Visible = column.Name == "NombreDelProducto" || column.Name == "MontoCUPropuesto" || column.Name == "Cantidad"
|
||||
|| column.Name == "Subtotal";
|
||||
}
|
||||
|
||||
|
||||
numtotal.Value = Convert.ToDecimal(presupuesto.MostrarDetalles().Sum(x => x.Subtotal));
|
||||
// Asegúrate de que solo las columnas que deseas mostrar están visibles
|
||||
//foreach (DataGridViewColumn column in dgvdetallesPresupuesto.Columns)
|
||||
//{
|
||||
// column.Visible = column.Name == "NombreDelProducto" || column.Name == "Cantidad";
|
||||
//}
|
||||
}
|
||||
|
||||
private void BtnEliminar_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Verifica si hay filas seleccionadas en dgvPresupuestos
|
||||
if (dgvPresupuestos.SelectedRows.Count == 0)
|
||||
{
|
||||
MessageBox.Show("Por favor, selecciona un presupuesto para eliminar.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Recupera el ID del presupuesto seleccionado
|
||||
int presupuestoId = Convert.ToInt32(dgvPresupuestos.SelectedRows[0].Cells["Id"].Value.ToString());
|
||||
|
||||
// Crea un objeto de Presupuesto con el ID recuperado
|
||||
var presupuesto = new Presupuesto { Id = presupuestoId };
|
||||
|
||||
// Confirma la eliminación con el usuario
|
||||
var result = MessageBox.Show("¿Estás seguro de que deseas eliminar este presupuesto?", "Confirmar Eliminación", MessageBoxButtons.YesNo);
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Llama al método Eliminar de la controladora con el objeto Presupuesto
|
||||
ControladoraPresupuestos.Instance.Eliminar(presupuesto);
|
||||
|
||||
// Actualiza la grilla de presupuestos después de eliminar el presupuesto
|
||||
ActualizarGrilla();
|
||||
|
||||
// Limpia o actualiza el dgvDetalles para reflejar que el presupuesto ha sido eliminado
|
||||
dgvdetallesPresupuesto.DataSource = null; // O actualiza el datasource si tienes uno
|
||||
|
||||
MessageBox.Show("Presupuesto eliminado exitosamente.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Error al eliminar el presupuesto: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAceptarPresupuesto_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dgvPresupuestos.SelectedRows.Count == 0)
|
||||
{
|
||||
MessageBox.Show("Por favor, selecciona un presupuesto para aceptar.");
|
||||
return;
|
||||
}
|
||||
if (dgvPresupuestos.SelectedRows.Count > 0)
|
||||
{
|
||||
Presupuesto presupuesto = new Presupuesto
|
||||
{
|
||||
Id = Convert.ToInt32(dgvPresupuestos.SelectedRows[0].Cells["Id"].Value.ToString()),
|
||||
};
|
||||
dgvdetallesPresupuesto.DataSource = ControladoraPresupuestos.Instance.ListarDetalles(presupuesto);
|
||||
Presupuesto prep = dgvPresupuestos.SelectedRows[0].DataBoundItem as Presupuesto;
|
||||
string msg = ControladoraPresupuestos.Instance.AceptarPresupuesto(prep);
|
||||
MessageBox.Show(msg);
|
||||
ActualizarGrilla();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
Vista/FrmProducto.Designer.cs
generated
2
Vista/FrmProducto.Designer.cs
generated
@@ -123,6 +123,8 @@
|
||||
// checkHabilitado
|
||||
//
|
||||
checkHabilitado.AutoSize = true;
|
||||
checkHabilitado.Checked = true;
|
||||
checkHabilitado.CheckState = CheckState.Checked;
|
||||
checkHabilitado.Location = new Point(71, 112);
|
||||
checkHabilitado.Name = "checkHabilitado";
|
||||
checkHabilitado.Size = new Size(15, 14);
|
||||
|
||||
@@ -67,6 +67,12 @@ namespace Vista
|
||||
|
||||
// Asignar la lista de categorías al ComboBox
|
||||
cmbCategoria.DataSource = categorias;
|
||||
|
||||
var listprod = ControladoraProductos.Instance.Listar();
|
||||
numId.Value = (listprod.Count > 0) ?
|
||||
listprod.Max(x => x.Id + 1) :
|
||||
0;
|
||||
numId.Enabled = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,8 +81,8 @@ namespace Vista
|
||||
string devolucion = "";
|
||||
|
||||
// Validar Nombre
|
||||
if (string.IsNullOrEmpty(txtNombre.Text)) { devolucion += "El nombre del producto no puede estar vacío.\n"; }
|
||||
if (txtNombre.Text.Length > 100) { devolucion += "El nombre del producto no puede superar los 100 caracteres.\n"; }
|
||||
if (string.IsNullOrEmpty(txtNombre.Text)) { devolucion += "El nombre del producto no puede estar vacío.\n"; }
|
||||
if (txtNombre.Text.Length > 100) { devolucion += "El nombre del producto no puede superar los 100 caracteres.\n"; }
|
||||
if (numId.Value <= 0) { devolucion += "NO es un cuit válido"; };
|
||||
|
||||
// Validar Precio
|
||||
@@ -199,5 +205,5 @@ namespace Vista
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
Vista/FrmProveedor.Designer.cs
generated
2
Vista/FrmProveedor.Designer.cs
generated
@@ -121,6 +121,8 @@
|
||||
// checkBoxHabilitado
|
||||
//
|
||||
checkBoxHabilitado.AutoSize = true;
|
||||
checkBoxHabilitado.Checked = true;
|
||||
checkBoxHabilitado.CheckState = CheckState.Checked;
|
||||
checkBoxHabilitado.Location = new Point(110, 154);
|
||||
checkBoxHabilitado.Name = "checkBoxHabilitado";
|
||||
checkBoxHabilitado.Size = new Size(15, 14);
|
||||
|
||||
18
Vista/PantallaPrincipal.Designer.cs
generated
18
Vista/PantallaPrincipal.Designer.cs
generated
@@ -62,50 +62,50 @@
|
||||
// clientesToolStripMenuItem
|
||||
//
|
||||
clientesToolStripMenuItem.Name = "clientesToolStripMenuItem";
|
||||
clientesToolStripMenuItem.Size = new Size(181, 22);
|
||||
clientesToolStripMenuItem.Size = new Size(180, 22);
|
||||
clientesToolStripMenuItem.Text = "Clientes";
|
||||
clientesToolStripMenuItem.Click += clientesToolStripMenuItem_Click;
|
||||
//
|
||||
// ventasToolStripMenuItem
|
||||
//
|
||||
ventasToolStripMenuItem.Name = "ventasToolStripMenuItem";
|
||||
ventasToolStripMenuItem.Size = new Size(181, 22);
|
||||
ventasToolStripMenuItem.Size = new Size(180, 22);
|
||||
ventasToolStripMenuItem.Text = "Ventas";
|
||||
ventasToolStripMenuItem.Click += ventasToolStripMenuItem_Click;
|
||||
//
|
||||
// proveedoresToolStripMenuItem
|
||||
//
|
||||
proveedoresToolStripMenuItem.Name = "proveedoresToolStripMenuItem";
|
||||
proveedoresToolStripMenuItem.Size = new Size(181, 22);
|
||||
proveedoresToolStripMenuItem.Size = new Size(180, 22);
|
||||
proveedoresToolStripMenuItem.Text = "Proveedores";
|
||||
proveedoresToolStripMenuItem.Click += proveedoresToolStripMenuItem_Click;
|
||||
//
|
||||
// productosToolStripMenuItem
|
||||
//
|
||||
productosToolStripMenuItem.Name = "productosToolStripMenuItem";
|
||||
productosToolStripMenuItem.Size = new Size(181, 22);
|
||||
productosToolStripMenuItem.Size = new Size(180, 22);
|
||||
productosToolStripMenuItem.Text = "Productos";
|
||||
productosToolStripMenuItem.Click += productosToolStripMenuItem_Click;
|
||||
//
|
||||
// remitosToolStripMenuItem
|
||||
//
|
||||
remitosToolStripMenuItem.Name = "remitosToolStripMenuItem";
|
||||
remitosToolStripMenuItem.Size = new Size(181, 22);
|
||||
remitosToolStripMenuItem.Size = new Size(180, 22);
|
||||
remitosToolStripMenuItem.Text = "Remitos";
|
||||
remitosToolStripMenuItem.Click += remitosToolStripMenuItem_Click;
|
||||
//
|
||||
// ordenDeCompraToolStripMenuItem
|
||||
//
|
||||
ordenDeCompraToolStripMenuItem.Name = "ordenDeCompraToolStripMenuItem";
|
||||
ordenDeCompraToolStripMenuItem.Size = new Size(181, 22);
|
||||
ordenDeCompraToolStripMenuItem.Size = new Size(180, 22);
|
||||
ordenDeCompraToolStripMenuItem.Text = "OrdenDeCompra";
|
||||
ordenDeCompraToolStripMenuItem.Click += ordenDeCompraToolStripMenuItem_Click;
|
||||
//
|
||||
// pedidosPresupuestoToolStripMenuItem
|
||||
//
|
||||
pedidosPresupuestoToolStripMenuItem.Name = "pedidosPresupuestoToolStripMenuItem";
|
||||
pedidosPresupuestoToolStripMenuItem.Size = new Size(181, 22);
|
||||
pedidosPresupuestoToolStripMenuItem.Text = "PedidosPresupuesto";
|
||||
pedidosPresupuestoToolStripMenuItem.Size = new Size(180, 22);
|
||||
pedidosPresupuestoToolStripMenuItem.Text = "Presupuesto";
|
||||
pedidosPresupuestoToolStripMenuItem.Click += pedidosPresupuestoToolStripMenuItem_Click;
|
||||
//
|
||||
// configToolStripMenuItem
|
||||
@@ -118,7 +118,7 @@
|
||||
// informesToolStripMenuItem
|
||||
//
|
||||
informesToolStripMenuItem.Name = "informesToolStripMenuItem";
|
||||
informesToolStripMenuItem.Size = new Size(180, 22);
|
||||
informesToolStripMenuItem.Size = new Size(121, 22);
|
||||
informesToolStripMenuItem.Text = "Informes";
|
||||
informesToolStripMenuItem.Click += informesToolStripMenuItem_Click;
|
||||
//
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -30,7 +30,16 @@ namespace Vista
|
||||
|
||||
};
|
||||
ControladoraProveedores.Instance.A<EFBFBD>adir(proveedor);
|
||||
Proveedor proveedor2 = new Proveedor
|
||||
{
|
||||
Cuit = 357618653,
|
||||
Direccion = "San Martin 2261",
|
||||
Nombre = "Arrollito Deport",
|
||||
Habilitado = true,
|
||||
RazonSocial = "Vende Ropa Deportiva"
|
||||
|
||||
};
|
||||
ControladoraProveedores.Instance.A<EFBFBD>adir(proveedor2);
|
||||
ControladoraClientes.Instance.A<EFBFBD>adir(new Cliente{
|
||||
Cuit = 23453659239,
|
||||
Apellido = "Polidoro",
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
<Compile Update="AddProducto.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="FrmModProducto.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="FrmCliente.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -14,4 +14,4 @@ build_property.PlatformNeutralAssembly =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = Vista
|
||||
build_property.ProjectDir = C:\Users\fedpo\Downloads\final actual\Vista\
|
||||
build_property.ProjectDir = C:\Users\fedpo\Desktop\final actual\Vista\
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Vista\\Vista.csproj": {}
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Vista\\Vista.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Controladora\\Controladora.csproj": {
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Controladora\\Controladora.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\final actual\\Controladora\\Controladora.csproj",
|
||||
"projectUniqueName": "C:\\Users\\fedpo\\Desktop\\final actual\\Controladora\\Controladora.csproj",
|
||||
"projectName": "Controladora",
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Controladora\\Controladora.csproj",
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Controladora\\Controladora.csproj",
|
||||
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
|
||||
"outputPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Controladora\\obj\\",
|
||||
"outputPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Controladora\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
@@ -29,11 +29,11 @@
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\Entidades.csproj"
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\Entidades.csproj"
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Modelo\\Modelo.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Modelo\\Modelo.csproj"
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Modelo\\Modelo.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Modelo\\Modelo.csproj"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,14 +67,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\Entidades.csproj",
|
||||
"projectUniqueName": "C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\Entidades.csproj",
|
||||
"projectName": "Entidades",
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\Entidades.csproj",
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\Entidades.csproj",
|
||||
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
|
||||
"outputPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\obj\\",
|
||||
"outputPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
@@ -123,14 +123,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Informes\\Informes.csproj": {
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Informes\\Informes.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\final actual\\Informes\\Informes.csproj",
|
||||
"projectUniqueName": "C:\\Users\\fedpo\\Desktop\\final actual\\Informes\\Informes.csproj",
|
||||
"projectName": "Informes",
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Informes\\Informes.csproj",
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Informes\\Informes.csproj",
|
||||
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
|
||||
"outputPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Informes\\obj\\",
|
||||
"outputPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Informes\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
@@ -148,8 +148,8 @@
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\Entidades.csproj"
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\Entidades.csproj"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -183,14 +183,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Modelo\\Modelo.csproj": {
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Modelo\\Modelo.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\final actual\\Modelo\\Modelo.csproj",
|
||||
"projectUniqueName": "C:\\Users\\fedpo\\Desktop\\final actual\\Modelo\\Modelo.csproj",
|
||||
"projectName": "Modelo",
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Modelo\\Modelo.csproj",
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Modelo\\Modelo.csproj",
|
||||
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
|
||||
"outputPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Modelo\\obj\\",
|
||||
"outputPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Modelo\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
@@ -208,8 +208,8 @@
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\Entidades.csproj"
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\Entidades.csproj"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,14 +243,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Vista\\Vista.csproj": {
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Vista\\Vista.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\final actual\\Vista\\Vista.csproj",
|
||||
"projectUniqueName": "C:\\Users\\fedpo\\Desktop\\final actual\\Vista\\Vista.csproj",
|
||||
"projectName": "Vista",
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Vista\\Vista.csproj",
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Vista\\Vista.csproj",
|
||||
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
|
||||
"outputPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Vista\\obj\\",
|
||||
"outputPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Vista\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
@@ -268,14 +268,14 @@
|
||||
"net6.0-windows7.0": {
|
||||
"targetAlias": "net6.0-windows",
|
||||
"projectReferences": {
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Controladora\\Controladora.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Controladora\\Controladora.csproj"
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Controladora\\Controladora.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Controladora\\Controladora.csproj"
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\Entidades.csproj"
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\Entidades.csproj"
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Informes\\Informes.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Informes\\Informes.csproj"
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Informes\\Informes.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Informes\\Informes.csproj"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,11 +89,11 @@
|
||||
"project": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\final actual\\Vista\\Vista.csproj",
|
||||
"projectUniqueName": "C:\\Users\\fedpo\\Desktop\\final actual\\Vista\\Vista.csproj",
|
||||
"projectName": "Vista",
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Vista\\Vista.csproj",
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Vista\\Vista.csproj",
|
||||
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
|
||||
"outputPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Vista\\obj\\",
|
||||
"outputPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Vista\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
@@ -111,14 +111,14 @@
|
||||
"net6.0-windows7.0": {
|
||||
"targetAlias": "net6.0-windows",
|
||||
"projectReferences": {
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Controladora\\Controladora.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Controladora\\Controladora.csproj"
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Controladora\\Controladora.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Controladora\\Controladora.csproj"
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Entidades\\Entidades.csproj"
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Entidades\\Entidades.csproj"
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\Informes\\Informes.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\Informes\\Informes.csproj"
|
||||
"C:\\Users\\fedpo\\Desktop\\final actual\\Informes\\Informes.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Desktop\\final actual\\Informes\\Informes.csproj"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "u13WwQGaPCePxL1JyQkpyhXuHxLQ97k9ktwi/o+F5Yk11GsR1/fPqs1rMKxJn/R3EX1AhoyxsvvOwv1MhGTPhQ==",
|
||||
"dgSpecHash": "vcS5lpIADFtfq+AnGiCn0g/8Q8gOfpje1KTkyYWSQG9Zd8VQZ9XqR1JPYwzwVH4W0VNzNWT7Sd2NeeOhsH0YCA==",
|
||||
"success": true,
|
||||
"projectFilePath": "C:\\Users\\fedpo\\Downloads\\final actual\\Vista\\Vista.csproj",
|
||||
"projectFilePath": "C:\\Users\\fedpo\\Desktop\\final actual\\Vista\\Vista.csproj",
|
||||
"expectedPackageFiles": [],
|
||||
"logs": []
|
||||
}
|
||||
Reference in New Issue
Block a user