Пример #1
0
        public TabsViewModelBuilder(string tabKey, string tabId, XDocument tabsource, ITabsRepository tabsRepository, IJewelRepository jewelRepository, IFileSystem fileSystem)
        {
            this.tabKey = tabKey;
            this.tabId  = tabId;

            this.tabsRepository  = tabsRepository;
            this.jewelRepository = jewelRepository;
            this.fileSystem      = fileSystem;
            this.tabsource       = tabsource;

            //defaults
            itemsPerPage         = 21;
            page                 = 1;
            JewelMediaTypeFilter = new MetalFilter(JewelMediaType.WhiteGold);
            OrderByPriceFilter   = new OrderByPriceFilter(OrderByPrice.LowToHigh);
        }
Пример #2
0
        public TabsViewModelBuilder(ITabsViewModel model, XDocument tabsource, ITabsRepository tabsRepository, IJewelRepository jewelRepository, IFileSystem fileSystem)
        {
            tabKey = model.TabKey;
            tabId  = model.TabId;

            this.tabsRepository  = tabsRepository;
            this.jewelRepository = jewelRepository;
            this.fileSystem      = fileSystem;
            this.tabsource       = tabsource;

            //extract from model
            itemsPerPage = model.ItemsPerPage;
            page         = model.Page;

            JewelMediaTypeFilter = new MetalFilter(model.MetalFilter);
            OrderByPriceFilter   = new OrderByPriceFilter(model.OrderByPrice);

            if (model.CustomFilters != null)
            {
                CustomFiltersStateList = model.CustomFilters;
            }
        }