Beispiel #1
0
        //public ApercuBordereauDeclaratifViewModel() { }
        /// <summary>
        /// Initializes a new instance of the ApercuBordereauDeclaratifViewModel class.
        /// </summary>
        public ApercuBordereauDeclaratifViewModel(IDataService dataService, IDialogService dialogService)
        {
            _dataService = dataService;
            ParamGlobaux = _dataService.ParamGlobaux;

            this._dataService   = dataService;
            this._dialogService = dialogService;
            LoadedCommand       = new RelayCommand(async() => await Initialize());
            UnLoadedCommand     = new RelayCommand(() => Reset());
            MailCommand         = new RelayCommand(() => SendMail());
        }
        public ApercuDemandeAbsenceViewModel(IDataService dataService, IDialogService dialogService)
        {
            _dataService = dataService;
            ParamGlobaux = _dataService.ParamGlobaux;

            this._dataService   = dataService;
            this._dialogService = dialogService;
            LoadedCommand       = new RelayCommand(async() => await Initialize());
            UnLoadedCommand     = new RelayCommand(() => Reset());
            MailCommand         = new RelayCommand(() => SendMail());
            //MailEnabled = new RelayCommand(() => EnabledMail());
        }
Beispiel #3
0
        public GestionDemandeAbsenceViewModel(IDataService dataService, IDialogService dialogService)
        {
            _dataService   = dataService;
            ParamGlobaux   = _dataService.ParamGlobaux;
            _dialogService = dialogService;

            AideCommand            = new RelayCommand(() => ClassUILibrary.Design.AfficheAide("AideGestionDemandeAbsence.pdf", oConnection));
            LoadedCommand          = new RelayCommand(() => Initialize());
            UnLoadedCommand        = new RelayCommand(() => ExecuteUnLoaded());
            QuitterCommand         = new RelayCommand(() => Close = true);
            ImprimerCommand        = new RelayCommand(() => ExecuteImprimer());
            AccepterCommand        = new RelayCommand(async() => await ExecuteAccepter());
            RefuserCommand         = new RelayCommand(async() => await ExecuteRefuser());
            SupprimerCommand       = new RelayCommand(() => ExecuteSupprimer());
            CongesCommand          = new RelayCommand(() => ExecuteConges());
            ShowCommentaireCommand = new RelayCommand(() => ExecuteShowCommentaire());
        }
Beispiel #4
0
        public async void Initialize()
        {
            ParamGlobaux   = _dataService.ParamGlobaux;
            EnableImprimer = false;

            oConnection      = ClassLibraryProget.DataBase.OpenSqlServer(_dataService.ParamGlobaux.ConnectionString);
            DureeMaxCDDCourt = Convert.ToInt32(Parametres.RechercherParametres(oConnection, ParamGlobaux.IDEtablissement, "", "Durée maxi CDD court"));
            oConnection.Close();

            IsEnable = true;

            //Initialisation des listes///////////

            SelectedAgent = new AgentModel();
            PeriodeCommun = new ObservableCollection <PeriodeModulation>();

            var taskAgents   = _dataService.GetAgentsContratsAsync();
            var taskStatuts  = _dataService.GetStatutsAsync(true);
            var taskServices = _dataService.GetServicesAsync(true);
            var taskEmplois  = _dataService.GetEmploisAsync(true);


            await Task.WhenAll(taskAgents, taskStatuts, taskServices, taskEmplois);

            _TousAgents = taskAgents.Result.ToList();

            Agents = new ObservableCollection <AgentModel>(_TousAgents.Distinct().OrderBy(a => a.Prenom).OrderBy(a => a.Nom));

            Statuts  = taskStatuts.Result;
            Services = taskServices.Result;
            Emplois  = taskEmplois.Result;



            //On initialise les selections sur la ligne vide
            _SelectedStatut  = Statuts[0];
            _SelectedService = Services[0];
            _SelectedEmploi  = Emplois[0];

            SelectAllAgents = false;
            UpdateListePeriodes();
        }