public CreateTaxViewModel(IViewModelsFactory<ITaxOverviewStepViewModel> overviewVmFactory, IViewModelsFactory<IGeneralLanguagesStepViewModel> langVmFactory, Tax item)
        {
			RegisterStep(overviewVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("item", item), new KeyValuePair<string, object>("isWizardMode", true)));
			RegisterStep(langVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("selectedLanguages", item.TaxLanguages)));
        }
        public TaxOverviewStepViewModel(IRepositoryFactory<IOrderRepository> repositoryFactory, IOrderEntityFactory entityFactory, IViewModelsFactory<IGeneralLanguagesStepViewModel> langVmFactory, 
			IViewModelsFactory<ITaxValueViewModel> valueVmFactory, Tax item)
            : base(repositoryFactory, entityFactory,langVmFactory, valueVmFactory, item)
        {
        }
		public override string Import(string catalogId, string propertySetId, ImportItem[] systemValues, ImportItem[] customValues, IRepository repository)
		{
			var _error = string.Empty;
			_repository = (ITaxRepository)repository;

			var action = GetAction(systemValues.First(x => x.Name == "Action").Value);

			switch (action)
			{
				case ImportAction.Insert:
					var itemI = systemValues.FirstOrDefault(y => y.Name == "TaxId");
					if (itemI != null)
					{
						var originalItem = _repository.Taxes.Where(x => x.TaxId == itemI.Value);
						if (originalItem.Count() == 0)
						{
							var name = systemValues.FirstOrDefault(y => y.Name == "TaxName");
							var type = systemValues.FirstOrDefault(y => y.Name == "TaxType");
							var addItem = new Tax { TaxId = itemI.Value, Name = name.Value, TaxType = Int32.Parse(type.Value) };
							_repository.Add(addItem);
							_repository.UnitOfWork.Commit();
						}
					}
					
					var tax = _repository.Taxes.Where(x => x.TaxId == itemI.Value);
					if (tax.Count() > 0)
					{
						var t = tax.First();
						var value = InitializeItem(null, systemValues);
						t.TaxValues.Add(value);
					}
					break;
				case ImportAction.InsertAndReplace:
					var itemR = systemValues.FirstOrDefault(y => y.Name == "TaxId");
					if (itemR != null)
					{
						var originalItem = _repository.Taxes.Where(x => x.TaxId == itemR.Value).SingleOrDefault();
						if (originalItem != null)
							_repository.Remove(originalItem);
					}

					var replaceItem = InitializeItem(null, systemValues);
					_repository.Add(replaceItem);
					break;
				case ImportAction.Update:
					//var itemU = systemValues.FirstOrDefault(y => y.Name == "PriceId");
					//if (itemU != null)
					//{
					//	var origItem = _repository.Taxes.Where(x => x.TaxId == itemU.Value).SingleOrDefault();
					//	if (origItem != null && origItem is TaxValue)
					//	{
					//		InitializeItem((TaxValue)origItem, systemValues);
					//		_repository.Update(origItem);
					//	}
					//}
					break;
				case ImportAction.Delete:
					var itemD = systemValues.FirstOrDefault(y => y.Name == "TaxId");
					if (itemD != null)
					{
						var deleteItem = _repository.Taxes.Where(x => x.TaxId == itemD.Value).SingleOrDefault();
						if (deleteItem != null)
							_repository.Remove(deleteItem);
					}
					break;
			}
			return _error;
		}