Beispiel #1
0
 public IEnumerable <Item> AllItems(SortDirection sortDirection, string sortField)
 {
     //if (string.IsNullOrEmpty(sortField))
     //    return itemDao.FindAllSorted(sortDirection, "Name");
     //return itemDao.FindAllSorted(sortDirection, sortField);
     return(itemDao.FindAll());
 }
Beispiel #2
0
        public PriceDto GetPrice(string userName)
        {
            User         user  = userDao.FindByLogin(userName);
            IList <Item> items = itemDao.FindAll();

            ItemDto[] dtos = new ItemDto[items.Count];
            for (int i = 0; i < items.Count; i++)
            {
                dtos[i] = new ItemDto(items[i], user.PriceType);
            }
            List <string> catNames = new List <string>();

            foreach (Category category in categoryDao.FindAll())
            {
                catNames.Add(category.Name);
            }
            return(new PriceDto(dtos, catNames.ToArray()));
        }