Exemple #1
0
        public OpenBoxViewModel()
        {
            BoxQuantity = 1;
            Owned       = true;

            StyleItems = new StyleItemCollection(StyleItemDisplayMode.BoxQty);
        }
Exemple #2
0
 public StyleCountingViewModel()
 {
     Locations  = new List <LocationViewModel>();
     StyleItems = new StyleItemCollection()
     {
         DisplayMode = StyleItemDisplayMode.Standard,
         Items       = new List <StyleItemViewModel>()
     };
 }
        private void ConstructFrom(SealedBoxDto item,
                                   StyleEntireDto style,
                                   List <StyleItemDTO> styleItems,
                                   List <SealedBoxItemDto> boxItems)
        {
            Id      = item.Id;
            StyleId = item.StyleId;
            if (style != null)
            {
                StyleString = style.StyleID;
            }

            BoxBarcode       = item.BoxBarcode;
            Printed          = item.Printed;
            PolyBags         = item.PolyBags;
            BoxQuantity      = item.BoxQuantity;
            Owned            = item.Owned;
            Price            = item.PajamaPrice;
            Archived         = item.Archived;
            UpdateDate       = item.UpdateDate;
            CreateDate       = item.CreateDate;
            OriginCreateDate = item.OriginCreateDate;

            UpdatedByName = item.UpdatedByName;

            BoxItemsQuantity = boxItems.Sum(b => b.BreakDown);

            StyleItems = new StyleItemCollection()
            {
                DisplayMode = StyleItemDisplayMode.BoxBreakdown,
                Items       = styleItems
                              .OrderBy(si => SizeHelper.GetSizeIndex(si.Size))
                              .ThenBy(si => si.Color)
                              .Select(si => new StyleItemViewModel(si)).ToList()
            };

            //Set boxes values
            foreach (var boxItem in boxItems)
            {
                var styleItem = StyleItems.Items.FirstOrDefault(si => si.Id == boxItem.StyleItemId);
                if (styleItem != null)
                {
                    styleItem.Breakdown = boxItem.BreakDown;
                    styleItem.BoxItemId = boxItem.Id;
                }
            }

            Breakdown = string.Join("-", StyleItems.Items
                                    .OrderBy(si => SizeHelper.GetSizeIndex(si.Size))
                                    .ThenBy(si => si.Color)
                                    .Where(si => si.Breakdown.HasValue)
                                    .Select(si => si.Breakdown).ToList());
        }
Exemple #4
0
        private void ConstructFrom(IUnitOfWork db,
                                   OpenBoxDto item,
                                   StyleEntireDto style,
                                   IList <StyleItemDTO> styleItems,
                                   List <OpenBoxItemDto> boxItems,
                                   List <OpenBoxTrackingDTO> boxTrackings)
        {
            Id      = item.Id;
            StyleId = item.StyleId;

            if (style != null)
            {
                StyleString = style.StyleID;
            }

            Type = item.Type;

            BoxBarcode  = item.BoxBarcode;
            Printed     = item.Printed;
            PolyBags    = item.PolyBags;
            BoxQuantity = item.BoxQuantity;
            Price       = item.Price;
            Owned       = item.Owned;
            Archived    = item.Archived;

            CreateDate = item.CreateDate;
            UpdateDate = item.UpdateDate;

            UpdatedByName = item.UpdatedByName;

            SizesQuantity = boxItems.Sum(s => s.Quantity);

            StyleItems = new StyleItemCollection()
            {
                DisplayMode = StyleItemDisplayMode.BoxQty,
                Items       = styleItems
                              .OrderBy(si => SizeHelper.GetSizeIndex(si.Size))
                              .ThenBy(si => si.Color)
                              .Select(si => new StyleItemViewModel(si))
                              .ToList()
            };

            //Set boxes values
            foreach (var boxItem in boxItems)
            {
                var styleItem = StyleItems.Items.FirstOrDefault(si => si.Id == boxItem.StyleItemId);
                if (styleItem != null)
                {
                    styleItem.Quantity  = boxItem.Quantity;
                    styleItem.BoxItemId = boxItem.Id;
                }
            }
        }
        public SealedBoxViewModel()
        {
            Owned = true;

            StyleItems = new StyleItemCollection(StyleItemDisplayMode.BoxBreakdown);
        }