añadido Context de entity y correjidos algunos temas de las entidades

This commit is contained in:
2024-08-14 00:26:42 -03:00
parent 1d23af8e93
commit 3f526d09d6
27 changed files with 302 additions and 33 deletions

View File

@@ -1,9 +1,19 @@

using System.ComponentModel.DataAnnotations.Schema;
namespace Entidades
{
public class DetalleFactura: Detalle<Producto>
{
public int IdFactura { get; set; }
public double Subtotal { get; set; }
[NotMapped]
public double Subtotal
{
get
{
return Producto.Precio * Cantidad;
}
}
}
}

View File

@@ -1,4 +1,6 @@

using System.ComponentModel.DataAnnotations.Schema;
namespace Entidades
{
public class DetalleOrdenDeCompra: Detalle<Producto>
@@ -6,7 +8,8 @@ namespace Entidades
public int IdOrdenDeCompra { get; set; }
public Presupuesto presupuesto { get; set; }
public double MontoCU { get; set; }
[NotMapped]
public int IdPresupuesto
{
get
@@ -14,6 +17,7 @@ namespace Entidades
return presupuesto.Id;
}
}
[NotMapped]
public string NombreProducto
{
get
@@ -21,6 +25,7 @@ namespace Entidades
return Producto.Nombre;
}
}
[NotMapped]
public double SubTotal
{
get

View File

@@ -1,5 +1,6 @@

using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
namespace Entidades
{
@@ -8,13 +9,15 @@ namespace Entidades
public int IdPresupuesto { get; set; }
public double MontoCUPropuesto { get; set; }
[NotMapped]
public string NombreDelProducto {
get
{
return Producto.Nombre;
}
}
[NotMapped]
public double Subtotal {
get
{

View File

@@ -1,4 +1,6 @@

using System.ComponentModel.DataAnnotations.Schema;
namespace Entidades
{
public class Lote: Detalle<Producto>
@@ -6,6 +8,8 @@ namespace Entidades
public int IdRemito { get; set; }
public DateTime Fecha { get; set; }
public bool Habilitado { get; set; }
[NotMapped]
public string NombreProducto
{
get

View File

@@ -1,4 +1,5 @@
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Security.Cryptography.X509Certificates;
namespace Entidades
@@ -27,6 +28,7 @@ namespace Entidades
return detalles.AsReadOnly();
}
[NotMapped]
public double MontoTotal
{
get
@@ -34,6 +36,7 @@ namespace Entidades
return detalles.Sum(x => x.SubTotal);
}
}
[NotMapped]
public string NombreProveedor
{
get

View File

@@ -1,6 +1,7 @@
 using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations.Schema;
namespace Entidades
namespace Entidades
{
public class Presupuesto
{
@@ -10,6 +11,7 @@ namespace Entidades
public bool Aceptado { get; set; }
public Proveedor Proveedor { get; set; }
[NotMapped]
public string ProveedorNombre
{
get

View File

@@ -1,5 +1,6 @@
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
namespace Entidades
{
@@ -10,16 +11,6 @@ namespace Entidades
public double Precio { get; set; }
public bool Habilitado { get; set; }
public bool EsPerecedero { get; set; }
[Browsable(false)]
public Categoria Categoria { get; set; }
public string Cartegoria_
{
get
{
return Categoria.Descripcion;
}
}
private List<Proveedor> proveedores = new List<Proveedor>();

View File

@@ -1,6 +1,7 @@
 using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations.Schema;
namespace Entidades
namespace Entidades
{
public class Remito
{
@@ -23,6 +24,7 @@ namespace Entidades
throw;
}
}
[NotMapped]
public string NombreProveedor
{
get