/// <summary>
        /// public. For viewing
        /// </summary>
        public CatalogViewModel(IViewModelsFactory <IPropertyViewModel> propertyVmFactory, IViewModelsFactory <IPropertySetViewModel> propertySetVmFactory,
                                ITreeCatalogViewModel parentTreeVM,
                                ICatalogEntityFactory entityFactory, catalogModel.Catalog item,
                                IRepositoryFactory <ICatalogRepository> repositoryFactory,
                                IRepositoryFactory <IAppConfigRepository> appConfigRepositoryFactory, INavigationManager navManager)
            : this(repositoryFactory, appConfigRepositoryFactory, entityFactory, item, false)
        {
            _parentTreeVM = parentTreeVM;
            _navManager   = navManager;

            _propertyVmFactory    = propertyVmFactory;
            _propertySetVmFactory = propertySetVmFactory;

            CurrentCatalogProperties = new ObservableCollection <Property>();
            ViewTitle = new ViewTitleBase
            {
                Title    = "Catalog",
                SubTitle = (item != null && !string.IsNullOrEmpty(item.Name)) ? item.Name.ToUpper(CultureInfo.InvariantCulture) : ""
            };

            PropertyCreateCommand    = new DelegateCommand(RaisePropertyCreateInteractionRequest);
            PropertyEditCommand      = new DelegateCommand <Property>(RaisePropertyEditInteractionRequest, x => x != null);
            PropertyDeleteCommand    = new DelegateCommand <Property>(RaisePropertyDeleteInteractionRequest, x => x != null);
            PropertySetCreateCommand = new DelegateCommand(RaisePropertySetCreateInteractionRequest);
            PropertySetEditCommand   = new DelegateCommand <PropertySet>(RaisePropertySetEditInteractionRequest, x => x != null);

            OpenItemCommand = new DelegateCommand(() => _navManager.Navigate(NavigationData));
        }
        public CreateItemViewModel(
            IViewModelsFactory<IItemOverviewStepViewModel> overviewVmFactory,
            IViewModelsFactory<IItemPropertiesStepViewModel> propertiesVmFactory,
            IViewModelsFactory<IItemPricingStepViewModel> pricingVmFactory,
            IViewModelsFactory<IEditorialReviewViewModel> reviewVmFactory,
            Item item, IViewModel parentEntityVM, ICatalogEntityFactory entityFactory)
        {
            _itemModel = new ItemStepModel
                {
                    InnerItem = item,
                    ParentEntityVM = parentEntityVM,
                    ParentWizard = this
                };

            var allParameters = new[] { new KeyValuePair<string, object>("itemModel", _itemModel) };

            // properties Step must be created first
            var propertiesStep = propertiesVmFactory.GetViewModelInstance(allParameters);
            // this step is created second, but registered first
            RegisterStep(overviewVmFactory.GetViewModelInstance(allParameters));
            RegisterEditorialReviewStep(item, entityFactory, reviewVmFactory);

            // properties Step is registered third
            RegisterStep(propertiesStep);

            pricingStep4 = pricingVmFactory.GetViewModelInstance(allParameters);
            // this step is added or removed at RUNTIME
            // RegisterStep(pricingStep4);

            item.StartDate = DateTime.Today;
        }
