protected override void InitSizeRatios()
 {
     base.InitSizeRatios();
     for (int i = 1; i < 13; i++)
     {
         var sizeRate = GetSizeRate(i);
         if (sizeRate != null)
         {
             SizeRatios.Add(sizeRate);
         }
     }
 }
        public override void Restore(Stream str)
        {
            base.Restore(str);

            if (str.ReadByte() == 0)
            {
                int numberOfItems = str.ReadInteger();

                if (numberOfItems > 0)
                {
                    for (int i = 0; i < numberOfItems; i++)
                    {
                        SizeRatios.Add(str.ReadShort());
                    }
                }
            }
        }
        /// <summary>
        /// Constructing with a PurchaseOrder instance
        /// </summary>
        /// <param name="entity">PurchaseOrder instance</param>
        protected virtual void Constructing(PurchaseOrder entity)
        {
            foreach (var rate in entity.SizeRatios)
            {
                SizeRatios.Add(new POSizeRatioDTO(rate));
            }

            if (entity.Designer?.AspNetUser != null)
            {
                DesignerName = string.Format("{0} {1}", entity.Designer.AspNetUser.FirstName, entity.Designer.AspNetUser.LastName);
            }

            if (entity.Merchandiser1?.AspNetUser != null)
            {
                Merchandiser1Name = string.Format("{0} {1}", entity.Merchandiser1.AspNetUser.FirstName, entity.Merchandiser1.AspNetUser.LastName);
            }

            if (entity.Merchandiser2?.AspNetUser != null)
            {
                Merchandiser2Name = string.Format("{0} {1}", entity.Merchandiser2.AspNetUser.FirstName, entity.Merchandiser2.AspNetUser.LastName);
            }
        }