public void UpdateView()
        {
            var articlePriceTypes = _priceTypeRepository.GetEntities();

            ArticlePriceTypes.Clear();

            foreach (var type in articlePriceTypes)
            {
                ArticlePriceTypes.Add(type);
            }
        }
Example #2
0
        private IEnumerable <ArticlePrice> GetArticlePricesFromReader(DbDataReader reader)
        {
            while (reader.Read())
            {
                var articleId          = reader.GetFieldFromReader <int>("WAREHOUSE_ID");
                var articlePriceTypeId = reader.GetFieldFromReader <int>("WAREHOUSE_CATEGORY_ID");

                yield return(new ArticlePrice
                {
                    Id = reader.GetFieldFromReader <int>("ID"),
                    ArticleId = articleId,
                    ArticlePriceTypeId = reader.GetFieldFromReader <int>("WAREHOUSE_CATEGORY_ID"),
                    Value = reader.GetFieldFromReader <decimal>("PRICE_VALUE"),
                    EntryDate = reader.GetFieldFromReader <DateTime>("ENTRY_DATE"),

                    Article = Articles.FirstOrDefault(articleItem => articleItem.Id == articleId),
                    ArticlePriceType = ArticlePriceTypes.FirstOrDefault(articlePriceTypeItem => articlePriceTypeItem.Id == articlePriceTypeId)
                });
            }
        }