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(); }
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); }
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); }
public IEnumerable <DiscountConfigurationDto> UpdateDiscount([FromBody] DiscountConfigurationDto value) { discountService.UpdateDiscount(value); return(this.discountService.GetDiscountConfiguration()); }
public void AddDiscount([FromBody] DiscountConfigurationDto value) { discountService.AddDiscount(value); }