Compare commits
6 Commits
informes
...
82ef086a3b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82ef086a3b | ||
|
|
a3b7e9bfc4 | ||
|
|
90affbb581 | ||
|
|
fa75f93a7a | ||
|
|
bcc8a26a9d | ||
| c0891ec427 |
@@ -1,42 +0,0 @@
|
|||||||
using System.Collections.ObjectModel;
|
|
||||||
using Entidades;
|
|
||||||
using Modelo;
|
|
||||||
|
|
||||||
namespace Controladora
|
|
||||||
{
|
|
||||||
public class ControladoraPedidoDePresupuestos : Singleton<ControladoraPedidoDePresupuestos>
|
|
||||||
{
|
|
||||||
public string Añadir(PedidoDePresupuesto t)
|
|
||||||
{
|
|
||||||
if (t == null) return "El PedidoDePresupuesto es nulo fallo la carga";
|
|
||||||
|
|
||||||
return (RepositorioPedidoDePresupuesto.Instance.Add(t)) ?
|
|
||||||
$"El PedidoDePresupuesto {t.Id} se cargo correctamente":
|
|
||||||
$"Fallo la carga del PedidoDePresupuesto {t.Id}";
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Eliminar(PedidoDePresupuesto t)
|
|
||||||
{
|
|
||||||
if (t == null) return "El PedidoDePresupuesto es nulo fallo la carga";
|
|
||||||
|
|
||||||
return (RepositorioPedidoDePresupuesto.Instance.Del(t)) ?
|
|
||||||
$"El PedidoDePresupuesto {t.Id} se Elimino correctamente":
|
|
||||||
$"Fallo la Eliminacion del PedidoDePresupuesto {t.Id}";
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Modificar(PedidoDePresupuesto t)
|
|
||||||
{
|
|
||||||
if (t == null) return "El PedidoDePresupuesto es nulo fallo la carga";
|
|
||||||
|
|
||||||
return (RepositorioPedidoDePresupuesto.Instance.Mod(t)) ?
|
|
||||||
$"El PedidoDePresupuesto {t.Id} se Modifico correctamente":
|
|
||||||
$"Fallo la Modificacion del PedidoDePresupuesto {t.Id}";
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReadOnlyCollection<PedidoDePresupuesto> Listar()
|
|
||||||
{
|
|
||||||
return RepositorioPedidoDePresupuesto.Instance.Listar();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -37,5 +37,13 @@ namespace Controladora
|
|||||||
{
|
{
|
||||||
return RepositorioPresupuesto.Instance.Listar();
|
return RepositorioPresupuesto.Instance.Listar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ReadOnlyCollection<DetallePresupuesto> ListarDetalles(Presupuesto presupuesto)
|
||||||
|
{
|
||||||
|
Presupuesto pres = RepositorioPresupuesto.Instance.Listar().First(x=> x.Id == presupuesto.Id);
|
||||||
|
if (pres == null) return new ReadOnlyCollection<DetallePresupuesto>(new List<DetallePresupuesto>());
|
||||||
|
return pres.MostrarDetalles();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,13 @@ namespace Controladora
|
|||||||
return RepositorioProductos.Instance.Listar();
|
return RepositorioProductos.Instance.Listar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ReadOnlyCollection<Proveedor> ListarProveedores(Producto producto)
|
||||||
|
{
|
||||||
|
Producto productoalistar = RepositorioProductos.Instance.Listar().First(x => x.Id == producto.Id);
|
||||||
|
if (productoalistar == null) return new ReadOnlyCollection<Proveedor>(new List<Proveedor>());
|
||||||
|
return productoalistar.ListarProveedores();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1 @@
|
|||||||
<<<<<<< HEAD
|
39c8634b9e930bb7c3ea67187f4543b71aaf8be2
|
||||||
07cbdde4e47ec2d3a6db548797ff84a15aa08946633217fe5ed64773b3cc8491
|
|
||||||
=======
|
|
||||||
a7a9c23e29aac78d8fc99e5e2578c73ffe3d4cba
|
|
||||||
>>>>>>> 5b78d74e54350285696596720e82f5fbd99b4d02
|
|
||||||
|
|||||||
@@ -1,122 +1,3 @@
|
|||||||
C:\Users\Nacho\Desktop\verdadero\Controladora\bin\Debug\net6.0\Controladora.deps.json
|
|
||||||
C:\Users\Nacho\Desktop\verdadero\Controladora\bin\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\verdadero\Controladora\bin\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\Nacho\Desktop\verdadero\Controladora\obj\Debug\net6.0\Controladora.csproj.AssemblyReference.cache
|
|
||||||
C:\Users\Nacho\Desktop\verdadero\Controladora\obj\Debug\net6.0\Controladora.GeneratedMSBuildEditorConfig.editorconfig
|
|
||||||
C:\Users\Nacho\Desktop\verdadero\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfoInputs.cache
|
|
||||||
C:\Users\Nacho\Desktop\verdadero\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfo.cs
|
|
||||||
C:\Users\Nacho\Desktop\verdadero\Controladora\obj\Debug\net6.0\Controladora.csproj.CoreCompileInputs.cache
|
|
||||||
C:\Users\Nacho\Desktop\verdadero\Controladora\obj\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\verdadero\Controladora\obj\Debug\net6.0\refint\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\verdadero\Controladora\obj\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\Nacho\Desktop\verdadero\Controladora\obj\Debug\net6.0\ref\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\obj\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\obj\Debug\net6.0\refint\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\obj\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\Nacho\source\repos\Final\Controladora\obj\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\Nacho\source\repos\Final\Controladora\obj\Debug\net6.0\refint\Controladora.dll
|
|
||||||
C:\Users\Nacho\source\repos\Final\Controladora\obj\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\obj\Debug\net6.0\refint\Controladora.dll
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\bin\Debug\net6.0\Controladora.deps.json
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\bin\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\bin\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\bin\Debug\net6.0\Entidades.dll
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\bin\Debug\net6.0\Modelo.dll
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\bin\Debug\net6.0\Modelo.pdb
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\bin\Debug\net6.0\Entidades.pdb
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.csproj.AssemblyReference.cache
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.GeneratedMSBuildEditorConfig.editorconfig
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfoInputs.cache
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfo.cs
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.csproj.CoreCompileInputs.cache
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\obj\Debug\net6.0\Controla.1EE7A4DA.Up2Date
|
|
||||||
C:\Users\Nacho\Source\Repos\Final_OOP\Controladora\obj\Debug\net6.0\ref\Controladora.dll
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\bin\Debug\net6.0\Controladora.deps.json
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\bin\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\bin\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\bin\Debug\net6.0\Entidades.dll
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\bin\Debug\net6.0\Modelo.dll
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\bin\Debug\net6.0\Modelo.pdb
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\bin\Debug\net6.0\Entidades.pdb
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.csproj.AssemblyReference.cache
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.GeneratedMSBuildEditorConfig.editorconfig
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfoInputs.cache
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfo.cs
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.csproj.CoreCompileInputs.cache
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.csproj.CopyComplete
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\obj\Debug\net6.0\refint\Controladora.dll
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\obj\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\fedpo\source\repos\Final_OOP\Controladora\obj\Debug\net6.0\ref\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\bin\Debug\net6.0\Controladora.deps.json
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\bin\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\bin\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\bin\Debug\net6.0\Entidades.dll
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\bin\Debug\net6.0\Modelo.dll
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\bin\Debug\net6.0\Modelo.pdb
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\bin\Debug\net6.0\Entidades.pdb
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\obj\Debug\net6.0\Controladora.csproj.AssemblyReference.cache
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\obj\Debug\net6.0\Controladora.GeneratedMSBuildEditorConfig.editorconfig
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfoInputs.cache
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfo.cs
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\obj\Debug\net6.0\Controladora.csproj.CoreCompileInputs.cache
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\obj\Debug\net6.0\Controla.1EE7A4DA.Up2Date
|
|
||||||
C:\Users\Nacho\Desktop\Final\Controladora\obj\Debug\net6.0\ref\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\bin\Debug\net6.0\Controladora.deps.json
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\bin\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\bin\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\bin\Debug\net6.0\Entidades.dll
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\bin\Debug\net6.0\Modelo.dll
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\bin\Debug\net6.0\Modelo.pdb
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\bin\Debug\net6.0\Entidades.pdb
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\obj\Debug\net6.0\Controladora.csproj.AssemblyReference.cache
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\obj\Debug\net6.0\Controladora.GeneratedMSBuildEditorConfig.editorconfig
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfoInputs.cache
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfo.cs
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\obj\Debug\net6.0\Controladora.csproj.CoreCompileInputs.cache
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\obj\Debug\net6.0\Controla.1EE7A4DA.Up2Date
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\obj\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\obj\Debug\net6.0\refint\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\obj\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\Nacho\Desktop\ASDDD\Final\Controladora\obj\Debug\net6.0\ref\Controladora.dll
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\bin\Debug\net6.0\Controladora.deps.json
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\bin\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\bin\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\bin\Debug\net6.0\Entidades.dll
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\bin\Debug\net6.0\Modelo.dll
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\bin\Debug\net6.0\Modelo.pdb
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\bin\Debug\net6.0\Entidades.pdb
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\obj\Debug\net6.0\Controladora.csproj.AssemblyReference.cache
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\obj\Debug\net6.0\Controladora.GeneratedMSBuildEditorConfig.editorconfig
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfoInputs.cache
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfo.cs
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\obj\Debug\net6.0\Controladora.csproj.CoreCompileInputs.cache
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\obj\Debug\net6.0\Controladora.csproj.CopyComplete
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\obj\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\obj\Debug\net6.0\refint\Controladora.dll
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\obj\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\fedpo\Downloads\Final\Final\Controladora\obj\Debug\net6.0\ref\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\bin\Debug\net6.0\Controladora.deps.json
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\bin\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\bin\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\bin\Debug\net6.0\Entidades.dll
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\bin\Debug\net6.0\Modelo.dll
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\bin\Debug\net6.0\Modelo.pdb
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\bin\Debug\net6.0\Entidades.pdb
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\Controladora.csproj.AssemblyReference.cache
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\Controladora.GeneratedMSBuildEditorConfig.editorconfig
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfoInputs.cache
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\Controladora.AssemblyInfo.cs
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\Controladora.csproj.CoreCompileInputs.cache
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\Controla.1EE7A4DA.Up2Date
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\refint\Controladora.dll
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\Controladora.pdb
|
|
||||||
C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\ref\Controladora.dll
|
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\bin\Debug\net6.0\Controladora.deps.json
|
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\bin\Debug\net6.0\Controladora.deps.json
|
||||||
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\bin\Debug\net6.0\Controladora.dll
|
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\bin\Debug\net6.0\Controladora.dll
|
||||||
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\bin\Debug\net6.0\Controladora.pdb
|
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\bin\Debug\net6.0\Controladora.pdb
|
||||||
@@ -134,4 +15,3 @@ C:\Users\fedpo\Downloads\final actual\final actual\Controladora\obj\Debug\net6.0
|
|||||||
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\obj\Debug\net6.0\refint\Controladora.dll
|
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\obj\Debug\net6.0\refint\Controladora.dll
|
||||||
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\obj\Debug\net6.0\Controladora.pdb
|
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\obj\Debug\net6.0\Controladora.pdb
|
||||||
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\obj\Debug\net6.0\ref\Controladora.dll
|
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\obj\Debug\net6.0\ref\Controladora.dll
|
||||||
>>>>>>> 5b78d74e54350285696596720e82f5fbd99b4d02
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +0,0 @@
|
|||||||
// <autogenerated />
|
|
||||||
using System;
|
|
||||||
using System.Reflection;
|
|
||||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// Este código fue generado por una herramienta.
|
|
||||||
// Versión de runtime:4.0.30319.42000
|
|
||||||
//
|
|
||||||
// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
|
|
||||||
// se vuelve a generar el código.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Controladora")]
|
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+abfd18e86f40a98925507ec03c2e8832ee47a3eb")]
|
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("Controladora")]
|
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("Controladora")]
|
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
|
||||||
|
|
||||||
// Generado por la clase WriteCodeFragment de MSBuild.
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
1300c7ac552248a2e20058b6f2d7f7eb38539ca91bc222d9d6bfd7bbcb24e9ab
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
is_global = true
|
|
||||||
build_property.TargetFramework = net6.0
|
|
||||||
build_property.TargetPlatformMinVersion =
|
|
||||||
build_property.UsingMicrosoftNETSdkWeb =
|
|
||||||
build_property.ProjectTypeGuids =
|
|
||||||
build_property.InvariantGlobalization =
|
|
||||||
build_property.PlatformNeutralAssembly =
|
|
||||||
build_property.EnforceExtendedAnalyzerRules =
|
|
||||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
|
||||||
build_property.RootNamespace = Controladora
|
|
||||||
build_property.ProjectDir = C:\Users\Nacho\source\repos\Final\Controladora\
|
|
||||||
build_property.EnableComHosting =
|
|
||||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
// <auto-generated/>
|
|
||||||
global using global::System;
|
|
||||||
global using global::System.Collections.Generic;
|
|
||||||
global using global::System.IO;
|
|
||||||
global using global::System.Linq;
|
|
||||||
global using global::System.Net.Http;
|
|
||||||
global using global::System.Threading;
|
|
||||||
global using global::System.Threading.Tasks;
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,10 +0,0 @@
|
|||||||
|
|
||||||
namespace Entidades
|
|
||||||
{
|
|
||||||
public class DetallePedido : Detalle<Producto>
|
|
||||||
{
|
|
||||||
public int IdPedido { get; set; }
|
|
||||||
public int CantidadPedido { get; set; }
|
|
||||||
public List<Producto> Productos { get; set; } = new List<Producto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,6 +4,5 @@ namespace Entidades
|
|||||||
public class DetallePresupuesto: Detalle<Producto>
|
public class DetallePresupuesto: Detalle<Producto>
|
||||||
{
|
{
|
||||||
public int IdPresupuesto { get; set; }
|
public int IdPresupuesto { get; set; }
|
||||||
public double CostoUnitario { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ namespace Entidades
|
|||||||
{
|
{
|
||||||
get { return Producto?.Nombre ?? string.Empty; }
|
get { return Producto?.Nombre ?? string.Empty; }
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
public double PrecioUnitario
|
public double PrecioUnitario
|
||||||
{
|
{
|
||||||
get { return Producto?.Precio ?? 0; }
|
get { return Producto?.Precio ?? 0; }
|
||||||
@@ -21,8 +20,6 @@ namespace Entidades
|
|||||||
{
|
{
|
||||||
get { return PrecioUnitario * CantidadDeProductos; }
|
get { return PrecioUnitario * CantidadDeProductos; }
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
>>>>>>> 5b78d74e54350285696596720e82f5fbd99b4d02
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
using System.Collections.ObjectModel;
|
|
||||||
|
|
||||||
namespace Entidades
|
|
||||||
{
|
|
||||||
public class PedidoDePresupuesto
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
|
||||||
public DateTime Fecha { get; set; }
|
|
||||||
private List<DetallePedido> detallesPedidos = new List<DetallePedido>();
|
|
||||||
public Proveedor Proveedor { get; set; }
|
|
||||||
|
|
||||||
public void AñadirDetalle(DetallePedido detalle)
|
|
||||||
{
|
|
||||||
detallesPedidos.Add(detalle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool EliminarDetalle(DetallePedido detalle)
|
|
||||||
{
|
|
||||||
var aeliminar = detallesPedidos.Find(x => x.Id == detalle.Id);
|
|
||||||
if (aeliminar == null) return false;
|
|
||||||
return detallesPedidos.Remove(aeliminar);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReadOnlyCollection<DetallePedido> MostrarDetalles()
|
|
||||||
{
|
|
||||||
return detallesPedidos.AsReadOnly();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,6 +9,23 @@ namespace Entidades
|
|||||||
public double Precio { get; set; }
|
public double Precio { get; set; }
|
||||||
public bool Habilitado { get; set; }
|
public bool Habilitado { get; set; }
|
||||||
public Categoria Categoria { get; set; }
|
public Categoria Categoria { get; set; }
|
||||||
|
private List<Proveedor> proveedores = new List<Proveedor>();
|
||||||
|
|
||||||
|
public void AñadirProveedor(Proveedor proveedor)
|
||||||
|
{
|
||||||
|
if(proveedor == null) return;
|
||||||
|
proveedores.Add(proveedor);
|
||||||
|
}
|
||||||
|
public bool EliminarProveedor(Proveedor proveedor)
|
||||||
|
{
|
||||||
|
var pAEliminar = proveedores.FirstOrDefault(x => x.Cuit == proveedor.Cuit);
|
||||||
|
if (pAEliminar == null) return false;
|
||||||
|
return proveedores.Remove(pAEliminar);
|
||||||
|
}
|
||||||
|
public ReadOnlyCollection<Proveedor> ListarProveedores()
|
||||||
|
{
|
||||||
|
return proveedores.AsReadOnly();
|
||||||
|
}
|
||||||
private List<Categoria> categorias = new List<Categoria>();
|
private List<Categoria> categorias = new List<Categoria>();
|
||||||
|
|
||||||
public void AñadirCategoria(Categoria cat) {
|
public void AñadirCategoria(Categoria cat) {
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,72 +0,0 @@
|
|||||||
using System.Collections.ObjectModel;
|
|
||||||
using Entidades;
|
|
||||||
|
|
||||||
namespace Modelo
|
|
||||||
{
|
|
||||||
public sealed class RepositorioPedidoDePresupuesto : RepositorioBase<PedidoDePresupuesto, RepositorioPedidoDePresupuesto>
|
|
||||||
{
|
|
||||||
override public bool Add(PedidoDePresupuesto t)
|
|
||||||
{
|
|
||||||
bool ret = false;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
almacen.Add(t);
|
|
||||||
ret = true;
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
override public bool Mod(PedidoDePresupuesto t)
|
|
||||||
{
|
|
||||||
bool ret = false;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var pedidoAModificar = almacen.FindIndex(x => x.Id == t.Id);
|
|
||||||
if (pedidoAModificar > -1)
|
|
||||||
{
|
|
||||||
almacen[pedidoAModificar] = t;
|
|
||||||
ret = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
override public bool Del(PedidoDePresupuesto t)
|
|
||||||
{
|
|
||||||
bool ret = false;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var pedidoAEliminar = almacen.Find(x => x.Id == t.Id);
|
|
||||||
if (pedidoAEliminar != null)
|
|
||||||
{
|
|
||||||
almacen.Remove(pedidoAEliminar);
|
|
||||||
ret = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReadOnlyCollection<DetallePedido> MostrarDetalles(PedidoDePresupuesto pedido)
|
|
||||||
{
|
|
||||||
return pedido.MostrarDetalles();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
115
Vista/FrmPedidosDePresupuestos.Designer.cs
generated
115
Vista/FrmPedidosDePresupuestos.Designer.cs
generated
@@ -1,115 +0,0 @@
|
|||||||
namespace Vista
|
|
||||||
{
|
|
||||||
partial class FrmPedidosDePresupuestos
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Required designer variable.
|
|
||||||
/// </summary>
|
|
||||||
private System.ComponentModel.IContainer components = null;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clean up any resources being used.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
|
||||||
protected override void Dispose(bool disposing)
|
|
||||||
{
|
|
||||||
if (disposing && (components != null))
|
|
||||||
{
|
|
||||||
components.Dispose();
|
|
||||||
}
|
|
||||||
base.Dispose(disposing);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Required method for Designer support - do not modify
|
|
||||||
/// the contents of this method with the code editor.
|
|
||||||
/// </summary>
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
groupBox1 = new GroupBox();
|
|
||||||
dataGridView1 = new DataGridView();
|
|
||||||
BtnAdd = new Button();
|
|
||||||
BtnEliminar = new Button();
|
|
||||||
dataGridView2 = new DataGridView();
|
|
||||||
groupBox1.SuspendLayout();
|
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
|
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView2).BeginInit();
|
|
||||||
SuspendLayout();
|
|
||||||
//
|
|
||||||
// groupBox1
|
|
||||||
//
|
|
||||||
groupBox1.Controls.Add(dataGridView2);
|
|
||||||
groupBox1.Controls.Add(dataGridView1);
|
|
||||||
groupBox1.Controls.Add(BtnAdd);
|
|
||||||
groupBox1.Controls.Add(BtnEliminar);
|
|
||||||
groupBox1.Location = new Point(12, 2);
|
|
||||||
groupBox1.Name = "groupBox1";
|
|
||||||
groupBox1.Size = new Size(946, 377);
|
|
||||||
groupBox1.TabIndex = 4;
|
|
||||||
groupBox1.TabStop = false;
|
|
||||||
//
|
|
||||||
// dataGridView1
|
|
||||||
//
|
|
||||||
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
|
||||||
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
|
||||||
dataGridView1.Location = new Point(6, 22);
|
|
||||||
dataGridView1.Name = "dataGridView1";
|
|
||||||
dataGridView1.RowTemplate.Height = 25;
|
|
||||||
dataGridView1.Size = new Size(284, 235);
|
|
||||||
dataGridView1.TabIndex = 3;
|
|
||||||
//
|
|
||||||
// BtnAdd
|
|
||||||
//
|
|
||||||
BtnAdd.Location = new Point(6, 302);
|
|
||||||
BtnAdd.Name = "BtnAdd";
|
|
||||||
BtnAdd.Size = new Size(75, 23);
|
|
||||||
BtnAdd.TabIndex = 0;
|
|
||||||
BtnAdd.Text = "Añadir";
|
|
||||||
BtnAdd.UseVisualStyleBackColor = true;
|
|
||||||
BtnAdd.Click += BtnAdd_Click;
|
|
||||||
//
|
|
||||||
// BtnEliminar
|
|
||||||
//
|
|
||||||
BtnEliminar.Location = new Point(215, 302);
|
|
||||||
BtnEliminar.Name = "BtnEliminar";
|
|
||||||
BtnEliminar.Size = new Size(75, 23);
|
|
||||||
BtnEliminar.TabIndex = 2;
|
|
||||||
BtnEliminar.Text = "Eliminar";
|
|
||||||
BtnEliminar.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// dataGridView2
|
|
||||||
//
|
|
||||||
dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
|
||||||
dataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
|
||||||
dataGridView2.Location = new Point(355, 22);
|
|
||||||
dataGridView2.Name = "dataGridView2";
|
|
||||||
dataGridView2.RowTemplate.Height = 25;
|
|
||||||
dataGridView2.Size = new Size(585, 281);
|
|
||||||
dataGridView2.TabIndex = 4;
|
|
||||||
//
|
|
||||||
// FrmPedidosDePresupuestos
|
|
||||||
//
|
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
|
||||||
ClientSize = new Size(970, 450);
|
|
||||||
Controls.Add(groupBox1);
|
|
||||||
Name = "FrmPedidosDePresupuestos";
|
|
||||||
Text = "PedidosDePresupuestos";
|
|
||||||
WindowState = FormWindowState.Maximized;
|
|
||||||
groupBox1.ResumeLayout(false);
|
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
|
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView2).EndInit();
|
|
||||||
ResumeLayout(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private GroupBox groupBox1;
|
|
||||||
private DataGridView dataGridView1;
|
|
||||||
private Button BtnAdd;
|
|
||||||
private Button BtnEliminar;
|
|
||||||
private DataGridView dataGridView2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
using Controladora;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace Vista
|
|
||||||
{
|
|
||||||
public partial class FrmPedidosDePresupuestos : Form
|
|
||||||
{
|
|
||||||
public FrmPedidosDePresupuestos()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
private void ActualizarGrilla()
|
|
||||||
{
|
|
||||||
dataGridView1.DataSource = null;
|
|
||||||
dataGridView1.DataSource = ControladoraPedidoDePresupuestos.Instance.Listar();
|
|
||||||
}
|
|
||||||
private void BtnAdd_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var form = new FrmPresupuesto();
|
|
||||||
form.ShowDialog();
|
|
||||||
ActualizarGrilla();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
263
Vista/FrmPresupuesto.Designer.cs
generated
263
Vista/FrmPresupuesto.Designer.cs
generated
@@ -28,33 +28,46 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
dataGridView2 = new DataGridView();
|
dgvProducto = new DataGridView();
|
||||||
ID = new Label();
|
ID = new Label();
|
||||||
label2 = new Label();
|
label2 = new Label();
|
||||||
|
numId = new NumericUpDown();
|
||||||
|
btnGuardar = new Button();
|
||||||
|
btnCerrar = new Button();
|
||||||
|
btnAddProducto = new Button();
|
||||||
|
btnrmProducto = new Button();
|
||||||
|
dgvProveedor = new DataGridView();
|
||||||
|
dgvPedido = new DataGridView();
|
||||||
|
label1 = new Label();
|
||||||
label3 = new Label();
|
label3 = new Label();
|
||||||
dateTimePicker1 = new DateTimePicker();
|
numCantidad = new NumericUpDown();
|
||||||
comboBox1 = new ComboBox();
|
label4 = new Label();
|
||||||
numericUpDown1 = new NumericUpDown();
|
((System.ComponentModel.ISupportInitialize)dgvProducto).BeginInit();
|
||||||
button1 = new Button();
|
((System.ComponentModel.ISupportInitialize)numId).BeginInit();
|
||||||
button2 = new Button();
|
((System.ComponentModel.ISupportInitialize)dgvProveedor).BeginInit();
|
||||||
button3 = new Button();
|
((System.ComponentModel.ISupportInitialize)dgvPedido).BeginInit();
|
||||||
button4 = new Button();
|
((System.ComponentModel.ISupportInitialize)numCantidad).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView2).BeginInit();
|
SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
|
|
||||||
//
|
//
|
||||||
// dataGridView2
|
// dgvProducto
|
||||||
//
|
//
|
||||||
dataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
dgvProducto.AllowUserToAddRows = false;
|
||||||
dataGridView2.Location = new Point(407, 12);
|
dgvProducto.AllowUserToDeleteRows = false;
|
||||||
dataGridView2.Name = "dataGridView2";
|
dgvProducto.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
dataGridView2.RowTemplate.Height = 25;
|
dgvProducto.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||||
dataGridView2.Size = new Size(475, 413);
|
dgvProducto.Location = new Point(227, 26);
|
||||||
dataGridView2.TabIndex = 1;
|
dgvProducto.MultiSelect = false;
|
||||||
|
dgvProducto.Name = "dgvProducto";
|
||||||
|
dgvProducto.RowTemplate.Height = 25;
|
||||||
|
dgvProducto.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dgvProducto.Size = new Size(275, 249);
|
||||||
|
dgvProducto.TabIndex = 1;
|
||||||
|
dgvProducto.CellClick += dgvProducto_CellClick;
|
||||||
//
|
//
|
||||||
// ID
|
// ID
|
||||||
//
|
//
|
||||||
ID.AutoSize = true;
|
ID.AutoSize = true;
|
||||||
ID.Location = new Point(34, 197);
|
ID.Location = new Point(11, 26);
|
||||||
ID.Name = "ID";
|
ID.Name = "ID";
|
||||||
ID.Size = new Size(18, 15);
|
ID.Size = new Size(18, 15);
|
||||||
ID.TabIndex = 2;
|
ID.TabIndex = 2;
|
||||||
@@ -63,119 +76,165 @@
|
|||||||
// label2
|
// label2
|
||||||
//
|
//
|
||||||
label2.AutoSize = true;
|
label2.AutoSize = true;
|
||||||
label2.Location = new Point(34, 234);
|
label2.Location = new Point(508, 8);
|
||||||
label2.Name = "label2";
|
label2.Name = "label2";
|
||||||
label2.Size = new Size(55, 15);
|
label2.Size = new Size(55, 15);
|
||||||
label2.TabIndex = 3;
|
label2.TabIndex = 3;
|
||||||
label2.Text = "Provedor";
|
label2.Text = "Provedor";
|
||||||
//
|
//
|
||||||
|
// numId
|
||||||
|
//
|
||||||
|
numId.Location = new Point(78, 26);
|
||||||
|
numId.Maximum = new decimal(new int[] { 1410065407, 2, 0, 0 });
|
||||||
|
numId.Name = "numId";
|
||||||
|
numId.Size = new Size(120, 23);
|
||||||
|
numId.TabIndex = 8;
|
||||||
|
//
|
||||||
|
// btnGuardar
|
||||||
|
//
|
||||||
|
btnGuardar.Location = new Point(11, 316);
|
||||||
|
btnGuardar.Name = "btnGuardar";
|
||||||
|
btnGuardar.Size = new Size(77, 26);
|
||||||
|
btnGuardar.TabIndex = 9;
|
||||||
|
btnGuardar.Text = "Guardar";
|
||||||
|
btnGuardar.UseVisualStyleBackColor = true;
|
||||||
|
btnGuardar.Click += btnGuardar_Click;
|
||||||
|
//
|
||||||
|
// btnCerrar
|
||||||
|
//
|
||||||
|
btnCerrar.Location = new Point(696, 316);
|
||||||
|
btnCerrar.Name = "btnCerrar";
|
||||||
|
btnCerrar.Size = new Size(81, 26);
|
||||||
|
btnCerrar.TabIndex = 10;
|
||||||
|
btnCerrar.Text = "Cancelar";
|
||||||
|
btnCerrar.UseVisualStyleBackColor = true;
|
||||||
|
btnCerrar.Click += btnCerrar_Click;
|
||||||
|
//
|
||||||
|
// btnAddProducto
|
||||||
|
//
|
||||||
|
btnAddProducto.Location = new Point(12, 246);
|
||||||
|
btnAddProducto.Name = "btnAddProducto";
|
||||||
|
btnAddProducto.Size = new Size(115, 29);
|
||||||
|
btnAddProducto.TabIndex = 11;
|
||||||
|
btnAddProducto.Text = "Agregar Producto";
|
||||||
|
btnAddProducto.UseVisualStyleBackColor = true;
|
||||||
|
btnAddProducto.Click += btnAddProducto_Click;
|
||||||
|
//
|
||||||
|
// btnrmProducto
|
||||||
|
//
|
||||||
|
btnrmProducto.Location = new Point(12, 281);
|
||||||
|
btnrmProducto.Name = "btnrmProducto";
|
||||||
|
btnrmProducto.Size = new Size(115, 29);
|
||||||
|
btnrmProducto.TabIndex = 12;
|
||||||
|
btnrmProducto.Text = "Eliminar Producto";
|
||||||
|
btnrmProducto.UseVisualStyleBackColor = true;
|
||||||
|
btnrmProducto.Click += btnrmProducto_Click;
|
||||||
|
//
|
||||||
|
// dgvProveedor
|
||||||
|
//
|
||||||
|
dgvProveedor.AllowUserToAddRows = false;
|
||||||
|
dgvProveedor.AllowUserToDeleteRows = false;
|
||||||
|
dgvProveedor.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dgvProveedor.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||||
|
dgvProveedor.Location = new Point(508, 26);
|
||||||
|
dgvProveedor.MultiSelect = false;
|
||||||
|
dgvProveedor.Name = "dgvProveedor";
|
||||||
|
dgvProveedor.RowTemplate.Height = 25;
|
||||||
|
dgvProveedor.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dgvProveedor.Size = new Size(269, 249);
|
||||||
|
dgvProveedor.TabIndex = 13;
|
||||||
|
//
|
||||||
|
// dgvPedido
|
||||||
|
//
|
||||||
|
dgvPedido.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dgvPedido.Location = new Point(11, 67);
|
||||||
|
dgvPedido.Name = "dgvPedido";
|
||||||
|
dgvPedido.RowTemplate.Height = 25;
|
||||||
|
dgvPedido.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dgvPedido.Size = new Size(187, 171);
|
||||||
|
dgvPedido.TabIndex = 14;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
label1.AutoSize = true;
|
||||||
|
label1.Location = new Point(227, 8);
|
||||||
|
label1.Name = "label1";
|
||||||
|
label1.Size = new Size(56, 15);
|
||||||
|
label1.TabIndex = 15;
|
||||||
|
label1.Text = "Producto";
|
||||||
|
//
|
||||||
// label3
|
// label3
|
||||||
//
|
//
|
||||||
label3.AutoSize = true;
|
label3.AutoSize = true;
|
||||||
label3.Location = new Point(34, 270);
|
label3.Location = new Point(11, 49);
|
||||||
label3.Name = "label3";
|
label3.Name = "label3";
|
||||||
label3.Size = new Size(38, 15);
|
label3.Size = new Size(44, 15);
|
||||||
label3.TabIndex = 4;
|
label3.TabIndex = 16;
|
||||||
label3.Text = "Fecha";
|
label3.Text = "Pedido";
|
||||||
//
|
//
|
||||||
// dateTimePicker1
|
// numCantidad
|
||||||
//
|
//
|
||||||
dateTimePicker1.Location = new Point(100, 264);
|
numCantidad.Location = new Point(317, 281);
|
||||||
dateTimePicker1.Name = "dateTimePicker1";
|
numCantidad.Maximum = new decimal(new int[] { 1410065407, 2, 0, 0 });
|
||||||
dateTimePicker1.Size = new Size(121, 23);
|
numCantidad.Name = "numCantidad";
|
||||||
dateTimePicker1.TabIndex = 6;
|
numCantidad.Size = new Size(120, 23);
|
||||||
|
numCantidad.TabIndex = 17;
|
||||||
//
|
//
|
||||||
// comboBox1
|
// label4
|
||||||
//
|
//
|
||||||
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
|
label4.AutoSize = true;
|
||||||
comboBox1.FormattingEnabled = true;
|
label4.Location = new Point(227, 289);
|
||||||
comboBox1.Location = new Point(100, 226);
|
label4.Name = "label4";
|
||||||
comboBox1.Name = "comboBox1";
|
label4.Size = new Size(55, 15);
|
||||||
comboBox1.Size = new Size(121, 23);
|
label4.TabIndex = 18;
|
||||||
comboBox1.TabIndex = 7;
|
label4.Text = "Cantidad";
|
||||||
//
|
|
||||||
// numericUpDown1
|
|
||||||
//
|
|
||||||
numericUpDown1.Location = new Point(101, 197);
|
|
||||||
numericUpDown1.Maximum = new decimal(new int[] { 1410065407, 2, 0, 0 });
|
|
||||||
numericUpDown1.Name = "numericUpDown1";
|
|
||||||
numericUpDown1.Size = new Size(120, 23);
|
|
||||||
numericUpDown1.TabIndex = 8;
|
|
||||||
//
|
|
||||||
// button1
|
|
||||||
//
|
|
||||||
button1.Location = new Point(34, 383);
|
|
||||||
button1.Name = "button1";
|
|
||||||
button1.Size = new Size(154, 42);
|
|
||||||
button1.TabIndex = 9;
|
|
||||||
button1.Text = "Guardar";
|
|
||||||
button1.UseVisualStyleBackColor = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// button2
|
|
||||||
//
|
|
||||||
button2.Location = new Point(247, 383);
|
|
||||||
button2.Name = "button2";
|
|
||||||
button2.Size = new Size(154, 42);
|
|
||||||
button2.TabIndex = 10;
|
|
||||||
button2.Text = "Cancelar";
|
|
||||||
button2.UseVisualStyleBackColor = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// button3
|
|
||||||
//
|
|
||||||
button3.Location = new Point(34, 42);
|
|
||||||
button3.Name = "button3";
|
|
||||||
button3.Size = new Size(128, 47);
|
|
||||||
button3.TabIndex = 11;
|
|
||||||
button3.Text = "Agregar Producto";
|
|
||||||
button3.UseVisualStyleBackColor = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// button4
|
|
||||||
//
|
|
||||||
button4.Location = new Point(34, 106);
|
|
||||||
button4.Name = "button4";
|
|
||||||
button4.Size = new Size(128, 47);
|
|
||||||
button4.TabIndex = 12;
|
|
||||||
button4.Text = "Eliminar Producto";
|
|
||||||
button4.UseVisualStyleBackColor = true;
|
|
||||||
//
|
//
|
||||||
// FrmPresupuesto
|
// FrmPresupuesto
|
||||||
//
|
//
|
||||||
|
AcceptButton = btnGuardar;
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(925, 446);
|
CancelButton = btnCerrar;
|
||||||
Controls.Add(button4);
|
ClientSize = new Size(794, 351);
|
||||||
Controls.Add(button3);
|
Controls.Add(label4);
|
||||||
Controls.Add(button2);
|
Controls.Add(numCantidad);
|
||||||
Controls.Add(button1);
|
|
||||||
Controls.Add(numericUpDown1);
|
|
||||||
Controls.Add(comboBox1);
|
|
||||||
Controls.Add(dateTimePicker1);
|
|
||||||
Controls.Add(label3);
|
Controls.Add(label3);
|
||||||
|
Controls.Add(label1);
|
||||||
|
Controls.Add(dgvPedido);
|
||||||
|
Controls.Add(dgvProveedor);
|
||||||
|
Controls.Add(btnrmProducto);
|
||||||
|
Controls.Add(btnAddProducto);
|
||||||
|
Controls.Add(btnCerrar);
|
||||||
|
Controls.Add(btnGuardar);
|
||||||
|
Controls.Add(numId);
|
||||||
Controls.Add(label2);
|
Controls.Add(label2);
|
||||||
Controls.Add(ID);
|
Controls.Add(ID);
|
||||||
Controls.Add(dataGridView2);
|
Controls.Add(dgvProducto);
|
||||||
Name = "FrmPresupuesto";
|
Name = "FrmPresupuesto";
|
||||||
Text = "Form1";
|
Text = "Presupuesto";
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView2).EndInit();
|
((System.ComponentModel.ISupportInitialize)dgvProducto).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
|
((System.ComponentModel.ISupportInitialize)numId).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dgvProveedor).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dgvPedido).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numCantidad).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
private DataGridView dataGridView2;
|
private DataGridView dgvProducto;
|
||||||
private Label ID;
|
private Label ID;
|
||||||
private Label label2;
|
private Label label2;
|
||||||
|
private NumericUpDown numId;
|
||||||
|
private Button btnGuardar;
|
||||||
|
private Button btnCerrar;
|
||||||
|
private Button btnAddProducto;
|
||||||
|
private Button btnrmProducto;
|
||||||
|
private DataGridView dgvProveedor;
|
||||||
|
private DataGridView dgvPedido;
|
||||||
|
private Label label1;
|
||||||
private Label label3;
|
private Label label3;
|
||||||
private DateTimePicker dateTimePicker1;
|
private NumericUpDown numCantidad;
|
||||||
private ComboBox comboBox1;
|
private Label label4;
|
||||||
private NumericUpDown numericUpDown1;
|
|
||||||
private Button button1;
|
|
||||||
private Button button2;
|
|
||||||
private Button button3;
|
|
||||||
private Button button4;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
using System;
|
using Controladora;
|
||||||
|
using Entidades;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
@@ -12,26 +14,85 @@ namespace Vista
|
|||||||
{
|
{
|
||||||
public partial class FrmPresupuesto : Form
|
public partial class FrmPresupuesto : Form
|
||||||
{
|
{
|
||||||
|
private Presupuesto presupuesto = new Presupuesto();
|
||||||
|
private int id = 0;
|
||||||
public FrmPresupuesto()
|
public FrmPresupuesto()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
CargarDatos();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void button3_Click(object sender, EventArgs e)
|
private void CargarDatos()
|
||||||
{
|
{
|
||||||
var form = new AddProducto();
|
dgvProducto.DataSource = null;
|
||||||
form.ShowDialog();
|
dgvProducto.DataSource = ControladoraProductos.Instance.Listar();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void button2_Click(object sender, EventArgs e)
|
private void btnCerrar_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void button1_Click(object sender, EventArgs e)
|
private void btnGuardar_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//guardar
|
|
||||||
Close();
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Por favor, selecciona una fila para eliminar Proveedor del producto.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool VerificacionesDetalles()
|
||||||
|
{
|
||||||
|
bool ret = false;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool VerificacionesPresupuesto()
|
||||||
|
{
|
||||||
|
bool ret = false;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnrmProducto_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dgvProducto_CellClick(object sender, DataGridViewCellEventArgs e)
|
||||||
|
{
|
||||||
|
if (dgvProducto.SelectedRows.Count == 0) return;
|
||||||
|
|
||||||
|
if (dgvProducto.SelectedRows.Count > 0)
|
||||||
|
{
|
||||||
|
Producto producto = new Producto
|
||||||
|
{
|
||||||
|
Id = Convert.ToInt32(dgvProducto.SelectedRows[0].Cells["Id"].Value.ToString()),
|
||||||
|
};
|
||||||
|
dgvProveedor.DataSource = ControladoraProductos.Instance.ListarProveedores(producto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
143
Vista/FrmPresupuestos.Designer.cs
generated
Normal file
143
Vista/FrmPresupuestos.Designer.cs
generated
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
namespace Vista
|
||||||
|
{
|
||||||
|
partial class FrmPresupuestos
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
groupBox1 = new GroupBox();
|
||||||
|
label2 = new Label();
|
||||||
|
label1 = new Label();
|
||||||
|
dgvdetallesPresupuesto = new DataGridView();
|
||||||
|
dgvPresupuestos = new DataGridView();
|
||||||
|
BtnAdd = new Button();
|
||||||
|
BtnEliminar = new Button();
|
||||||
|
groupBox1.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dgvdetallesPresupuesto).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dgvPresupuestos).BeginInit();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// groupBox1
|
||||||
|
//
|
||||||
|
groupBox1.Controls.Add(label2);
|
||||||
|
groupBox1.Controls.Add(label1);
|
||||||
|
groupBox1.Controls.Add(dgvdetallesPresupuesto);
|
||||||
|
groupBox1.Controls.Add(dgvPresupuestos);
|
||||||
|
groupBox1.Controls.Add(BtnAdd);
|
||||||
|
groupBox1.Controls.Add(BtnEliminar);
|
||||||
|
groupBox1.Location = new Point(12, 2);
|
||||||
|
groupBox1.Name = "groupBox1";
|
||||||
|
groupBox1.Size = new Size(946, 377);
|
||||||
|
groupBox1.TabIndex = 4;
|
||||||
|
groupBox1.TabStop = false;
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
label2.AutoSize = true;
|
||||||
|
label2.Location = new Point(323, 4);
|
||||||
|
label2.Name = "label2";
|
||||||
|
label2.Size = new Size(48, 15);
|
||||||
|
label2.TabIndex = 6;
|
||||||
|
label2.Text = "Detalles";
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
label1.AutoSize = true;
|
||||||
|
label1.Location = new Point(6, 0);
|
||||||
|
label1.Name = "label1";
|
||||||
|
label1.Size = new Size(72, 15);
|
||||||
|
label1.TabIndex = 5;
|
||||||
|
label1.Text = "Presupuesto";
|
||||||
|
//
|
||||||
|
// dgvdetallesPresupuesto
|
||||||
|
//
|
||||||
|
dgvdetallesPresupuesto.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
|
dgvdetallesPresupuesto.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dgvdetallesPresupuesto.Location = new Point(323, 22);
|
||||||
|
dgvdetallesPresupuesto.Name = "dgvdetallesPresupuesto";
|
||||||
|
dgvdetallesPresupuesto.RowTemplate.Height = 25;
|
||||||
|
dgvdetallesPresupuesto.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dgvdetallesPresupuesto.Size = new Size(321, 235);
|
||||||
|
dgvdetallesPresupuesto.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// dgvPresupuestos
|
||||||
|
//
|
||||||
|
dgvPresupuestos.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
|
dgvPresupuestos.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dgvPresupuestos.Location = new Point(6, 22);
|
||||||
|
dgvPresupuestos.Name = "dgvPresupuestos";
|
||||||
|
dgvPresupuestos.RowTemplate.Height = 25;
|
||||||
|
dgvPresupuestos.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dgvPresupuestos.Size = new Size(284, 235);
|
||||||
|
dgvPresupuestos.TabIndex = 3;
|
||||||
|
dgvPresupuestos.CellClick += dgvPresupuestos_CellClick;
|
||||||
|
//
|
||||||
|
// BtnAdd
|
||||||
|
//
|
||||||
|
BtnAdd.Location = new Point(6, 263);
|
||||||
|
BtnAdd.Name = "BtnAdd";
|
||||||
|
BtnAdd.Size = new Size(75, 23);
|
||||||
|
BtnAdd.TabIndex = 0;
|
||||||
|
BtnAdd.Text = "Añadir";
|
||||||
|
BtnAdd.UseVisualStyleBackColor = true;
|
||||||
|
BtnAdd.Click += BtnAdd_Click;
|
||||||
|
//
|
||||||
|
// BtnEliminar
|
||||||
|
//
|
||||||
|
BtnEliminar.Location = new Point(87, 263);
|
||||||
|
BtnEliminar.Name = "BtnEliminar";
|
||||||
|
BtnEliminar.Size = new Size(75, 23);
|
||||||
|
BtnEliminar.TabIndex = 2;
|
||||||
|
BtnEliminar.Text = "Eliminar";
|
||||||
|
BtnEliminar.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// FrmPresupuestos
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(970, 450);
|
||||||
|
Controls.Add(groupBox1);
|
||||||
|
Name = "FrmPresupuestos";
|
||||||
|
Text = "PedidosDePresupuestos";
|
||||||
|
WindowState = FormWindowState.Maximized;
|
||||||
|
groupBox1.ResumeLayout(false);
|
||||||
|
groupBox1.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dgvdetallesPresupuesto).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dgvPresupuestos).EndInit();
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private GroupBox groupBox1;
|
||||||
|
private DataGridView dgvPresupuestos;
|
||||||
|
private Button BtnAdd;
|
||||||
|
private Button BtnEliminar;
|
||||||
|
private DataGridView dgvdetallesPresupuesto;
|
||||||
|
private Label label2;
|
||||||
|
private Label label1;
|
||||||
|
}
|
||||||
|
}
|
||||||
48
Vista/FrmPresupuestos.cs
Normal file
48
Vista/FrmPresupuestos.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
using Controladora;
|
||||||
|
using Entidades;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Vista
|
||||||
|
{
|
||||||
|
public partial class FrmPresupuestos : Form
|
||||||
|
{
|
||||||
|
public FrmPresupuestos()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
private void ActualizarGrilla()
|
||||||
|
{
|
||||||
|
dgvPresupuestos.DataSource = null;
|
||||||
|
dgvPresupuestos.DataSource = ControladoraPresupuestos.Instance.Listar();
|
||||||
|
}
|
||||||
|
private void BtnAdd_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var form = new FrmPresupuesto();
|
||||||
|
form.ShowDialog();
|
||||||
|
ActualizarGrilla();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dgvPresupuestos_CellClick(object sender, DataGridViewCellEventArgs e)
|
||||||
|
{
|
||||||
|
dgvdetallesPresupuesto.Rows.Clear();
|
||||||
|
if (dgvPresupuestos.SelectedRows.Count == 0) 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
</data>
|
</data>
|
||||||
85
Vista/FrmProducto.Designer.cs
generated
85
Vista/FrmProducto.Designer.cs
generated
@@ -40,8 +40,16 @@
|
|||||||
comboBox1 = new ComboBox();
|
comboBox1 = new ComboBox();
|
||||||
btnacept = new Button();
|
btnacept = new Button();
|
||||||
btncancel = new Button();
|
btncancel = new Button();
|
||||||
|
label6 = new Label();
|
||||||
|
label7 = new Label();
|
||||||
|
dgvProveedorAñadido = new DataGridView();
|
||||||
|
dgvProveedor = new DataGridView();
|
||||||
|
btnaddProveedor = new Button();
|
||||||
|
btnrmProveedor = new Button();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
|
((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDown2).BeginInit();
|
((System.ComponentModel.ISupportInitialize)numericUpDown2).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dgvProveedorAñadido).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dgvProveedor).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// label1
|
// label1
|
||||||
@@ -151,13 +159,80 @@
|
|||||||
btncancel.UseVisualStyleBackColor = true;
|
btncancel.UseVisualStyleBackColor = true;
|
||||||
btncancel.Click += button2_Click;
|
btncancel.Click += button2_Click;
|
||||||
//
|
//
|
||||||
|
// label6
|
||||||
|
//
|
||||||
|
label6.AutoSize = true;
|
||||||
|
label6.Location = new Point(230, 12);
|
||||||
|
label6.Name = "label6";
|
||||||
|
label6.Size = new Size(123, 15);
|
||||||
|
label6.TabIndex = 12;
|
||||||
|
label6.Text = "Proveedores añadidos";
|
||||||
|
//
|
||||||
|
// label7
|
||||||
|
//
|
||||||
|
label7.AutoSize = true;
|
||||||
|
label7.Location = new Point(494, 9);
|
||||||
|
label7.Name = "label7";
|
||||||
|
label7.Size = new Size(72, 15);
|
||||||
|
label7.TabIndex = 13;
|
||||||
|
label7.Text = "Proveedores";
|
||||||
|
//
|
||||||
|
// dgvProveedorAñadido
|
||||||
|
//
|
||||||
|
dgvProveedorAñadido.AllowUserToAddRows = false;
|
||||||
|
dgvProveedorAñadido.AllowUserToDeleteRows = false;
|
||||||
|
dgvProveedorAñadido.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dgvProveedorAñadido.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||||
|
dgvProveedorAñadido.Location = new Point(230, 30);
|
||||||
|
dgvProveedorAñadido.Name = "dgvProveedorAñadido";
|
||||||
|
dgvProveedorAñadido.RowTemplate.Height = 25;
|
||||||
|
dgvProveedorAñadido.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dgvProveedorAñadido.Size = new Size(240, 150);
|
||||||
|
dgvProveedorAñadido.TabIndex = 14;
|
||||||
|
//
|
||||||
|
// dgvProveedor
|
||||||
|
//
|
||||||
|
dgvProveedor.AllowUserToAddRows = false;
|
||||||
|
dgvProveedor.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dgvProveedor.Location = new Point(494, 30);
|
||||||
|
dgvProveedor.Name = "dgvProveedor";
|
||||||
|
dgvProveedor.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dgvProveedor.Size = new Size(240, 150);
|
||||||
|
dgvProveedor.TabIndex = 15;
|
||||||
|
//
|
||||||
|
// btnaddProveedor
|
||||||
|
//
|
||||||
|
btnaddProveedor.Location = new Point(740, 30);
|
||||||
|
btnaddProveedor.Name = "btnaddProveedor";
|
||||||
|
btnaddProveedor.Size = new Size(72, 21);
|
||||||
|
btnaddProveedor.TabIndex = 16;
|
||||||
|
btnaddProveedor.Text = "Añadir";
|
||||||
|
btnaddProveedor.UseVisualStyleBackColor = true;
|
||||||
|
btnaddProveedor.Click += btnaddProveedor_Click;
|
||||||
|
//
|
||||||
|
// btnrmProveedor
|
||||||
|
//
|
||||||
|
btnrmProveedor.Location = new Point(740, 57);
|
||||||
|
btnrmProveedor.Name = "btnrmProveedor";
|
||||||
|
btnrmProveedor.Size = new Size(72, 21);
|
||||||
|
btnrmProveedor.TabIndex = 17;
|
||||||
|
btnrmProveedor.Text = "Eliminar";
|
||||||
|
btnrmProveedor.UseVisualStyleBackColor = true;
|
||||||
|
btnrmProveedor.Click += btnrmProveedor_Click;
|
||||||
|
//
|
||||||
// FrmProducto
|
// FrmProducto
|
||||||
//
|
//
|
||||||
AcceptButton = btnacept;
|
AcceptButton = btnacept;
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
CancelButton = btncancel;
|
CancelButton = btncancel;
|
||||||
ClientSize = new Size(210, 228);
|
ClientSize = new Size(877, 228);
|
||||||
|
Controls.Add(btnrmProveedor);
|
||||||
|
Controls.Add(btnaddProveedor);
|
||||||
|
Controls.Add(dgvProveedor);
|
||||||
|
Controls.Add(dgvProveedorAñadido);
|
||||||
|
Controls.Add(label7);
|
||||||
|
Controls.Add(label6);
|
||||||
Controls.Add(btncancel);
|
Controls.Add(btncancel);
|
||||||
Controls.Add(btnacept);
|
Controls.Add(btnacept);
|
||||||
Controls.Add(comboBox1);
|
Controls.Add(comboBox1);
|
||||||
@@ -174,6 +249,8 @@
|
|||||||
Text = "Producto";
|
Text = "Producto";
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
|
((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDown2).EndInit();
|
((System.ComponentModel.ISupportInitialize)numericUpDown2).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dgvProveedorAñadido).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dgvProveedor).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
@@ -192,5 +269,11 @@
|
|||||||
private ComboBox comboBox1;
|
private ComboBox comboBox1;
|
||||||
private Button btnacept;
|
private Button btnacept;
|
||||||
private Button btncancel;
|
private Button btncancel;
|
||||||
|
private Label label6;
|
||||||
|
private Label label7;
|
||||||
|
private DataGridView dgvProveedorAñadido;
|
||||||
|
private DataGridView dgvProveedor;
|
||||||
|
private Button btnaddProveedor;
|
||||||
|
private Button btnrmProveedor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,12 +15,20 @@ namespace Vista
|
|||||||
{
|
{
|
||||||
public partial class FrmProducto : Form
|
public partial class FrmProducto : Form
|
||||||
{
|
{
|
||||||
|
private Producto nuevoproducto = new Producto();
|
||||||
|
|
||||||
public FrmProducto()
|
public FrmProducto()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
CargarCategorias();
|
CargarCategorias();
|
||||||
|
CargarTabla();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CargarTabla()
|
||||||
|
{
|
||||||
|
dgvProveedor.DataSource = null;
|
||||||
|
dgvProveedor.DataSource = ControladoraProveedores.Instance.Listar();
|
||||||
|
}
|
||||||
private void CargarCategorias()
|
private void CargarCategorias()
|
||||||
{
|
{
|
||||||
// Obtener la lista de categorías desde la controladora
|
// Obtener la lista de categorías desde la controladora
|
||||||
@@ -81,18 +89,16 @@ namespace Vista
|
|||||||
{
|
{
|
||||||
if (ValidarDatos())
|
if (ValidarDatos())
|
||||||
{
|
{
|
||||||
// Crear nuevo producto
|
|
||||||
var nuevoProducto = new Producto
|
nuevoproducto.Id = (int)numericUpDown1.Value;
|
||||||
{
|
nuevoproducto.Nombre = textBox1.Text;
|
||||||
Id = (int)numericUpDown1.Value,
|
nuevoproducto.Precio = (double)numericUpDown2.Value;
|
||||||
Nombre = textBox1.Text,
|
nuevoproducto.Habilitado = checkBox1.Checked;
|
||||||
Precio = (double)numericUpDown2.Value,
|
nuevoproducto.Categoria = (Categoria)comboBox1.SelectedItem;
|
||||||
Habilitado = checkBox1.Checked,
|
|
||||||
Categoria = (Categoria)comboBox1.SelectedItem, // Asignar categoría seleccionada
|
|
||||||
};
|
|
||||||
|
|
||||||
// Agregar el producto usando la controladora
|
// Agregar el producto usando la controladora
|
||||||
string mensaje = ControladoraProductos.Instance.Añadir(nuevoProducto);
|
string mensaje = ControladoraProductos.Instance.Añadir(nuevoproducto);
|
||||||
|
|
||||||
MessageBox.Show(mensaje, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show(mensaje, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
Close();
|
Close();
|
||||||
@@ -109,5 +115,51 @@ namespace Vista
|
|||||||
// Puedes usar este método para manejar cambios en el ComboBox si es necesario
|
// Puedes usar este método para manejar cambios en el ComboBox si es necesario
|
||||||
// No es necesario mantener una variable separada para la categoría seleccionada
|
// No es necesario mantener una variable separada para la categoría seleccionada
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void btnaddProveedor_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (dgvProveedor.SelectedRows.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (DataGridViewRow selectedRow in dgvProveedor.SelectedRows)
|
||||||
|
{
|
||||||
|
Proveedor proveedor = (Proveedor)selectedRow.DataBoundItem;
|
||||||
|
nuevoproducto.AñadirProveedor(proveedor);
|
||||||
|
dgvProveedorAñadido.DataSource = null;
|
||||||
|
dgvProveedorAñadido.DataSource = nuevoproducto.ListarProveedores();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Por favor, selecciona una fila para eliminar Proveedor del producto.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception) { throw; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnrmProveedor_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (dgvProveedorAñadido.SelectedRows.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (DataGridViewRow selectedRow in dgvProveedor.SelectedRows)
|
||||||
|
{
|
||||||
|
Proveedor proveedor = (Proveedor)selectedRow.DataBoundItem;
|
||||||
|
dgvProveedorAñadido.Rows.Remove(selectedRow);
|
||||||
|
Proveedor proveedoreliminar = nuevoproducto.ListarProveedores().First(x => x.Cuit == proveedor.Cuit);
|
||||||
|
nuevoproducto.EliminarProveedor(proveedoreliminar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Por favor, selecciona una fila para eliminar Proveedor del producto.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception) { throw; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
97
Vista/FrmProductos.Designer.cs
generated
97
Vista/FrmProductos.Designer.cs
generated
@@ -29,30 +29,53 @@
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
groupBox1 = new GroupBox();
|
groupBox1 = new GroupBox();
|
||||||
|
label3 = new Label();
|
||||||
|
dgvProveedores = new DataGridView();
|
||||||
label2 = new Label();
|
label2 = new Label();
|
||||||
dataGridView1 = new DataGridView();
|
dgvProductos = new DataGridView();
|
||||||
BtnAdd = new Button();
|
BtnAdd = new Button();
|
||||||
BtnEliminar = new Button();
|
BtnEliminar = new Button();
|
||||||
button1 = new Button();
|
button1 = new Button();
|
||||||
dataGridView2 = new DataGridView();
|
dgvCategorias = new DataGridView();
|
||||||
label1 = new Label();
|
label1 = new Label();
|
||||||
groupBox1.SuspendLayout();
|
groupBox1.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
|
((System.ComponentModel.ISupportInitialize)dgvProveedores).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView2).BeginInit();
|
((System.ComponentModel.ISupportInitialize)dgvProductos).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dgvCategorias).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// groupBox1
|
// groupBox1
|
||||||
//
|
//
|
||||||
|
groupBox1.Controls.Add(label3);
|
||||||
|
groupBox1.Controls.Add(dgvProveedores);
|
||||||
groupBox1.Controls.Add(label2);
|
groupBox1.Controls.Add(label2);
|
||||||
groupBox1.Controls.Add(dataGridView1);
|
groupBox1.Controls.Add(dgvProductos);
|
||||||
groupBox1.Controls.Add(BtnAdd);
|
groupBox1.Controls.Add(BtnAdd);
|
||||||
groupBox1.Controls.Add(BtnEliminar);
|
groupBox1.Controls.Add(BtnEliminar);
|
||||||
groupBox1.Location = new Point(12, 0);
|
groupBox1.Location = new Point(12, 0);
|
||||||
groupBox1.Name = "groupBox1";
|
groupBox1.Name = "groupBox1";
|
||||||
groupBox1.Size = new Size(776, 351);
|
groupBox1.Size = new Size(746, 305);
|
||||||
groupBox1.TabIndex = 5;
|
groupBox1.TabIndex = 5;
|
||||||
groupBox1.TabStop = false;
|
groupBox1.TabStop = false;
|
||||||
//
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
label3.AutoSize = true;
|
||||||
|
label3.Location = new Point(473, 9);
|
||||||
|
label3.Name = "label3";
|
||||||
|
label3.Size = new Size(72, 15);
|
||||||
|
label3.TabIndex = 10;
|
||||||
|
label3.Text = "Proveedores";
|
||||||
|
//
|
||||||
|
// dgvProveedores
|
||||||
|
//
|
||||||
|
dgvProveedores.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dgvProveedores.Location = new Point(473, 22);
|
||||||
|
dgvProveedores.Name = "dgvProveedores";
|
||||||
|
dgvProveedores.RowTemplate.Height = 25;
|
||||||
|
dgvProveedores.Size = new Size(240, 235);
|
||||||
|
dgvProveedores.TabIndex = 9;
|
||||||
|
//
|
||||||
// label2
|
// label2
|
||||||
//
|
//
|
||||||
label2.AutoSize = true;
|
label2.AutoSize = true;
|
||||||
@@ -62,21 +85,22 @@
|
|||||||
label2.TabIndex = 8;
|
label2.TabIndex = 8;
|
||||||
label2.Text = "Productos";
|
label2.Text = "Productos";
|
||||||
//
|
//
|
||||||
// dataGridView1
|
// dgvProductos
|
||||||
//
|
//
|
||||||
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
dgvProductos.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
dgvProductos.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
dataGridView1.EditMode = DataGridViewEditMode.EditProgrammatically;
|
dgvProductos.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||||
dataGridView1.Location = new Point(6, 22);
|
dgvProductos.Location = new Point(6, 22);
|
||||||
dataGridView1.Name = "dataGridView1";
|
dgvProductos.Name = "dgvProductos";
|
||||||
dataGridView1.RowTemplate.Height = 25;
|
dgvProductos.RowTemplate.Height = 25;
|
||||||
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
dgvProductos.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
dataGridView1.Size = new Size(690, 235);
|
dgvProductos.Size = new Size(461, 235);
|
||||||
dataGridView1.TabIndex = 3;
|
dgvProductos.TabIndex = 3;
|
||||||
|
dgvProductos.CellClick += dgvProductos_CellClick;
|
||||||
//
|
//
|
||||||
// BtnAdd
|
// BtnAdd
|
||||||
//
|
//
|
||||||
BtnAdd.Location = new Point(6, 302);
|
BtnAdd.Location = new Point(6, 263);
|
||||||
BtnAdd.Name = "BtnAdd";
|
BtnAdd.Name = "BtnAdd";
|
||||||
BtnAdd.Size = new Size(75, 23);
|
BtnAdd.Size = new Size(75, 23);
|
||||||
BtnAdd.TabIndex = 0;
|
BtnAdd.TabIndex = 0;
|
||||||
@@ -86,7 +110,7 @@
|
|||||||
//
|
//
|
||||||
// BtnEliminar
|
// BtnEliminar
|
||||||
//
|
//
|
||||||
BtnEliminar.Location = new Point(137, 302);
|
BtnEliminar.Location = new Point(87, 263);
|
||||||
BtnEliminar.Name = "BtnEliminar";
|
BtnEliminar.Name = "BtnEliminar";
|
||||||
BtnEliminar.Size = new Size(75, 23);
|
BtnEliminar.Size = new Size(75, 23);
|
||||||
BtnEliminar.TabIndex = 2;
|
BtnEliminar.TabIndex = 2;
|
||||||
@@ -96,7 +120,7 @@
|
|||||||
//
|
//
|
||||||
// button1
|
// button1
|
||||||
//
|
//
|
||||||
button1.Location = new Point(794, 302);
|
button1.Location = new Point(794, 263);
|
||||||
button1.Name = "button1";
|
button1.Name = "button1";
|
||||||
button1.Size = new Size(128, 23);
|
button1.Size = new Size(128, 23);
|
||||||
button1.TabIndex = 4;
|
button1.TabIndex = 4;
|
||||||
@@ -104,17 +128,17 @@
|
|||||||
button1.UseVisualStyleBackColor = true;
|
button1.UseVisualStyleBackColor = true;
|
||||||
button1.Click += button1_Click;
|
button1.Click += button1_Click;
|
||||||
//
|
//
|
||||||
// dataGridView2
|
// dgvCategorias
|
||||||
//
|
//
|
||||||
dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
dgvCategorias.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
dataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
dgvCategorias.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
dataGridView2.EditMode = DataGridViewEditMode.EditProgrammatically;
|
dgvCategorias.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||||
dataGridView2.Location = new Point(794, 22);
|
dgvCategorias.Location = new Point(794, 22);
|
||||||
dataGridView2.Name = "dataGridView2";
|
dgvCategorias.Name = "dgvCategorias";
|
||||||
dataGridView2.RowTemplate.Height = 25;
|
dgvCategorias.RowTemplate.Height = 25;
|
||||||
dataGridView2.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
dgvCategorias.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
dataGridView2.Size = new Size(250, 235);
|
dgvCategorias.Size = new Size(250, 235);
|
||||||
dataGridView2.TabIndex = 6;
|
dgvCategorias.TabIndex = 6;
|
||||||
//
|
//
|
||||||
// label1
|
// label1
|
||||||
//
|
//
|
||||||
@@ -129,18 +153,19 @@
|
|||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(1071, 450);
|
ClientSize = new Size(1088, 515);
|
||||||
Controls.Add(label1);
|
Controls.Add(label1);
|
||||||
Controls.Add(button1);
|
Controls.Add(button1);
|
||||||
Controls.Add(dataGridView2);
|
Controls.Add(dgvCategorias);
|
||||||
Controls.Add(groupBox1);
|
Controls.Add(groupBox1);
|
||||||
Name = "FrmProductos";
|
Name = "FrmProductos";
|
||||||
Text = "Productos";
|
Text = "Productos";
|
||||||
WindowState = FormWindowState.Maximized;
|
WindowState = FormWindowState.Maximized;
|
||||||
groupBox1.ResumeLayout(false);
|
groupBox1.ResumeLayout(false);
|
||||||
groupBox1.PerformLayout();
|
groupBox1.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
|
((System.ComponentModel.ISupportInitialize)dgvProveedores).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView2).EndInit();
|
((System.ComponentModel.ISupportInitialize)dgvProductos).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dgvCategorias).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
@@ -148,12 +173,14 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private GroupBox groupBox1;
|
private GroupBox groupBox1;
|
||||||
private DataGridView dataGridView1;
|
private DataGridView dgvProductos;
|
||||||
private Button BtnAdd;
|
private Button BtnAdd;
|
||||||
private Button BtnEliminar;
|
private Button BtnEliminar;
|
||||||
private Button button1;
|
private Button button1;
|
||||||
private DataGridView dataGridView2;
|
private DataGridView dgvCategorias;
|
||||||
private Label label2;
|
private Label label2;
|
||||||
private Label label1;
|
private Label label1;
|
||||||
|
private DataGridView dgvProveedores;
|
||||||
|
private Label label3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,14 +28,14 @@ namespace Vista
|
|||||||
|
|
||||||
private void ConfigurarDataGridView()
|
private void ConfigurarDataGridView()
|
||||||
{
|
{
|
||||||
dataGridView1.AutoGenerateColumns = false;
|
dgvProductos.AutoGenerateColumns = false;
|
||||||
|
|
||||||
// Crear una columna para el ID
|
// Crear una columna para el ID
|
||||||
var colId = new DataGridViewTextBoxColumn
|
var colId = new DataGridViewTextBoxColumn
|
||||||
{
|
{
|
||||||
DataPropertyName = "Id",
|
DataPropertyName = "Id",
|
||||||
HeaderText = "ID",
|
HeaderText = "ID",
|
||||||
Name = "colId"
|
Name = "Id"
|
||||||
};
|
};
|
||||||
|
|
||||||
// Crear una columna para el nombre
|
// Crear una columna para el nombre
|
||||||
@@ -43,7 +43,7 @@ namespace Vista
|
|||||||
{
|
{
|
||||||
DataPropertyName = "Nombre",
|
DataPropertyName = "Nombre",
|
||||||
HeaderText = "Nombre",
|
HeaderText = "Nombre",
|
||||||
Name = "colNombre"
|
Name = "Nombre"
|
||||||
};
|
};
|
||||||
|
|
||||||
// Crear una columna para el precio
|
// Crear una columna para el precio
|
||||||
@@ -51,36 +51,45 @@ namespace Vista
|
|||||||
{
|
{
|
||||||
DataPropertyName = "Precio",
|
DataPropertyName = "Precio",
|
||||||
HeaderText = "Precio",
|
HeaderText = "Precio",
|
||||||
Name = "colPrecio"
|
Name = "Precio"
|
||||||
};
|
};
|
||||||
var colHabilitado = new DataGridViewTextBoxColumn
|
var colHabilitado = new DataGridViewTextBoxColumn
|
||||||
{
|
{
|
||||||
DataPropertyName = "Habilitado",
|
DataPropertyName = "Habilitado",
|
||||||
HeaderText = "Habilitado",
|
HeaderText = "Habilitado",
|
||||||
Name = "colHabilitado"
|
Name = "Habilitado"
|
||||||
};
|
};
|
||||||
// Crear una columna para la categoría (mostrando la descripción)
|
// Crear una columna para la categoría (mostrando la descripción)
|
||||||
var colCategoria = new DataGridViewTextBoxColumn
|
var colCategoria = new DataGridViewTextBoxColumn
|
||||||
{
|
{
|
||||||
DataPropertyName = "CategoriaDescripcion",
|
DataPropertyName = "CategoriaDescripcion",
|
||||||
HeaderText = "Categoría",
|
HeaderText = "Categoría",
|
||||||
Name = "colCategoria"
|
Name = "Categoria"
|
||||||
};
|
};
|
||||||
|
|
||||||
// Agregar las columnas al DataGridView
|
// Agregar las columnas al DataGridView
|
||||||
dataGridView1.Columns.Add(colId);
|
dgvProductos.Columns.Add(colId);
|
||||||
dataGridView1.Columns.Add(colNombre);
|
dgvProductos.Columns.Add(colNombre);
|
||||||
dataGridView1.Columns.Add(colPrecio);
|
dgvProductos.Columns.Add(colPrecio);
|
||||||
dataGridView1.Columns.Add(colHabilitado);
|
dgvProductos.Columns.Add(colHabilitado);
|
||||||
dataGridView1.Columns.Add(colCategoria);
|
dgvProductos.Columns.Add(colCategoria);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ActualizarGrilla()
|
private void ActualizarGrilla()
|
||||||
{
|
{
|
||||||
dataGridView1.DataSource = null;
|
dgvProductos.DataSource = null;
|
||||||
dataGridView2.DataSource = null;
|
dgvCategorias.DataSource = null;
|
||||||
var categorias = ControladoraCategorias.Instance.Listar();
|
var categorias = ControladoraCategorias.Instance.Listar();
|
||||||
dataGridView2.DataSource = categorias;
|
dgvCategorias.DataSource = categorias;
|
||||||
|
|
||||||
|
if (dgvProductos.SelectedRows.Count > 0)
|
||||||
|
{
|
||||||
|
Producto producto = new Producto
|
||||||
|
{
|
||||||
|
Id = int.Parse(dgvProductos.SelectedRows[0].Cells["Id"].Value.ToString()),
|
||||||
|
};
|
||||||
|
dgvProveedores.DataSource = ControladoraProductos.Instance.ListarProveedores(producto);
|
||||||
|
}
|
||||||
|
|
||||||
// Obtener la lista de productos y proyectar los datos
|
// Obtener la lista de productos y proyectar los datos
|
||||||
var productos = ControladoraProductos.Instance.Listar()
|
var productos = ControladoraProductos.Instance.Listar()
|
||||||
@@ -94,7 +103,7 @@ namespace Vista
|
|||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
dataGridView1.DataSource = productos;
|
dgvProductos.DataSource = productos;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnAdd_Click(object sender, EventArgs e)
|
private void BtnAdd_Click(object sender, EventArgs e)
|
||||||
@@ -115,14 +124,14 @@ namespace Vista
|
|||||||
|
|
||||||
private void BtnEliminar_Click(object sender, EventArgs e)
|
private void BtnEliminar_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (dataGridView1.SelectedRows.Count == 0)
|
if (dgvProductos.SelectedRows.Count == 0)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Seleccione una línea para eliminar");
|
MessageBox.Show("Seleccione una línea para eliminar");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recorre las filas seleccionadas
|
// Recorre las filas seleccionadas
|
||||||
foreach (DataGridViewRow fila in dataGridView1.SelectedRows)
|
foreach (DataGridViewRow fila in dgvProductos.SelectedRows)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -154,7 +163,19 @@ namespace Vista
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void dgvProductos_CellClick(object sender, DataGridViewCellEventArgs e)
|
||||||
|
{
|
||||||
|
if (dgvProductos.SelectedRows.Count == 0) return;
|
||||||
|
|
||||||
|
if (dgvProductos.SelectedRows.Count > 0)
|
||||||
|
{
|
||||||
|
Producto producto = new Producto
|
||||||
|
{
|
||||||
|
Id = Convert.ToInt32(dgvProductos.SelectedRows[0].Cells["Id"].Value.ToString()),
|
||||||
|
};
|
||||||
|
dgvProveedores.DataSource = ControladoraProductos.Instance.ListarProveedores(producto);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ namespace Vista
|
|||||||
proveedor.Direccion = txtDireccion.Text;
|
proveedor.Direccion = txtDireccion.Text;
|
||||||
proveedor.RazonSocial = txtSocial.Text;
|
proveedor.RazonSocial = txtSocial.Text;
|
||||||
proveedor.Cuit = (Int64)numCuit.Value;
|
proveedor.Cuit = (Int64)numCuit.Value;
|
||||||
|
proveedor.Habilitado = checkBoxHabilitado.Checked;
|
||||||
msg = ControladoraProveedores.Instance.Modificar(proveedor);
|
msg = ControladoraProveedores.Instance.Modificar(proveedor);
|
||||||
}
|
}
|
||||||
MessageBox.Show(msg, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show(msg, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace Vista
|
|||||||
{
|
{
|
||||||
ActiveMdiChild.Close();
|
ActiveMdiChild.Close();
|
||||||
}
|
}
|
||||||
var Frm = new FrmPedidosDePresupuestos();
|
var Frm = new FrmPresupuestos();
|
||||||
Frm.MdiParent = this;
|
Frm.MdiParent = this;
|
||||||
Frm.Show();
|
Frm.Show();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,16 +20,16 @@ namespace Vista
|
|||||||
|
|
||||||
private static void PrecargarDatos()
|
private static void PrecargarDatos()
|
||||||
{
|
{
|
||||||
|
Proveedor proveedor = new Proveedor
|
||||||
ControladoraProveedores.Instance.A<EFBFBD>adir(new Proveedor
|
|
||||||
{
|
{
|
||||||
Cuit = 157618923,
|
Cuit = 157618923,
|
||||||
Direccion = "La Rioja 6412",
|
Direccion = "La Rioja 6412",
|
||||||
Nombre = "Outlet Riojano",
|
Nombre = "Outlet Riojano",
|
||||||
Habilitado = true,
|
Habilitado = true,
|
||||||
RazonSocial = "Vende Ropa"
|
RazonSocial = "Vende Ropa"
|
||||||
|
|
||||||
});
|
};
|
||||||
|
ControladoraProveedores.Instance.A<EFBFBD>adir(proveedor);
|
||||||
|
|
||||||
ControladoraClientes.Instance.A<EFBFBD>adir(new Cliente{
|
ControladoraClientes.Instance.A<EFBFBD>adir(new Cliente{
|
||||||
Cuit = 23453659239,
|
Cuit = 23453659239,
|
||||||
@@ -59,15 +59,17 @@ namespace Vista
|
|||||||
Id = 2,
|
Id = 2,
|
||||||
Descripcion = "Perfumeria"
|
Descripcion = "Perfumeria"
|
||||||
});
|
});
|
||||||
|
Producto producto = new Producto
|
||||||
ControladoraProductos.Instance.A<EFBFBD>adir(new Producto
|
|
||||||
{
|
{
|
||||||
Id = 1,
|
Id = 1,
|
||||||
Categoria = ControladoraCategorias.Instance.Listar()[0],
|
Categoria = ControladoraCategorias.Instance.Listar()[0],
|
||||||
Habilitado = true,
|
Habilitado = true,
|
||||||
Nombre = "Pantalones Vaqueros",
|
Nombre = "Pantalones Vaqueros",
|
||||||
Precio = 2000.2
|
Precio = 2000.2
|
||||||
});
|
};
|
||||||
|
producto.A<EFBFBD>adirProveedor(proveedor);
|
||||||
|
ControladoraProductos.Instance.A<EFBFBD>adir(producto);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,12 +7,9 @@
|
|||||||
<Compile Update="AddProducto.cs">
|
<Compile Update="AddProducto.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<<<<<<< HEAD
|
|
||||||
<Compile Update="FrmFacturas.cs">
|
<Compile Update="FrmFacturas.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
=======
|
|
||||||
>>>>>>> 5b78d74e54350285696596720e82f5fbd99b4d02
|
|
||||||
<Compile Update="FrmInforme.cs">
|
<Compile Update="FrmInforme.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<Compile Update="FrmOrdenDeCompra.cs">
|
<Compile Update="FrmOrdenDeCompra.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Update="FrmPedidosDePresupuestos.cs">
|
<Compile Update="FrmPresupuestos.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Update="FrmPresupuesto.cs">
|
<Compile Update="FrmPresupuesto.cs">
|
||||||
|
|||||||
Reference in New Issue
Block a user