Ejemplo n.º 1
0
        public eVoucher MapToeVoucher(eVoucherDto item)
        {
            var voucher = new eVoucher
            {
                Id                = item.Id,
                Title             = item.Title,
                Description       = item.Description,
                ExpiryDate        = item.ExpiryDate,
                ImageURL          = item.ImageURL,
                Amount            = item.Amount,
                Quantity          = item.Quantity,
                BuyType           = (BuyType)item.BuyType,
                MaxCanBuyeVoucher = item.MaxCanBuyeVoucher,
                GiftPerUserBuy    = item.GiftPerUserBuy,
                EVoucherStatus    = (eVoucherStatus)item.EVoucherStatus,
                CreatedBy         = item.CreatedBy,
                CreatedDate       = item.CreatedDate,
                UpdatedBy         = item.UpdatedBy,
                UpdatedDate       = item.UpdatedDate
            };

            voucher.eVoucherPaymentMode = new List <eVoucherPaymentMode>();
            voucher.eVoucherPaymentMode = MapToeVoucherPaymentModes(item.eVoucherPaymentModeDtos);
            return(voucher);
        }
Ejemplo n.º 2
0
        public eVoucherDto MapToeVoucherDto(eVoucher item)
        {
            var eVoucherDto = new eVoucherDto
            {
                Id                = item.Id,
                Title             = item.Title,
                Description       = item.Description,
                ExpiryDate        = item.ExpiryDate,
                ImageURL          = item.ImageURL,
                Amount            = item.Amount,
                Quantity          = item.Quantity,
                BuyType           = (int)item.BuyType,
                MaxCanBuyeVoucher = item.MaxCanBuyeVoucher,
                GiftPerUserBuy    = item.GiftPerUserBuy,
                EVoucherStatus    = (int)item.EVoucherStatus,
                CreatedBy         = item.CreatedBy,
                CreatedDate       = item.CreatedDate,
                UpdatedBy         = item.UpdatedBy,
                UpdatedDate       = item.UpdatedDate
            };

            eVoucherDto.eVoucherPaymentModeDtos = new List <eVoucherPaymentModeDto>();
            eVoucherDto.eVoucherPaymentModeDtos = MapToeVoucherPaymentModeDtos(item.eVoucherPaymentMode);
            return(eVoucherDto);
        }
Ejemplo n.º 3
0
 public void UpdateVoucher(eVoucher item)
 {
     _context.EVouchers.Update(item);
     _context.EVoucherPaymentModes.UpdateRange(item.eVoucherPaymentMode);
     _context.SaveChanges();
 }
Ejemplo n.º 4
0
 public void SaveVoucher(eVoucher item)
 {
     _context.EVouchers.Add(item);
     _context.EVoucherPaymentModes.AddRange(item.eVoucherPaymentMode);
     _context.SaveChanges();
 }