Exemplo n.º 1
0
        public void UpdateDiscount(DiscountConfigurationDto discountConfigurationDto)
        {
            var discount = this.iDiscountConfigurationDataService.GetDiscount(discountConfigurationDto.ID);

            discount.ID       = discountConfigurationDto.ID;
            discount.Name     = discountConfigurationDto.Name;
            discount.FromDate = discountConfigurationDto.FromDate;
            discount.ToDate   = discountConfigurationDto.ToDate;
            discount.FromTime = discountConfigurationDto.FromTime;
            discount.ToTime   = discountConfigurationDto.ToTime;
            discount.Rate     = discountConfigurationDto.Rate;

            this.iDiscountConfigurationDataService.SaveChanges();
        }
Exemplo n.º 2
0
        public void AddDiscount(DiscountConfigurationDto value)
        {
            var discountConfiguration = new DiscountConfiguration();

            discountConfiguration.ID       = value.ID;
            discountConfiguration.Name     = value.Name;
            discountConfiguration.FromDate = value.FromDate;
            discountConfiguration.ToDate   = value.ToDate;
            discountConfiguration.FromTime = value.FromTime;
            discountConfiguration.ToTime   = value.ToTime;
            discountConfiguration.Rate     = value.Rate;

            this.iDiscountConfigurationDataService.AddDiscount(discountConfiguration);
        }
Exemplo n.º 3
0
        public DiscountConfigurationDto GetDiscount(int id)
        {
            var discount = this.iDiscountConfigurationDataService.GetDiscount(id);

            var discountDto = new DiscountConfigurationDto();

            discountDto.ID       = discount.ID;
            discountDto.Name     = discount.Name;
            discountDto.FromDate = discount.FromDate;
            discountDto.ToDate   = discount.ToDate;
            discountDto.FromTime = discount.FromTime;
            discountDto.ToTime   = discount.ToTime;
            discountDto.Rate     = discount.Rate;

            return(discountDto);
        }
Exemplo n.º 4
0
 public IEnumerable <DiscountConfigurationDto> UpdateDiscount([FromBody] DiscountConfigurationDto value)
 {
     discountService.UpdateDiscount(value);
     return(this.discountService.GetDiscountConfiguration());
 }
Exemplo n.º 5
0
 public void AddDiscount([FromBody] DiscountConfigurationDto value)
 {
     discountService.AddDiscount(value);
 }