예제 #1
0
        public static ITArticleApplicationItem CreateITArticleApplicationItem(ITArticle iTArticle, int iTArticleNumbers)
        {
            ITArticleApplicationItem iTArticleApplicationItem = null;

            if (iTArticle.IsHavingStock(iTArticleNumbers))
            {
                iTArticle.ReduceStock(iTArticleNumbers);
                iTArticleApplicationItem = new ITArticleApplicationItem(iTArticle, iTArticleNumbers);
            }
            else
            {
                throw(new ArgumentOutOfRangeException("Don't have enough stock!"));
            }
            return(iTArticleApplicationItem);
        }
예제 #2
0
 private ITArticleApplicationItem(ITArticle iTArticleItem, int iTArticleNumber)
 {
     this.Id              = Guid.NewGuid();
     this.ITArticleItem   = iTArticleItem;
     this.ITArticleNumber = iTArticleNumber;
 }