This repository has been archived on 2024-08-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Final_OOP/Entidades/Presupuesto.cs

30 lines
875 B
C#

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entidades
{
public class Presupuesto
{
public int Id { get; set; }
public DateTime Fecha { get; set; }
public bool Habilitado { get; set; }
public bool Aceptado { get; set; }
public Proveedor Proveedor { get; set; }
private List<DetallePresupuesto> detalles = new List<DetallePresupuesto>();
public void AñadirDetalle(DetallePresupuesto det) {
detalles.Add(det);
}
public bool EliminarCategoria(DetallePresupuesto det) {
var dAEliminar = detalles.FirstOrDefault(x => x.Id == det.Id);
if (dAEliminar == null) return false;
return detalles.Remove(dAEliminar);
}
}
}