Esempio n. 1
0
        public GroupsListEditWindowViewModel(
            IPaginationSearchableRepository <Group> searchableRepository,
            IEntityValidator <GroupModel> entityValidator,
            IModelMapper <Group, GroupModel> subscriptionMapper,
            IDisplayService displayService)
            : base(searchableRepository, subscriptionMapper, entityValidator, displayService)
        {
            _displayService = displayService ?? throw new ArgumentNullException(nameof(displayService));

            SelectTrainerCommand = new RelayCommand(SelectTrainerAction);
        }
Esempio n. 2
0
        public ScheduleListEditWindowViewModel(
            IPaginationSearchableRepository <ScheduleSubject> searchableRepository,
            IModelMapper <ScheduleSubject, ScheduleSubjectModel> subscriptionMapper,
            IEntityValidator <ScheduleSubjectModel> entityValidator,
            IDisplayService displayService)
            : base(searchableRepository, subscriptionMapper, entityValidator, displayService)
        {
            _displayService = displayService ?? throw new ArgumentNullException(nameof(displayService));

            SelectGroupCommand = new RelayCommand(SelectGroupAction);
        }
        public SelectEntityDialogViewModel(
            IPaginationSearchableRepository <TEntity> searchableRepository,
            IDialogsDisplayRegistry dialogsDisplayRegistry,
            IModelMapper <TEntity, TModel> entityMapper,
            IDisplayService displayService)
        {
            _dialogsDisplayRegistry = dialogsDisplayRegistry ?? throw new ArgumentNullException(nameof(dialogsDisplayRegistry));
            _searchableRepository   = searchableRepository ?? throw new ArgumentNullException(nameof(searchableRepository));
            _displayService         = displayService ?? throw new ArgumentNullException(nameof(displayService));
            _entityMapper           = entityMapper ?? throw new ArgumentNullException(nameof(entityMapper));

            ItemsListViewModel = new ItemsListViewModel <TModel>();

            ApplyCommand  = new RelayCommand(_ => CloseAction(ItemsListViewModel.SelectedItem));
            CancelCommand = new RelayCommand(_ => CloseAction(default(TModel)));
        }
Esempio n. 4
0
        public ItemsListEditWindowViewModel(
            IPaginationSearchableRepository <TEntity> searchableRepository,
            IModelMapper <TEntity, TModel> subscriptionMapper,
            IEntityValidator <TModel> entityValidator,
            IDisplayService displayService)
        {
            _searchableRepository = searchableRepository ?? throw new ArgumentNullException(nameof(searchableRepository));
            _entityValidator      = entityValidator ?? throw new ArgumentNullException(nameof(entityValidator));
            _displayService       = displayService ?? throw new ArgumentNullException(nameof(displayService));
            _entityMapper         = subscriptionMapper ?? throw new ArgumentNullException(nameof(subscriptionMapper));

            ItemsListViewModel = new ItemsListViewModel <TModel>();

            ActionCommand = new RelayCommand(HandleAction, ActionWasExecute);
            CancelCommand = new RelayCommand(HandleCancel);

            CurrentState = ItemsListEditState.NoSelected;
        }
Esempio n. 5
0
        public SubscriptionsWindowViewModel(
            IPaginationSearchableRepository <Subscription> searchableRepository,
            IModelMapper <Subscription, SubscriptionModel> subscriptionMapper,
            IEntityValidator <SubscriptionModel> entityValidator,
            IModelMapper <Student, StudentModel> studentMapper,
            ISubscriptionsRepository subscriptionsRepository,
            ICardStudentAuthoriser cardStudentAuthoriser,
            IStudentsRepository studentsRepository,
            IDisplayService displayService)
            : base(searchableRepository, subscriptionMapper, entityValidator, displayService)
        {
            _subscriptionsRepository = subscriptionsRepository ?? throw new ArgumentNullException(nameof(subscriptionsRepository));
            _cardStudentAuthoriser   = cardStudentAuthoriser ?? throw new ArgumentNullException(nameof(cardStudentAuthoriser));
            _studentsRepository      = studentsRepository ?? throw new ArgumentNullException(nameof(studentsRepository));
            _displayService          = displayService ?? throw new ArgumentNullException(nameof(displayService));
            _studentMapper           = studentMapper ?? throw new ArgumentNullException(nameof(studentMapper));

            SelectGroupCommand   = new RelayCommand(SelectGroupAction);
            SelectStudentCommand = new RelayCommand(SelectStudentAction);
        }