Ejemplo n.º 3
0
        public PropertyViewModel(IViewModelsFactory <IPropertyValueViewModel> propertyValueVmFactory, IViewModelsFactory <IPropertyAttributeViewModel> attributeVmFactory, ICatalogEntityFactory entityFactory, Property item, catalogModel.Catalog parentCatalog, IRepositoryFactory <ICatalogRepository> repositoryFactory)
        {
            InnerItem = item;
            _propertyValueVmFactory = propertyValueVmFactory;
            _attributeVmFactory     = attributeVmFactory;
            _entityFactory          = entityFactory;
            ParentCatalog           = parentCatalog;
            _repositoryFactory      = repositoryFactory;

            ValueAddCommand    = new DelegateCommand(RaiseValueAddInteractionRequest);
            ValueEditCommand   = new DelegateCommand <PropertyValueBase>(RaiseValueEditInteractionRequest, x => x != null);
            ValueDeleteCommand = new DelegateCommand <PropertyValueBase>(RaiseValueDeleteInteractionRequest, x => x != null);

            AttributeAddCommand    = new DelegateCommand(RaiseAttributeAddInteractionRequest);
            AttributeEditCommand   = new DelegateCommand <PropertyAttribute>(RaiseAttributeEditInteractionRequest, x => x != null);
            AttributeDeleteCommand = new DelegateCommand <PropertyAttribute>(RaiseAttributeDeleteInteractionRequest, x => x != null);


            CommonConfirmRequest = new InteractionRequest <Confirmation>();

            var allValueTypes = (PropertyValueType[])Enum.GetValues(typeof(PropertyValueType));

            PropertyTypes = new List <PropertyValueType>(allValueTypes);
            PropertyTypes.Sort((x, y) => x.ToString().CompareTo(y.ToString()));
        }
        public PropertyViewModel(IViewModelsFactory<IPropertyValueViewModel> propertyValueVmFactory, IViewModelsFactory<IPropertyAttributeViewModel> attributeVmFactory, ICatalogEntityFactory entityFactory, Property item, catalogModel.Catalog parentCatalog, IRepositoryFactory<ICatalogRepository> repositoryFactory, ObservableCollection<Property> properties)
        {
            InnerItem = item;
            _propertyValueVmFactory = propertyValueVmFactory;
            _attributeVmFactory = attributeVmFactory;
            _entityFactory = entityFactory;
            _properties = properties;
            ParentCatalog = parentCatalog;
            // _repositoryFactory = repositoryFactory;

            ValueAddCommand = new DelegateCommand(RaiseValueAddInteractionRequest);
            ValueEditCommand = new DelegateCommand<PropertyValueBase>(RaiseValueEditInteractionRequest, x => x != null);
            ValueDeleteCommand = new DelegateCommand<PropertyValueBase>(RaiseValueDeleteInteractionRequest, x => x != null);

            AttributeAddCommand = new DelegateCommand(RaiseAttributeAddInteractionRequest);
            AttributeEditCommand = new DelegateCommand<PropertyAttribute>(RaiseAttributeEditInteractionRequest, x => x != null);
            AttributeDeleteCommand = new DelegateCommand<PropertyAttribute>(RaiseAttributeDeleteInteractionRequest, x => x != null);


            CommonConfirmRequest = new InteractionRequest<Confirmation>();

            var allValueTypes = (PropertyValueType[])Enum.GetValues(typeof(PropertyValueType));
            PropertyTypes = new List<PropertyValueType>(allValueTypes);
            PropertyTypes.Sort((x, y) => x.ToString().CompareTo(y.ToString()));
        }
