Ejemplo n.º 1
0
        public void AddOrUpdateArticle(ArticleEntity newEntity)
        {
            ArticleEntity oldEntity = ArticleList.FirstOrDefault <ArticleEntity>(p => p.ArticleNo == newEntity.ArticleNo);

            if (oldEntity == null)
            {
                ArticleList.Insert(0, newEntity);
            }
            else
            {
                int index = ArticleList.IndexOf(oldEntity);
                ArticleList.Remove(oldEntity);
                ArticleList.Insert(index, newEntity);
            }
            ArticleList = new List <ArticleEntity>(_articleList);
        }