public InventoryItemDetailsviewModel(InventoryItem item)
 {
     var repositoryManager = new RepositoryManager();
     Item = item;
     Categories = repositoryManager.CategoryRepository.Get(x => true).ToList();
     Authors = repositoryManager.AuthorRepository.Get(x => true).ToList();
     Filters = repositoryManager.FilterRepository.Get(x => true).ToList();
 }
예제 #2
0
        public ItemDetailViewModel(int inventoryItemId)
        {
            var repositoryManager = new RepositoryManager();

            this.ItemDetails = repositoryManager.InventoryRepository.GetByID(inventoryItemId);

            this.SuggestedItems = repositoryManager.InventoryRepository.Get().Take(4).ToList();
        }
예제 #3
0
        public CategoryViewModel(string pageHeader, string categoryName)
        {
            CategoryHeader = pageHeader;
            CategoryName = categoryName;

            CategoryItems = new RepositoryManager().InventoryRepository.Get(entity => entity.Category.name == categoryName).ToList();
            SetAuthorAndFilterSelections(CategoryItems);
            SelectedAuthorFilterId = -1;
            SelectedFilterId = -1;
        }
예제 #4
0
 public static async Task<bool> saveEmail(string email)
 {
     return await Task.Run(() =>
     {
         email = email.ToLower();
         var manager = new RepositoryManager();
         try
         {
             manager.AccountRepository.Insert(new AccountInformation() { Email = email });
             manager.save();
             return true;
         }
         catch (Exception e)
         {
             return false;
         }
     });
 }
예제 #5
0
        public CategoryViewModel(string pageHeader, string categoryName, int authorFilterId, int filterId)
        {
            var inventoryRepo = new RepositoryManager().InventoryRepository;
            CategoryHeader = pageHeader;
            CategoryName = categoryName;

            CategoryItems = inventoryRepo.Get(entity => entity.Category.name == categoryName).ToList();
            SetAuthorAndFilterSelections(this.CategoryItems);

            if (authorFilterId != -1)
            {
                CategoryItems = CategoryItems.Where(entity => entity.Authors.FirstOrDefault(author => author.AuthorId == authorFilterId) != null).ToList();
            }
            if (filterId != -1)
            {
                CategoryItems = CategoryItems.Where(entity => entity.Filters.FirstOrDefault(filter => filter.FilterId == filterId) != null).ToList();
            }

            SelectedFilterId = filterId;
            SelectedAuthorFilterId = authorFilterId;
        }
 public AdminOrdersController()
 {
     _manager = new RepositoryManager();
 }
예제 #7
0
 public PayPalService()
 {
     _repositoryManager = new RepositoryManager();
     _shoppingCartService = new ShoppingCartService();
 }
예제 #8
0
 public AuthorService()
 {
     _manager = new RepositoryManager();
 }
 public AdminInventoryController()
 {
     _manager = new RepositoryManager();
 }
예제 #10
0
 public AnnouncementService()
 {
     _manager = new RepositoryManager();
 }
예제 #11
0
 public ViewCartViewModel(ShoppingCartModels cart)
 {
     RepositoryManager manager = new RepositoryManager();
     this.cart = cart;
     this.otherItemsToBuy = manager.InventoryRepository.Get().Take(3).ToList();
 }
예제 #12
0
 public NewsLetterController()
 {
     _manager = new RepositoryManager();
 }