Example #1
0
        public void FromDto(OptionItemDTO dto)
        {
            if (dto == null) return;

            this.Bvin = dto.Bvin ?? string.Empty;
            this.IsLabel = dto.IsLabel;
            this.Name = dto.Name ?? string.Empty;
            this.OptionBvin = dto.OptionBvin ?? string.Empty;
            this.PriceAdjustment = dto.PriceAdjustment;
            this.SortOrder = dto.SortOrder;
            this.StoreId = dto.StoreId;
            this.WeightAdjustment = dto.WeightAdjustment;
        }
Example #2
0
        //DTO
        public OptionItemDTO ToDto()
        {
            OptionItemDTO dto = new OptionItemDTO();

            dto.Bvin = this.Bvin;
            dto.IsLabel = this.IsLabel;
            dto.Name = this.Name;
            dto.OptionBvin = this.OptionBvin;
            dto.PriceAdjustment = this.PriceAdjustment;
            dto.SortOrder = this.SortOrder;
            dto.StoreId = this.StoreId;
            dto.WeightAdjustment = this.WeightAdjustment;

            return dto;
        }
Example #3
0
        private List<OptionItemDTO> LoadOptionItemsChoice(int choiceID)
        {
            List<OptionItemDTO> result = new List<OptionItemDTO>();

            data.bvc2004Entities db = new data.bvc2004Entities(EFConnString(settings.SourceConnectionString()));
            var items = db.bvc_ProductChoices_Item.Where(y => y.ChoiceID == choiceID).OrderBy(y => y.SortOrder);
            if (items == null) return result;

            foreach (data.bvc_ProductChoices_Item item in items)
            {
                OptionItemDTO dto = new OptionItemDTO();
                dto.Bvin = item.ID.ToString();
                dto.IsLabel = item.NullItem == 1;
                dto.Name = item.DisplayText;
                dto.OptionBvin = choiceID.ToString();
                dto.PriceAdjustment = (decimal)item.PriceAdjustment;
                dto.SortOrder = item.SortOrder;
                dto.WeightAdjustment = (decimal)item.WeightAdjustment;
                result.Add(dto);
            }

            return result;
        }
Example #4
0
        private List<OptionItemDTO> LoadOptionItemsModifier(string bvin)
        {
            List<OptionItemDTO> result = new List<OptionItemDTO>();

            data.BV53Entities db = new data.BV53Entities(EFConnString(settings.SourceConnectionString()));
            var items = db.bvc_ProductModifierOption.Where(y => y.ModifierId == bvin)
                            .OrderBy(y => y.Order);
            if (items == null) return result;

            foreach (data.bvc_ProductModifierOption item in items)
            {
                OptionItemDTO dto = new OptionItemDTO();
                dto.Bvin = item.bvin;
                dto.IsLabel = item.Null;
                dto.Name = item.Name;
                dto.OptionBvin = bvin;
                dto.PriceAdjustment = item.PriceAdjustment;
                dto.SortOrder = item.Order;
                dto.WeightAdjustment = item.WeightAdjustment;
                result.Add(dto);
            }

            return result;
        }