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); }
private ITArticleApplicationItem(ITArticle iTArticleItem, int iTArticleNumber) { this.Id = Guid.NewGuid(); this.ITArticleItem = iTArticleItem; this.ITArticleNumber = iTArticleNumber; }