Ejemplo n.º 5
0
        public CreateItemViewModel(
            IViewModelsFactory <IItemOverviewStepViewModel> overviewVmFactory,
            IViewModelsFactory <IItemPropertiesStepViewModel> propertiesVmFactory,
            IViewModelsFactory <IItemPricingStepViewModel> pricingVmFactory,
            IViewModelsFactory <IEditorialReviewViewModel> reviewVmFactory,
            Item item, IViewModel parentEntityVM, ICatalogEntityFactory entityFactory)
        {
            _itemModel = new ItemStepModel
            {
                InnerItem      = item,
                ParentEntityVM = parentEntityVM,
                ParentWizard   = this
            };

            var allParameters = new[] { new KeyValuePair <string, object>("itemModel", _itemModel) };

            // properties Step must be created first
            var propertiesStep = propertiesVmFactory.GetViewModelInstance(allParameters);

            // this step is created second, but registered first
            RegisterStep(overviewVmFactory.GetViewModelInstance(allParameters));
            RegisterEditorialReviewStep(item, entityFactory, reviewVmFactory);

            // properties Step is registered third
            RegisterStep(propertiesStep);

            pricingStep4 = pricingVmFactory.GetViewModelInstance(allParameters);
            // this step is added or removed at RUNTIME
            // RegisterStep(pricingStep4);

            item.StartDate = DateTime.Today;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// public. For viewing
        /// </summary>
        public EditorialReviewViewModel(ICatalogEntityFactory entityFactory, INavigationManager navManager,
                                        EditorialReview item, bool isWizardMode)
            : base(entityFactory, item, isWizardMode)
        {
            _navManager          = navManager;
            _originalCatalogItem = OriginalItem.CatalogItem;

            ViewTitle = new ViewTitleBase()
            {
                Title    = "Editorial Review",
                SubTitle = (item != null && item.CatalogItem != null && !string.IsNullOrEmpty(item.CatalogItem.Name))
                               ? string.Format("ER: {0}".Localize(), item.CatalogItem.Name).ToUpper(CultureInfo.InvariantCulture)
                               : ""
            };

            if (!IsWizardMode)
            {
                ReviewStateSetActiveCommand = new DelegateCommand(() =>
                {
                    InnerItem.ReviewState = ReviewState.Active.GetHashCode();
                    RaiseCanExecuteChanged();
                }, () => InnerItem.ReviewState != ReviewState.Active.GetHashCode());
                ReviewStateSetDraftCommand = new DelegateCommand(() =>
                {
                    InnerItem.ReviewState = ReviewState.Draft.GetHashCode();
                    RaiseCanExecuteChanged();
                }, () => InnerItem.ReviewState != ReviewState.Draft.GetHashCode());

                OpenItemCommand = new DelegateCommand(() => _navManager.Navigate(NavigationData));
            }
        }
 public ImportJobViewModelBack(IUnityContainer container, ICatalogEntityFactory entityFactory, ImportJob item)
     : this(container, entityFactory, item, null, true)
 {
     ViewTitle = new ViewTitleBase()
     {
         Title = "Import job", SubTitle = DisplayName.ToUpper()
     };
 }
Ejemplo n.º 8
0
		public EFCatalogRepository(string connectionStringName, ICatalogEntityFactory entityFactory, IInterceptor[] interceptors = null)
			: base(connectionStringName, entityFactory, interceptors: interceptors)
		{
			Database.SetInitializer(new ValidateDatabaseInitializer<EFCatalogRepository>());

			this.Configuration.AutoDetectChangesEnabled = true;
			this.Configuration.ProxyCreationEnabled = false;
		}
Ejemplo n.º 9
0
        public EFCatalogRepository(string connectionStringName, ICatalogEntityFactory entityFactory, IInterceptor[] interceptors = null)
            : base(connectionStringName, entityFactory, interceptors: interceptors)
        {
            Database.SetInitializer(new ValidateDatabaseInitializer <EFCatalogRepository>());

            this.Configuration.AutoDetectChangesEnabled = true;
            this.Configuration.ProxyCreationEnabled     = false;
        }
        public PriceListAssignmentOverviewStepViewModel(
			IRepositoryFactory<IPricelistRepository> repositoryFactory, 
			IRepositoryFactory<ICatalogRepository> catalogRepositoryFactory, 
			ICatalogEntityFactory entityFactory, 
			IAuthenticationContext authContext, 
			PricelistAssignment item)
            : base(null, repositoryFactory, catalogRepositoryFactory, entityFactory, authContext, item)
		{
		}
 public PriceListAssignmentOverviewStepViewModel(
     IRepositoryFactory <IPricelistRepository> repositoryFactory,
     IRepositoryFactory <ICatalogRepository> catalogRepositoryFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     PricelistAssignment item)
     : base(null, repositoryFactory, catalogRepositoryFactory, entityFactory, authContext, item)
 {
 }
Ejemplo n.º 12
0
 public ItemOverviewStepViewModel(
     IRepositoryFactory <ICatalogRepository> repositoryFactory,
     IViewModelsFactory <IPropertyValueBaseViewModel> vmFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel)
     : base(repositoryFactory, null, vmFactory, entityFactory, authContext, itemModel, null)
 {
     PropertiesAndValues = stepModel.PropertiesAndValues;
 }
Ejemplo n.º 13
0
 /// <summary>
 /// protected. For a step
 /// </summary>
 protected PriceListViewModel(IRepositoryFactory <IPricelistRepository> repositoryFactory,
                              IRepositoryFactory <IAppConfigRepository> appConfigRepositoryFactory,
                              ICatalogEntityFactory entityFactory,
                              IAuthenticationContext authContext, Pricelist item)
     : base(entityFactory, item, true)
 {
     _repositoryFactory          = repositoryFactory;
     _appConfigRepositoryFactory = appConfigRepositoryFactory;
     _authContext = authContext;
 }
		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 PriceListAssignmentSetConditionsStepViewModel(
     IRepositoryFactory <ICountryRepository> countryRepositoryFactory,
     IRepositoryFactory <IPricelistRepository> repositoryFactory,
     IRepositoryFactory <ICatalogRepository> catalogRepositoryFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     PricelistAssignment item)
     : base(countryRepositoryFactory, repositoryFactory, catalogRepositoryFactory, entityFactory, authContext, item)
 {
 }
Ejemplo n.º 16
0
 public ItemPropertiesStepViewModel(
     IRepositoryFactory <ICatalogRepository> repositoryFactory,
     IViewModelsFactory <IPropertyValueBaseViewModel> vmFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel)
     : base(repositoryFactory, null, vmFactory, entityFactory, authContext, itemModel, null)
 {
     PropertiesAndValues           = new ObservableCollection <PropertyAndPropertyValueBase>();
     stepModel.PropertiesAndValues = PropertiesAndValues;
 }
Ejemplo n.º 17
0
        public PriceListAssignmentHomeViewModel(IRepositoryFactory <IPricelistRepository> pricelistRepository,
                                                ICatalogEntityFactory entityFactory, IAuthenticationContext authContext, IViewModelsFactory <IPriceListAssignmentViewModel> itemVmFactory, IViewModelsFactory <ICreatePriceListAssignmentViewModel> wizardVmFactory)
        {
            _entityFactory       = entityFactory;
            _authContext         = authContext;
            _pricelistRepository = pricelistRepository;
            _itemVmFactory       = itemVmFactory;
            _wizardVmFactory     = wizardVmFactory;

            ClearFiltersCommand = new DelegateCommand(DoClearFilters);
        }
Ejemplo n.º 18
0
 public ItemPricingStepViewModel(
     IRepositoryFactory <ICatalogRepository> repositoryFactory,
     IRepositoryFactory <IPricelistRepository> pricelistRepositoryFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel,
     IViewModelsFactory <IPriceViewModel> priceVmFactory)
     : base(repositoryFactory, pricelistRepositoryFactory, null, entityFactory, authContext, itemModel, priceVmFactory)
 {
     IsInitializingPricing = true;
 }
Ejemplo n.º 19
0
		private void RegisterEditorialReviewStep(Item parentItem, ICatalogEntityFactory entityFactory, IViewModelsFactory<IEditorialReviewViewModel> vmFactory)
		{
			var item = (EditorialReview)entityFactory.CreateEntityForType(typeof(EditorialReview));
			item.CatalogItem = parentItem;
			item.Priority = 1;
			item.Source = "Product Description";

			var retVal = vmFactory.GetViewModelInstance(
				new KeyValuePair<string, object>("item", item),
				new KeyValuePair<string, object>("isWizardMode", true));
			RegisterStep(retVal);
		}
Ejemplo n.º 20
0
 protected ItemStepViewModel(
     IRepositoryFactory <ICatalogRepository> repositoryFactory,
     IRepositoryFactory <IPricelistRepository> pricelistRepositoryFactory,
     IViewModelsFactory <IPropertyValueBaseViewModel> vmFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel,
     IViewModelsFactory <IPriceViewModel> priceVmFactory)
     : base(repositoryFactory, pricelistRepositoryFactory, vmFactory, entityFactory, itemModel.InnerItem, authContext, priceVmFactory)
 {
     stepModel = itemModel;
 }
 protected PriceListAssignmentViewModel(
     IRepositoryFactory <ICountryRepository> countryRepositoryFactory,
     IRepositoryFactory <IPricelistRepository> repositoryFactory,
     IRepositoryFactory <ICatalogRepository> catalogRepositoryFactory,
     ICatalogEntityFactory entityFactory, IAuthenticationContext authContext, PricelistAssignment item)
     : base(entityFactory, item, true)
 {
     _authContext              = authContext;
     _repositoryFactory        = repositoryFactory;
     _catalogRepositoryFactory = catalogRepositoryFactory;
     _countryRepositoryFactory = countryRepositoryFactory;
 }
Ejemplo n.º 22
0
        private void RegisterEditorialReviewStep(Item parentItem, ICatalogEntityFactory entityFactory, IViewModelsFactory <IEditorialReviewViewModel> vmFactory)
        {
            var item = (EditorialReview)entityFactory.CreateEntityForType(typeof(EditorialReview));

            item.CatalogItem = parentItem;
            item.Locale      = parentItem.Catalog.DefaultLanguage;
            item.Priority    = 1;
            item.Source      = "Product Description".Localize();

            var retVal = vmFactory.GetViewModelInstance(
                new KeyValuePair <string, object>("item", item),
                new KeyValuePair <string, object>("isWizardMode", true));

            RegisterStep(retVal);
        }
Ejemplo n.º 23
0
        /// <summary>
        /// public. For viewing
        /// </summary>
        public VirtualCatalogViewModel(ICatalogEntityFactory entityFactory,
                                       VirtualCatalog item, IRepositoryFactory <ICatalogRepository> repositoryFactory, IRepositoryFactory <IAppConfigRepository> appConfigRepositoryFactory,
                                       ITreeVirtualCatalogViewModel parentTreeVM, INavigationManager navManager)
            : this(entityFactory, item, false, repositoryFactory, appConfigRepositoryFactory)
        {
            _parentTreeVM = parentTreeVM;
            _navManager   = navManager;
            ViewTitle     = new ViewTitleBase
            {
                Title    = "Virtual Catalog",
                SubTitle = (item != null && !string.IsNullOrEmpty(item.Name)) ? item.Name : ""
            };

            OpenItemCommand = new DelegateCommand(() => _navManager.Navigate(NavigationData));
        }
Ejemplo n.º 24
0
        public AssociationGroupViewModel(
            IViewModelsFactory <IAssociationViewModel> vmFactory,
            ICatalogEntityFactory entityFactory,
            AssociationGroup item,
            IItemViewModel parent)
        {
            InnerItem      = item;
            _vmFactory     = vmFactory;
            _entityFactory = entityFactory;
            _parent        = parent;

            ItemAddCommand    = new DelegateCommand(RaiseItemAddInteractionRequest);
            ItemEditCommand   = new DelegateCommand <Association>(RaiseItemEditInteractionRequest, x => x != null);
            ItemRemoveCommand = new DelegateCommand <Association>(RaiseItemRemoveInteractionRequest, x => x != null);

            CommonConfirmRequest = new InteractionRequest <Confirmation>();
        }
Ejemplo n.º 25
0
        public PriceListHomeViewModel(ICatalogEntityFactory entityFactory, IViewModelsFactory <IPriceListViewModel> itemVmFactory,
                                      IViewModelsFactory <ICreatePriceListViewModel> wizardVmFactory,
                                      IRepositoryFactory <IPricelistRepository> pricelistRepository, IAuthenticationContext authContext,
                                      INavigationManager navManager, TileManager tileManager)
        {
            _entityFactory       = entityFactory;
            _pricelistRepository = pricelistRepository;
            _authContext         = authContext;
            _wizardVmFactory     = wizardVmFactory;
            _itemVmFactory       = itemVmFactory;
            _navManager          = navManager;
            _tileManager         = tileManager;

            ClearFiltersCommand = new DelegateCommand(DoClearFilters);

            PopulateTiles();
        }
		public AssociationGroupViewModel(
			IViewModelsFactory<IAssociationViewModel> vmFactory, 
			ICatalogEntityFactory entityFactory, 
			AssociationGroup item, 
			IItemViewModel parent)
		{
			InnerItem = item;
			_vmFactory = vmFactory;
			_entityFactory = entityFactory;
			_parent = parent;

			ItemAddCommand = new DelegateCommand(RaiseItemAddInteractionRequest);
			ItemEditCommand = new DelegateCommand<Association>(RaiseItemEditInteractionRequest, x => x != null);
			ItemRemoveCommand = new DelegateCommand<Association>(RaiseItemRemoveInteractionRequest, x => x != null);

			CommonConfirmRequest = new InteractionRequest<Confirmation>();
		}
Ejemplo n.º 27
0
		public PropertySetViewModel(ICatalogEntityFactory entityFactory, PropertySet item, ObservableCollection<Property> properties)
		{
			_entityFactory = entityFactory;
			InnerItem = item;
			InnerItem.PropertyChanged -= InnerItem_PropertyChanged;
			InnerItem.PropertyChanged += InnerItem_PropertyChanged;

			ItemsCollection = new CollectionChangeGeneral<PropertySetProperty>(InnerItem.PropertySetProperties);
			AllAvailableProperties = new ObservableCollection<Property>(properties);
			var view = CollectionViewSource.GetDefaultView(AllAvailableProperties);
			view.Filter = FilterProperties;

			TargetTypes = (Enum.GetValues(typeof(PropertyTargetType)).OfType<PropertyTargetType>().Select(x => x.ToString())).ToList();

			// data sorting in list
			var collView2 = CollectionViewSource.GetDefaultView(ItemsCollection.InnerItems);
			collView2.SortDescriptions.Add(new System.ComponentModel.SortDescription("Priority", System.ComponentModel.ListSortDirection.Ascending));
		}
        protected ImportJobViewModelBack(IUnityContainer container, ICatalogEntityFactory entityFactory, ImportJob item, WizardViewModelBare parentVM, bool isSingleDialogEditing)
        {
            Container             = container;
            _entityFactory        = entityFactory;
            InnerItem             = _originalItem = item;
            _parentViewModel      = parentVM;
            IsSingleDialogEditing = isSingleDialogEditing;
            _importService        = Container.Resolve <IImportService>();
            _itemRepository       = Container.Resolve <IImportRepository>();

            if (isSingleDialogEditing)
            {
                _originalItem = InnerItem;

                OpenItemCommand = new DelegateCommand(() =>
                {
                    var navigationmanager = container.Resolve <NavigationManager>();
                    NavigationData        = new NavigationItem(InnerItem.ImportJobId, NavigationNames.HomeName, NavigationNames.MenuName, this);
                    navigationmanager.Navigate(NavigationData);
                });

                CancelCommand      = new DelegateCommand <object>(OnCancelCommand);
                SaveChangesCommand = new DelegateCommand <object>((x) => OnSaveChangesCommand(), (x) => { return(IsModified); });
                MinimizeCommand    = new DelegateCommand(() => MinimizableViewRequestedEvent(this, null));
            }
            else
            {
                InitializePropertiesForViewing();
            }

            FilePickCommand       = new DelegateCommand(RaiseFilePickInteractionRequest);
            CreateMappingCommand  = new DelegateCommand(RaiseCreateMappingInteractionRequest);
            CancelConfirmRequest  = new InteractionRequest <Confirmation>();
            CommonConfirmRequest  = new InteractionRequest <Confirmation>();
            CommonConfirmRequest2 = new InteractionRequest <Confirmation>();

            UpdateImporterCommand    = new DelegateCommand <EntityImporterBase>((x) => OnImporterChangesCommand(x));
            UpdatePropertySetCommand = new DelegateCommand <PropertySet>((x) => OnPropertySetChangesCommand(x));

            CatalogChangedCommand = new DelegateCommand <CatalogBase>((x) => OnCatalogChangesCommand(x));

            ItemEditCommand  = new DelegateCommand <MappingItem>((x) => RaiseItemEditInteractionRequest(x), x => x != null);
            ItemClearCommand = new DelegateCommand <MappingItem>((x) => RaiseItemClearInteractionRequest(x), x => x != null);
        }
Ejemplo n.º 29
0
 /// <summary>
 /// public. For viewing
 /// </summary>
 public PriceListViewModel(IRepositoryFactory <IPricelistRepository> repositoryFactory,
                           IRepositoryFactory <IAppConfigRepository> appConfigRepositoryFactory, IViewModelsFactory <IPriceViewModel> priceVmFactory,
                           ICatalogEntityFactory entityFactory, INavigationManager navManager,
                           IAuthenticationContext authContext, Pricelist item)
     : base(entityFactory, item, false)
 {
     ViewTitle = new ViewTitleBase()
     {
         Title    = "Price List",
         SubTitle = (item != null && !string.IsNullOrEmpty(item.Name)) ? item.Name.ToUpper(CultureInfo.InvariantCulture) : ""
     };
     _repositoryFactory          = repositoryFactory;
     _appConfigRepositoryFactory = appConfigRepositoryFactory;
     _priceVmFactory             = priceVmFactory;
     _navManager     = navManager;
     _authContext    = authContext;
     OpenItemCommand = new DelegateCommand(() => _navManager.Navigate(NavigationData));
     CommandsInit();
 }
Ejemplo n.º 30
0
        public PropertySetViewModel(ICatalogEntityFactory entityFactory, PropertySet item, ObservableCollection <Property> properties)
        {
            _entityFactory             = entityFactory;
            InnerItem                  = item;
            InnerItem.PropertyChanged -= InnerItem_PropertyChanged;
            InnerItem.PropertyChanged += InnerItem_PropertyChanged;

            ItemsCollection        = new CollectionChangeGeneral <PropertySetProperty>(InnerItem.PropertySetProperties);
            AllAvailableProperties = new ObservableCollection <Property>(properties);
            var view = CollectionViewSource.GetDefaultView(AllAvailableProperties);

            view.Filter = FilterProperties;

            TargetTypes = (Enum.GetValues(typeof(PropertyTargetType)).OfType <PropertyTargetType>().Select(x => x.ToString())).ToList();

            // data sorting in list
            var collView2 = CollectionViewSource.GetDefaultView(ItemsCollection.InnerItems);

            collView2.SortDescriptions.Add(new System.ComponentModel.SortDescription("Priority", System.ComponentModel.ListSortDirection.Ascending));
        }
 public PriceListAssignmentViewModel(
     IRepositoryFactory <ICountryRepository> countryRepositoryFactory,
     IRepositoryFactory <IPricelistRepository> repositoryFactory,
     IRepositoryFactory <ICatalogRepository> catalogRepositoryFactory,
     ICatalogEntityFactory entityFactory, IAuthenticationContext authContext,
     NavigationManager navManager, PricelistAssignment item)
     : base(entityFactory, item, false)
 {
     _countryRepositoryFactory = countryRepositoryFactory;
     _repositoryFactory        = repositoryFactory;
     _catalogRepositoryFactory = catalogRepositoryFactory;
     _navManager  = navManager;
     _authContext = authContext;
     ViewTitle    = new ViewTitleBase()
     {
         Title    = "Price List Assignment",
         SubTitle = (item != null && !string.IsNullOrEmpty(item.Name)) ? item.Name.ToUpper(CultureInfo.InvariantCulture) : ""
     };
     OpenItemCommand = new DelegateCommand(() => _navManager.Navigate(NavigationData));
 }
Ejemplo n.º 32
0
 public EFCatalogRepository(ICatalogEntityFactory entityFactory, IInterceptor[] interceptors = null)
     : this(CatalogConfiguration.Instance.Connection.SqlConnectionStringName, entityFactory, interceptors)
 {
 }
Ejemplo n.º 33
0
 private VirtualCatalogViewModel(ICatalogEntityFactory entityFactory, VirtualCatalog item, bool isWizardMode, IRepositoryFactory <ICatalogRepository> repositoryFactory, IRepositoryFactory <IAppConfigRepository> appConfigRepositoryFactory)
     : base(entityFactory, item, isWizardMode)
 {
     _repositoryFactory          = repositoryFactory;
     _appConfigRepositoryFactory = appConfigRepositoryFactory;
 }
Ejemplo n.º 34
0
 public CategoryOverviewStepViewModel(IRepositoryFactory <ICatalogRepository> repositoryFactory, IViewModelsFactory <IPropertyValueBaseViewModel> vmFactory, ICatalogEntityFactory entityFactory, CategoryStepModel itemModel)
     : base(repositoryFactory, vmFactory, entityFactory, itemModel)
 {
     PropertiesAndValues = stepModel.PropertiesAndValues;
 }
Ejemplo n.º 35
0
 protected CategoryStepViewModel(IRepositoryFactory <ICatalogRepository> repositoryFactory, IViewModelsFactory <IPropertyValueBaseViewModel> vmFactory, ICatalogEntityFactory entityFactory, CategoryStepModel itemModel)
     : base(repositoryFactory, vmFactory, entityFactory, itemModel.InnerItem, itemModel.InnerItem.Catalog)
 {
     stepModel = itemModel;
 }
Ejemplo n.º 36
0
 public CategoryPropertiesStepViewModel(IRepositoryFactory <ICatalogRepository> repositoryFactory, IViewModelsFactory <IPropertyValueBaseViewModel> vmFactory, ICatalogEntityFactory entityFactory, CategoryStepModel itemModel)
     : base(repositoryFactory, vmFactory, entityFactory, itemModel)
 {
     PropertiesAndValues           = new ObservableCollection <PropertyAndPropertyValueBase>();
     stepModel.PropertiesAndValues = PropertiesAndValues;
 }
Ejemplo n.º 37
0
 public CategoryPropertiesStepViewModel(IRepositoryFactory<ICatalogRepository> repositoryFactory, IViewModelsFactory<IPropertyValueBaseViewModel> vmFactory, ICatalogEntityFactory entityFactory, CategoryStepModel itemModel)
     : base(repositoryFactory, vmFactory, entityFactory, itemModel)
 {
     PropertiesAndValues = new ObservableCollection<PropertyAndPropertyValueBase>();
     stepModel.PropertiesAndValues = PropertiesAndValues;
 }
 public PriceListOverviewStepViewModel(IRepositoryFactory<IPricelistRepository> repositoryFactory,
     IRepositoryFactory<IAppConfigRepository> appConfigRepositoryFactory, 
     ICatalogEntityFactory entityFactory, IAuthenticationContext authContext, Pricelist item)
     : base(repositoryFactory, appConfigRepositoryFactory,  entityFactory, authContext, item)
 {
 }
Ejemplo n.º 39
0
		public DSCatalogClient(ICatalogEntityFactory catalogEntityFactory, ISecurityTokenInjector tokenInjector, IServiceConnectionFactory connFactory)
			: base(connFactory.GetConnectionString(CatalogConfiguration.Instance.Connection.DataServiceUri), catalogEntityFactory, tokenInjector)
		{
		}
Ejemplo n.º 40
0
 public TaxCategorySettingsViewModel(IRepositoryFactory <ICatalogRepository> repositoryFactory, ICatalogEntityFactory entityFactory, IViewModelsFactory <ICreateTaxCategoryViewModel> wizardVmFactory, IViewModelsFactory <ITaxCategoryViewModel> editVmFactory)
     : base(entityFactory, wizardVmFactory, editVmFactory)
 {
     _repositoryFactory = repositoryFactory;
 }
 public ItemPropertiesStepViewModel(
     IRepositoryFactory<ICatalogRepository> repositoryFactory,
     IViewModelsFactory<IPropertyValueBaseViewModel> vmFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel)
     : base(repositoryFactory, null, vmFactory, entityFactory, authContext, itemModel, null)
 {
     PropertiesAndValues = new ObservableCollection<PropertyAndPropertyValueBase>();
     stepModel.PropertiesAndValues = PropertiesAndValues;
 }
 public ItemOverviewStepViewModel(
     IRepositoryFactory<ICatalogRepository> repositoryFactory,
     IViewModelsFactory<IPropertyValueBaseViewModel> vmFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel)
     : base(repositoryFactory, null, vmFactory, entityFactory, authContext, itemModel, null)
 {
     PropertiesAndValues = stepModel.PropertiesAndValues;
 }
Ejemplo n.º 43
0
 protected CategoryStepViewModel(IRepositoryFactory<ICatalogRepository> repositoryFactory, IViewModelsFactory<IPropertyValueBaseViewModel> vmFactory, ICatalogEntityFactory entityFactory, CategoryStepModel itemModel)
     : base(repositoryFactory, vmFactory, entityFactory, itemModel.InnerItem, itemModel.InnerItem.Catalog)
 {
     stepModel = itemModel;
 }
        public ImportJobViewModelNew(
            NavigationManager navManager,
            ICatalogEntityFactory entityFactory,
            ICatalogRepository catalogRepository,
            IImportRepository importRepository,
            ImportJob item,
            WizardViewModelBare parentVM,
            IColumnMappingEditViewModel mappingEditVM,
            IColumnMappingViewModel columnMappingVM,
            IImportService importService,
            IPickAssetViewModel pickAssetVM,
            bool isSingleDialogEditing)
        {
            _entityFactory        = entityFactory;
            InnerItem             = _originalItem = item;
            _parentViewModel      = parentVM;
            IsSingleDialogEditing = isSingleDialogEditing;
            _itemRepository       = importRepository;
            _mappingEditVM        = mappingEditVM;
            _columnMappingVM      = columnMappingVM;
            _pickAssetVM          = pickAssetVM;
            _importService        = importService;
            _catalogRepository    = catalogRepository;

            ViewTitle = new ViewTitleBase()
            {
                Title = "Import job", SubTitle = DisplayName.ToUpper()
            };

            if (isSingleDialogEditing)
            {
                _originalItem = InnerItem;

                OpenItemCommand = new DelegateCommand(() =>
                {
                    NavigationData = new NavigationItem(InnerItem.ImportJobId, NavigationNames.HomeName, NavigationNames.MenuName, this);
                    navManager.Navigate(NavigationData);
                });

                CancelCommand      = new DelegateCommand <object>(OnCancelCommand);
                SaveChangesCommand = new DelegateCommand <object>((x) => OnSaveChangesCommand(), (x) => { return(IsModified); });
                MinimizeCommand    = new DelegateCommand(() => MinimizableViewRequestedEvent(this, null));
            }
            else
            {
                InitializePropertiesForViewing();
            }

            FilePickCommand       = new DelegateCommand(RaiseFilePickInteractionRequest);
            CreateMappingCommand  = new DelegateCommand(RaiseCreateMappingInteractionRequest);
            CancelConfirmRequest  = new InteractionRequest <Confirmation>();
            CommonConfirmRequest  = new InteractionRequest <Confirmation>();
            CommonConfirmRequest2 = new InteractionRequest <Confirmation>();

            UpdateImporterCommand    = new DelegateCommand <EntityImporterBase>((x) => OnImporterChangesCommand(x));
            UpdatePropertySetCommand = new DelegateCommand <PropertySet>((x) => OnPropertySetChangesCommand(x));

            CatalogChangedCommand = new DelegateCommand <CatalogBase>((x) => OnCatalogChangesCommand(x));

            ItemEditCommand  = new DelegateCommand <MappingItem>((x) => RaiseItemEditInteractionRequest(x), x => x != null);
            ItemClearCommand = new DelegateCommand <MappingItem>((x) => RaiseItemClearInteractionRequest(x), x => x != null);
        }
        public PackagingOverviewStepViewModel(IRepositoryFactory<ICatalogRepository> repositoryFactory, ICatalogEntityFactory entityFactory, Packaging item)
            : base(repositoryFactory, entityFactory, item)
		{

		}
 protected ItemStepViewModel(
     IRepositoryFactory<ICatalogRepository> repositoryFactory,
     IRepositoryFactory<IPricelistRepository> pricelistRepositoryFactory,
     IViewModelsFactory<IPropertyValueBaseViewModel> vmFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel,
     IViewModelsFactory<IPriceViewModel> priceVmFactory)
     : base(repositoryFactory, pricelistRepositoryFactory, vmFactory, entityFactory, itemModel.InnerItem, authContext, priceVmFactory)
 {
     stepModel = itemModel;
 }
		public CatalogOverviewStepViewModel(IRepositoryFactory<ICatalogRepository> repositoryFactory, IRepositoryFactory<IAppConfigRepository> appConfigRepositoryFactory, ICatalogEntityFactory entityFactory, catalogModel.Catalog item)
			: base(repositoryFactory, appConfigRepositoryFactory, entityFactory, item)
		{
		}
Ejemplo n.º 48
0
		public EFCatalogRepository(ICatalogEntityFactory entityFactory, IInterceptor[] interceptors = null)
			: this(CatalogConfiguration.Instance.Connection.SqlConnectionStringName, entityFactory, interceptors)
		{
		}
Ejemplo n.º 49
0
        public DSCatalogClient(Uri serviceUri, ICatalogEntityFactory entityFactory, ISecurityTokenInjector tokenInjector)
			: base(serviceUri, entityFactory, tokenInjector)
		{
		}
 public ItemPricingStepViewModel(
     IRepositoryFactory<ICatalogRepository> repositoryFactory,
     IRepositoryFactory<IPricelistRepository> pricelistRepositoryFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel,
     IViewModelsFactory<IPriceViewModel> priceVmFactory)
     : base(repositoryFactory, pricelistRepositoryFactory, null, entityFactory, authContext, itemModel, priceVmFactory)
 {
     IsInitializingPricing = true;
 }
Ejemplo n.º 51
0
 public CategoryOverviewStepViewModel(IRepositoryFactory<ICatalogRepository> repositoryFactory, IViewModelsFactory<IPropertyValueBaseViewModel> vmFactory, ICatalogEntityFactory entityFactory, CategoryStepModel itemModel)
     : base(repositoryFactory, vmFactory, entityFactory, itemModel)
 {
     PropertiesAndValues = stepModel.PropertiesAndValues;
 }