public PriceListAssignmentOverviewStepViewModel(
			IRepositoryFactory<IPricelistRepository> repositoryFactory, 
			IRepositoryFactory<ICatalogRepository> catalogRepositoryFactory, 
			ICatalogEntityFactory entityFactory, 
			IAuthenticationContext authContext, 
			PricelistAssignment item)
            : base(null, repositoryFactory, catalogRepositoryFactory, entityFactory, authContext, item)
		{
		}
		public PriceListAssignmentSetConditionsStepViewModel(
			IRepositoryFactory<ICountryRepository> countryRepositoryFactory, 
			IRepositoryFactory<IPricelistRepository> repositoryFactory, 
			IRepositoryFactory<ICatalogRepository> catalogRepositoryFactory, 
			ICatalogEntityFactory entityFactory, 
			IAuthenticationContext authContext, 
			PricelistAssignment item)
            : base(countryRepositoryFactory, repositoryFactory, catalogRepositoryFactory, entityFactory, authContext, item)
		{
		}
        public CreatePriceListAssignmentViewModel(
			IViewModelsFactory<IPriceListAssignmentOverviewStepViewModel> overviewVmFactory, 
			IViewModelsFactory<IPriceListAssignmentSetConditionsStepViewModel> conditionsVmFactory,  
			IViewModelsFactory<IPriceListAssignmentSetDatesStepViewModel> datesVmFactory, 
			PricelistAssignment item)
		{
            RegisterStep(overviewVmFactory.GetViewModelInstance(
                new KeyValuePair<string, object>("item", item)));
            RegisterStep(conditionsVmFactory.GetViewModelInstance(
                new KeyValuePair<string, object>("item", item)));
            RegisterStep(datesVmFactory.GetViewModelInstance(
                new KeyValuePair<string, object>("item", item)));
        }
Exemplo n.º 4
0
		protected PricelistAssignment GeneratePrices(IEnumerable<Item> items, string catalogId)
		{
			var pricelist = new Pricelist
			{
				Currency = CustomerSessionService.CustomerSession.Currency,
				Name = "TestPrice",
			};

			foreach (var item in items)
			{
				var price = new Price
				{
					Sale = 100,
					List = 120,
					ItemId = item.ItemId,
					MinQuantity = 1,
					PricelistId = pricelist.PricelistId,
				};

				pricelist.Prices.Add(price);
			}

			var priceListAssignment = new PricelistAssignment
			{
				CatalogId = catalogId,
				Name = "testAssigment",
				Pricelist = pricelist,
				PricelistId = pricelist.PricelistId
			};

			PricelistRepository.Add(priceListAssignment);
			PricelistRepository.UnitOfWork.Commit();

			return priceListAssignment;
		}