Example #1
0
        protected MasterDetailsViewModelBase(ViewModelFactoryBase <TDomainClass> viewModelFactory,
                                             CatalogBase <TDomainClass> catalog)
        {
            // Sanity checks, so we don't need null checks elsewhere
            if (viewModelFactory == null)
            {
                throw new ArgumentNullException(nameof(viewModelFactory));
            }
            if (catalog == null)
            {
                throw new ArgumentNullException(nameof(catalog));
            }

            _catalog          = catalog;
            _viewModelFactory = viewModelFactory;

            _masterViewModel       = _viewModelFactory.CreateMasterViewModel();
            _detailsViewModel      = null;
            _itemViewModelSelected = null;

            _stateManager = new ViewControlStateManager();
            _viewState    = ViewControlState.ViewState.Read;

            SetupViewStateCommands();
            SetupViewActionControllers();
        }
Example #2
0
 public ContactViewModel()
 {
     _contactCatalog      = new CatalogBase <Contact>();
     CreateContactCommand = new RelayCommand(CreateContact);
     DeleteContactCommand = new RelayCommand(DeleteContact);
     UpdateContactCommand = new RelayCommand(UpdateContact);
 }
Example #3
0
        public TreeVirtualCatalogViewModel(
            IViewModelsFactory <ITreeCategoryViewModel> vmFactory,
            IViewModelsFactory <IVirtualCatalogViewModel> virtualCatalogVmFactory,
            IViewModelsFactory <ICatalogDeleteViewModel> catalogDeleteVmFactory,
            CatalogBase item,
            IRepositoryFactory <ICatalogRepository> repositoryFactory,
            IAuthenticationContext authContext,
            INavigationManager navigationManager)
            : base(repositoryFactory, authContext)
        {
            InnerItem  = item;
            _vmFactory = vmFactory;
            _catalogDeleteVmFactory = catalogDeleteVmFactory;
            EmbeddedHierarchyEntry  = this;
            ViewTitle = new ViewTitleBase
            {
                Title    = "Virtual Catalog",
                SubTitle = (item != null && !string.IsNullOrEmpty(item.Name)) ? item.Name : ""
            };

            OpenItemCommand = new DelegateCommand(() =>
            {
                if (NavigationData == null)
                {
                    var editVM = virtualCatalogVmFactory.GetViewModelInstance(new KeyValuePair <string, object>("item", InnerItem)
                                                                              , new KeyValuePair <string, object>("parentTreeVM", this));
                    NavigationData = ((IClosable)editVM).NavigationData;
                }
                navigationManager.Navigate(NavigationData);
            });
        }
Example #4
0
 public SwapController(
     MasterDetailsViewModelBase <PairClass> masterDetailsViewModel,
     CatalogBase <PairClass> catalog,
     PairClass obj)
     : base(masterDetailsViewModel, catalog)
 {
     _obj = obj;
 }
Example #5
0
 private void RaiseUpdateCatalogRequest(CatalogBase obj)
 {
     if (obj != null)
     {
         InnerItem.Name = string.Format("{0} {1} import".Localize(), obj.Name, InnerItem.EntityImporter);
     }
     UpdatePropertySets(null);
 }
        private CategoryViewModel(IRepositoryFactory <ICatalogRepository> repositoryFactory, IViewModelsFactory <IPropertyValueBaseViewModel> propertyValueVmFactory, ICatalogEntityFactory entityFactory, Category item, CatalogBase parentCatalog, bool isWizardMode)
            : base(entityFactory, item, isWizardMode)
        {
            _propertyValueVmFactory = propertyValueVmFactory;
            _repositoryFactory      = repositoryFactory;
            _parentCatalog          = parentCatalog;

            PropertiesLocalesFilterCommand = new DelegateCommand <string>(RaisePropertiesLocalesFilter);
            PropertyValueEditCommand       = new DelegateCommand <object>(RaisePropertyValueEditInteractionRequest, x => x != null);
            PropertyValueDeleteCommand     = new DelegateCommand <object>(RaisePropertyValueDeleteInteractionRequest, x => x != null);
        }
