Esempio n. 1
0
        public static DAL.App.DTO.Payment MapFromBLL(BLL.App.DTO.Payment payment)
        {
            var res = payment == null ? null : new DAL.App.DTO.Payment
            {
                Id              = payment.Id,
                BillId          = payment.BillId,
                Bill            = BillMapper.MapFromBLL(payment.Bill),
                PaymentMethodId = payment.PaymentMethodId,
                PaymentMethod   = PaymentMethodMapper.MapFromBLL(payment.PaymentMethod),
                Sum             = payment.Sum,
                PaymentTime     = payment.PaymentTime
            };

            return(res);
        }
Esempio n. 2
0
        public static DAL.App.DTO.BillLine MapFromBLL(BLL.App.DTO.BillLine billLine)
        {
            var res = billLine == null ? null : new DAL.App.DTO.BillLine
            {
                Id              = billLine.Id,
                BillId          = billLine.BillId,
                Bill            = BillMapper.MapFromBLL(billLine.Bill),
                Product         = billLine.Product,
                Amount          = billLine.Amount,
                Sum             = billLine.Sum,
                DiscountPercent = billLine.DiscountPercent,
//                SumWithDiscount = billLine.Sum * billLine.Amount * (1 - billLine.DiscountPercent / 100)
                SumWithDiscount = billLine.SumWithDiscount
            };

            return(res);
        }