Example #1
0
        public BillDto(Bill bill)
        {
            this.Id = bill.Id;
            this.UserId = bill.UserId;
            this.Name = bill.Name;
            this.Amount = bill.Amount;
            this.IsFixed = bill.IsFixed;
            this.PaymentDay = bill.PaymentDay;

            //this.FuturePayments = new List<PaymentDto>();
            //this.PastPayments = new List<PaymentDto>();

            //this.PastPayments = bill.Payments.Take(6).Select(p => new PaymentDto(p)).ToList();

            ////Project future payments forward 6 months
            //this.FuturePayments = bill.ProjectPayments(TimeSpan.FromDays(183)).Select(p => new PaymentDto(p, true)).ToList();
        }
Example #2
0
        //public List<PaymentDto> FuturePayments { get; set; }
        //public List<PaymentDto> PastPayments { get; set; }
        public Bill ToEntity()
        {
            Bill bill = new Bill()
            {
                Id = this.Id,
                UserId = this.UserId,
                Name = this.Name,
                Amount = this.Amount,
                IsFixed = this.IsFixed,
                PaymentDay = this.PaymentDay
            };

            return bill;
        }