Example #7
0
        public CategorySeoViewModel(ILoginViewModel loginViewModel, ICatalogOutlineBuilder catalogBuilder, IRepositoryFactory <IStoreRepository> storeRepositoryFactory, IRepositoryFactory <IAppConfigRepository> appConfigRepositoryFactory, IAppConfigEntityFactory appConfigEntityFactory, Category item, IEnumerable <string> languages, CatalogBase parentCatalog)
            : base(appConfigRepositoryFactory, appConfigEntityFactory, parentCatalog.DefaultLanguage, languages, item.CategoryId, SeoUrlKeywordTypes.Category)
        {
            _storeRepositoryFactory = storeRepositoryFactory;
            _catalogBuilder         = catalogBuilder;
            _loginViewModel         = loginViewModel;
            _category = item;
            _catalog  = parentCatalog;

            InitializePropertiesForViewing();
        }
Example #8
0
 public CustomerViewModel()
 {
     _customerCatalog         = new CatalogBase <Customer>();
     DeleteCustomerCommand    = new RelayCommand(DeleteCustomer);
     NavUpdateCustomerCommand = new RelayCommand(NavUpdateCustomer);
     NavCreateCustomerCommand = new RelayCommand(NavCreateCustomer);
     NavCancelCreationCommand = new RelayCommand(NavCancelCreation);
     SaveCustomerCommand      = new RelayCommand(SaveCustomer);
     appVm = AppViewModel.AppVm;
     Customers.CollectionChanged += CollectionChanged;
     _dbContext.SaveChanges();
 }
Example #9
0
        public virtual ObservableCollection <ItemViewModelBase <TDomainClass> > CreateItemViewModelCollection(
            CatalogBase <TDomainClass> catalog,
            ViewModelFactoryBase <TDomainClass> factory)
        {
            _itemViewModelCollection.Clear();

            foreach (TDomainClass obj in catalog.FilteredAll)
            {
                _itemViewModelCollection.Add(factory.CreateItemViewModel(obj));
            }

            return(_itemViewModelCollection);
        }
Example #10
0
 public static CatalogState Create(IAcDomain acDomain, CatalogBase catalog)
 {
     if (acDomain == null)
     {
         throw new ArgumentNullException("acDomain");
     }
     if (catalog == null)
     {
         throw new ArgumentNullException("catalog");
     }
     return(new CatalogState(catalog.Id)
     {
         _acDomain = acDomain,
         _createOn = catalog.CreateOn
     }.InternalModify(catalog));
 }
Example #11
0
        internal CatalogState InternalModify(CatalogBase catalog)
        {
            if (catalog == null)
            {
                throw new ArgumentNullException("catalog");
            }
            _categoryCode = catalog.CategoryCode;
            _code         = catalog.Code;
            _description  = catalog.Description;
            _isEnabled    = catalog.IsEnabled;
            _modifiedOn   = catalog.ModifiedOn;
            _name         = catalog.Name;
            _parentCode   = catalog.ParentCode;
            _sortCode     = catalog.SortCode;

            return(this);
        }
 public CatalogBuilder(CatalogBase catalog)
 {
     _catalogBase = catalog;
 }
 /// <summary>
 /// protected. For a step
 /// </summary>
 protected CategoryViewModel(IRepositoryFactory <ICatalogRepository> repositoryFactory, IViewModelsFactory <IPropertyValueBaseViewModel> propertyValueVmFactory, ICatalogEntityFactory entityFactory, Category item, CatalogBase parentCatalog)
     : this(repositoryFactory, propertyValueVmFactory, entityFactory, item, parentCatalog, true)
 {
 }
Example #14
0
 protected ControllerBase(MasterDetailsViewModelBase <TDomainClass> masterDetailsViewModel,
                          CatalogBase <TDomainClass> catalog)
 {
     MasterDetailsViewModel = masterDetailsViewModel;
     Catalog = catalog;
 }
Example #15
0
 public DeleteCommand(CatalogBase <T> catalog, PageViewModelBase <T> pageVM)
     : base(catalog, pageVM)
 {
 }
Example #16
0
 public UpdateControllerBase(MasterDetailsViewModelBase <TDomainClass> masterDetailsViewModel,
                             CatalogBase <TDomainClass> catalog)
     : base(masterDetailsViewModel, catalog)
 {
 }
Example #17
0
 public ReadCommand()
 {
     _catalogBase = new CatalogBase <T>();
 }
Example #18
0
 public UpdateCommand()
 {
     _catalogBase = new CatalogBase<T>();
 }
