public ProductGroupDiscountDTO Map(ProductGroupDiscount productGroupDiscount) { if (productGroupDiscount == null) return null; if (productGroupDiscount.GroupDiscount == null) return null; var item = new ProductGroupDiscountDTO() { DateCreated = productGroupDiscount._DateCreated, DateLastUpdated = productGroupDiscount._DateLastUpdated, StatusId = (int) productGroupDiscount._Status, DiscountGroupMasterId = productGroupDiscount.GroupDiscount.Id, MasterId = productGroupDiscount.Id, DiscountRate = productGroupDiscount.DiscountRate, EffectiveDate = productGroupDiscount.EffectiveDate, EndDate = productGroupDiscount.EndDate, ProductMasterId =productGroupDiscount.Product.ProductId }; return item; }
public ProductGroupDiscount Map(ProductGroupDiscountDTO dto) { if (dto == null) return null; var productGroupDiscount = Mapper.Map<ProductGroupDiscountDTO, ProductGroupDiscount>(dto); productGroupDiscount.GroupDiscount = _discountGroupRepository.GetById(dto.DiscountGroupMasterId); productGroupDiscount.DiscountRate = dto.DiscountRate; productGroupDiscount.EffectiveDate = dto.EffectiveDate; productGroupDiscount.EndDate = dto.EndDate; productGroupDiscount.Quantity = dto.Quantity; productGroupDiscount.Product = new ProductRef() {ProductId = dto.ProductMasterId}; return productGroupDiscount; }
public ProductGroupDiscount MapProductGroupDiscount(ProductGroupDiscountDTO dto) { if (dto == null) return null; var productGroupDiscount = new ProductGroupDiscount(dto.MasterId) { GroupDiscount = _discountGroupRepository.GetById(dto.DiscountGroupMasterId), _DateCreated = dto.DateCreated, _DateLastUpdated = dto.DateLastUpdated, _Status = (EntityStatus) dto.StatusId, }; productGroupDiscount.DiscountRate = dto.DiscountRate; productGroupDiscount.EffectiveDate = dto.EffectiveDate; productGroupDiscount.EndDate = dto.EndDate; productGroupDiscount.Product = new ProductRef() {ProductId = dto.ProductMasterId}; return productGroupDiscount; }
private ProductGroupDiscountDTO Map(tblProductDiscountGroup tbl) { var dto = new ProductGroupDiscountDTO { MasterId = tbl.id, DateCreated = tbl.IM_DateCreated, DateLastUpdated = tbl.IM_DateLastUpdated, StatusId = tbl.IM_Status, DiscountGroupMasterId = tbl.DiscountGroup, Quantity = tbl.Quantity.Value, DiscountRate = tbl.DiscountRate.Value, EffectiveDate = tbl.EffectiveDate.Value, EndDate = tbl.EndDate.Value, ProductMasterId = tbl.ProductRef.Value, }; return dto; }