using System; using System.Linq; namespace bdAsegasa.db { public partial class conciliacionesbancarias { public double ImporteExtractosConciliados => this.movimientosbancarios.Sum(x => (double)x.Importe); public double ImporteApuntesConciliados => this.apuntes.Sum(x => x.Debe - x.Haber); private int? _Año; public int? Año { get { if (_Año.HasValue) { return _Año; } else { if (this.FechaInicio == DateOnly.MinValue) { return null; } else { return this.FechaInicio.Year; } } } set { _Año = value; if (value.HasValue && Mes.HasValue) { this.FechaInicio = new DateOnly(value.Value, Mes.Value, 1); this.FechaFin = new DateOnly(value.Value, Mes.Value, DateTime.DaysInMonth(value.Value, Mes.Value)); } // OnPropertyChanged is handled by Fody/PropertyChanged in the partial class. } } private int? _Mes; public int? Mes { get { if (_Mes.HasValue) { return _Mes; } else { if (this.FechaInicio == DateOnly.MinValue) { return null; } else { return this.FechaInicio.Month; } } } set { _Mes = value; if (value.HasValue && Año.HasValue) { this.FechaInicio = new DateOnly(Año.Value, value.Value, 1); this.FechaFin = new DateOnly(Año.Value, value.Value, DateTime.DaysInMonth(Año.Value, value.Value)); } } } } }