Exemplo n.º 1
0
        public TrainingFlowWindowVm(ISeatQueries seatQueries, Guid sessionId, IDocumentCreator documentCreator, ISessionQueries sessionQueries, IApplicationService applicationService, IComputerService computerService)
        {
            _seatQueries        = seatQueries ?? throw new ArgumentNullException(nameof(seatQueries));
            _sessionId          = sessionId;
            _documentCreator    = documentCreator ?? throw new ArgumentNullException(nameof(documentCreator));
            _sessionQueries     = sessionQueries ?? throw new ArgumentNullException(nameof(sessionQueries));
            _applicationService = applicationService ?? throw new ArgumentNullException(nameof(applicationService));
            _computerService    = computerService ?? throw new ArgumentNullException(nameof(computerService));
            RefreshCommand      = new RelayCommandAsync(ExecuteRefreshAsync);

            SelectedSeats = new ObservableCollection <ISeatValidatedResult>();
            SelectedSeats.CollectionChanged += (sender, args) =>
            {
                PrintCertificatOfAttendanceCommand.RaiseCanExecuteChanged();
                PrintSurveyCommand.RaiseCanExecuteChanged();
                PrintDegreeCommand.RaiseCanExecuteChanged();
                MissingCommand.RaiseCanExecuteChanged();
            };

            PrintTimesheetCommand = new RelayCommand(ExecutePrintFeuillePresence);
            PrintCertificatOfAttendanceCommand = new RelayCommand(ExecutePrintCertificatAssiduite, () => SelectedSeats.Any());
            PrintSurveyCommand      = new RelayCommand(ExecutePrintQuestionnaire, () => SelectedSeats.Any());
            PrintDegreeCommand      = new RelayCommand(ExecutePrintDiplome, () => SelectedSeats.Any());
            MissingCommand          = new RelayCommandAsync(ExecuteAbsenceAsync, () => SelectedSeats.Any());
            PrintAllDocumentCommand = new RelayCommandAsync(ExecutePrintAllDocumentAsync);
        }
Exemplo n.º 2
0
        public SeatsWindowVm(Guid sessionId, int sessionPlaces, ISeatQueries seatQueries, ICompanyQueries companyQueries, IStudentQueries studentQueries, IApplicationService applicationService, ISessionQueries sessionQueries)
        {
            _sessionId          = sessionId;
            _sessionPlaces      = sessionPlaces;
            _applicationService = applicationService ?? throw new ArgumentNullException(nameof(applicationService));
            _sessionQueries     = sessionQueries ?? throw new ArgumentNullException(nameof(sessionQueries));
            _companyQueries     = companyQueries ?? throw new ArgumentNullException(nameof(companyQueries));
            _studentQueries     = studentQueries ?? throw new ArgumentNullException(nameof(studentQueries));
            _seatQueries        = seatQueries ?? throw new ArgumentNullException(nameof(seatQueries));

            AddSeatCommand          = new RelayCommandAsync(() => ExecuteAddSeatAsync(false), () => SelectedCompany != null);
            AddValidatedSeatCommand = new RelayCommandAsync(() => ExecuteAddSeatAsync(true), () => SelectedCompany != null && SelectedStudent != null);
            CreateStudentCommand    = new RelayCommandAsync(ExecuteCreateStudentAsync);
            CreateCompanyCommand    = new RelayCommandAsync(ExecuteCreateSocieteAsync);

            SelectedSeats = new ObservableCollection <SeatItem>();
            SelectedSeats.CollectionChanged += (sender, args) =>
            {
                CancelSeatCommand.RaiseCanExecuteChanged();
                ValidateSeatCommand.RaiseCanExecuteChanged();
                RefuseSeatCommand.RaiseCanExecuteChanged();
            };

            CancelSeatCommand    = new RelayCommandAsync(ExecuteCancelSeatAsync, () => SelectedSeats.Any());
            ValidateSeatCommand  = new RelayCommandAsync(ExecuteValidateSeatAsync, () => SelectedSeats.Any());
            RefuseSeatCommand    = new RelayCommandAsync(ExecuteRefuseSeatAsync, () => SelectedSeats.Any());
            RefreshSeatsCommand  = new RelayCommandAsync(ExecuteRefreshSeatsAsync);
            DefineStudentCommand = new RelayCommand(() => { DefineStudent = !DefineStudent; SelectedStudent = null; });
            EditStudentCommand   = new RelayCommandAsync(ExecuteEditStudentAsync);

            GenerateAgreementCommand = new RelayCommandAsync(ExecuteGenerateAgreementAsync);
            OpenAgreementCommand     = new RelayCommandAsync(ExecuteOpenAgreementAsync);
            Security = new Security(applicationService);
        }
Exemplo n.º 3
0
        public ManageAgreementWindowVm(Guid agreementId, ISeatQueries seatQueries,
                                       IApplicationService applicationService, IContactQueries contactQueries, IAgreementQueries agreementQueries,
                                       IComputerService computerService, IDocumentCreator documentCreator, IDocumentRepository documentRepository)
        {
            _agreementId        = agreementId;
            _applicationService = applicationService ?? throw new ArgumentNullException(nameof(applicationService));
            _seatQueries        = seatQueries ?? throw new ArgumentNullException(nameof(seatQueries));
            _contactQueries     = contactQueries ?? throw new ArgumentNullException(nameof(contactQueries));
            _documentCreator    = documentCreator ?? throw new ArgumentNullException(nameof(documentCreator));
            _documentRepository = documentRepository ?? throw new ArgumentNullException(nameof(documentRepository));
            _agreementQueries   = agreementQueries ?? throw new ArgumentNullException(nameof(agreementQueries));
            _computerService    = computerService ?? throw new ArgumentNullException(nameof(computerService));

            ChooseDocumentCommand         = new RelayCommand(ExecuteChooseDocumentAsync);
            PrintCommand                  = new RelayCommandAsync(ExecutePrintAsync);
            SendMailCommand               = new RelayCommandAsync(ExecuteSendEmailAsync);
            OpenSignedDocumentCommand     = new RelayCommandAsync(ExecuteOpenSignedDocumentAsync);
            ReassignSignedDocumentCommand = new RelayCommand(ExecuteReassignSignedDocument);
            RemindAgreementCommand        = new RelayCommandAsync(ExecuteRemingAgreementAsync);
            SavePricesCommand             = new RelayCommandAsync(ExecuteSavePricesAsync, () => CanSavePrices);

            SetValiderCommandCanExecute(() => File.Exists(DocumentPath));
        }
Exemplo n.º 4
0
 public SeatsListerVm(ISeatQueries seatQueries, IApplicationService applicationService) : base(applicationService)
 {
     _seatQueries = seatQueries ?? throw new ArgumentNullException(nameof(seatQueries));
 }