Пример #1
0
        private List <Quantity> GetFixedLotSize()
        {
            List <Quantity> lotSizes       = new List <Quantity>();
            Quantity        fixedLotSize   = _defaultFixedLotSize;
            int?            articleLotSize = _dbMasterDataCache.M_ArticleGetById(_articleId).LotSize;

            if (articleLotSize != null)
            {
                fixedLotSize = new Quantity(articleLotSize.GetValueOrDefault());
            }

            // you work on a copy here
            Quantity currentQuantity = new Quantity(_neededQuantity);

            while (currentQuantity.IsGreaterThan(Quantity.Null()))
            {
                lotSizes.Add(fixedLotSize);
                currentQuantity.DecrementBy(fixedLotSize);
            }

            return(lotSizes);
        }
 public M_Article GetArticle()
 {
     return(_dbMasterDataCache.M_ArticleGetById(GetArticleId()));
 }