Example #19
0
 public CatalogLoader(CatalogBase catalog)
 {
     this._catalog = catalog;
 }
        public CategorySeoStepViewModel(ILoginViewModel loginViewModel, ICatalogOutlineBuilder catalogBuilder, IRepositoryFactory <IStoreRepository> storeRepositoryFactory, IRepositoryFactory <IAppConfigRepository> appConfigRepositoryFactory, IAppConfigEntityFactory appConfigEntityFactory, Category item, IEnumerable <string> languages, CatalogBase parentCatalog)
            : base(null, null, null, item, parentCatalog)
        {
            _appConfigRepositoryFactory = appConfigRepositoryFactory;
            _appConfigEntityFactory     = appConfigEntityFactory;
            _storeRepositoryFactory     = storeRepositoryFactory;
            _catalogBuilder             = catalogBuilder;
            _loginViewModel             = loginViewModel;

            InnerItemCatalogLanguages = languages.ToList();
            SeoLocalesFilterCommand   = new DelegateCommand <string>(RaiseSeoLocalesFilter);
            NavigateToUrlCommand      = new DelegateCommand(RaiseNavigateToUrl);
        }
 public SaveCatalogChangesMessage(CatalogBase catalog)
 {
     Catalog = catalog;
 }
Example #22
0
        public static Form GetFormSelected(MenuOptionName option)
        {
            Form formSelected = null;

            var catalog = new CatalogBase();

            switch (option)
            {
            case MenuOptionName.SALES:
            {
                formSelected = new FrmSale();
                break;
            }

            case MenuOptionName.BRANDS:
            {
                formSelected = new FrmBrands(new Brand(catalog));
                break;
            }

            case MenuOptionName.CATEGORIES:
            {
                formSelected = new FrmCategories(new Category(catalog));
                break;
            }

            case MenuOptionName.INVOICEBLOCK:
            {
                formSelected = new FrmInvoiceBlock();
                break;
            }

            case MenuOptionName.MODELS:
            {
                formSelected = new FrmModels(new Model(catalog));
                break;
            }

            case MenuOptionName.PAYMENTMETHODS:
            {
                formSelected = new FrmPaymentMethods(new PaymentMethod(catalog));
                break;
            }

            case MenuOptionName.PRODUCTS:
            {
                formSelected = new FrmProduct();
                break;
            }

            case MenuOptionName.TYPEINVOICES:
            {
                formSelected = new FrmTypeInvoice(new TypeInvoice(catalog));
                break;
            }

            case MenuOptionName.USERS:
            {
                formSelected = new FrmUsers(new User(catalog));
                break;
            }

            case MenuOptionName.USERSADD:
            {
                formSelected = new FrmAddReplaceUser(new AddReplaceUser(new Role()), null, new User(catalog));
                break;
            }

            case MenuOptionName.USERSDETAIL:
            {
                formSelected = new FrmDetailUser(new DetailUser(), null);
                break;
            }
            }
            return(formSelected);
        }
Example #23
0
 public DeleteCommand()
 {
     _catalogBase = new CatalogBase <T>();
 }
Example #24
0
 protected CRUDCommandBase(CatalogBase <T> catalog, PageViewModelBase <T> pageVM)
 {
     _catalog = catalog;
     _pageVM  = pageVM;
 }
Example #25
0
 public CatalogDeleteViewModel(CatalogBase item, string contentText)
 {
     ContentText          = contentText;
     confirmationPassword = (item.Name.Length > 5 ? item.Name.Substring(0, 5) : item.Name);
 }
Example #26
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(CatalogBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_GetItemById, serviceImpl.GetItemById)
            .AddMethod(__Method_GetItemsByIds, serviceImpl.GetItemsByIds).Build());
 }
 private void OnCatalogChangesCommand(CatalogBase selectedItem)
 {
     AllAvailablePropertySets = _catalogRepository.PropertySets.Where(x => x.CatalogId == selectedItem.CatalogId).ToArray();
     OnPropertyChanged("AllAvailablePropertySets");
 }
Example #28
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, CatalogBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_GetItemById, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::CatalogApi.CatalogItemRequest, global::CatalogApi.CatalogItemResponse>(serviceImpl.GetItemById));
     serviceBinder.AddMethod(__Method_GetItemsByIds, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::CatalogApi.CatalogItemsRequest, global::CatalogApi.PaginatedItemsResponse>(serviceImpl.GetItemsByIds));
 }