public SaisieHeures(FeuilleSemaine pFDS)
        {
            InitializeComponent();
            this.DataContext = this;

            chosenFDS = pFDS;

            NumSemaine = chosenFDS.NumSemaine.ToString();

            selectedDay   = App.GetDateFromWeekNumberAndDayOfWeek(chosenFDS.Annee, chosenFDS.NumSemaine, DayOfWeek.Monday);
            lundi         = new JourFDS(chosenFDS.ID, selectedDay);
            mardi         = new JourFDS(chosenFDS.ID, selectedDay.AddDays(1));
            mercredi      = new JourFDS(chosenFDS.ID, selectedDay.AddDays(2));
            jeudi         = new JourFDS(chosenFDS.ID, selectedDay.AddDays(3));
            vendredi      = new JourFDS(chosenFDS.ID, selectedDay.AddDays(4));
            samedi        = new JourFDS(chosenFDS.ID, selectedDay.AddDays(5));
            jourToDisplay = lundi;

            chosenFDS.Lundi    = lundi;
            chosenFDS.Mardi    = mardi;
            chosenFDS.Mercredi = mercredi;
            chosenFDS.Jeudi    = jeudi;
            chosenFDS.Vendredi = vendredi;
            chosenFDS.Samedi   = samedi;

            gpbFDSJour.Header = "Lundi (" + selectedDay.ToShortDateString() + ")";
        }
        public ItemListeFicheSemaine(FeuilleSemaine pFDS)
        {
            this.DataContext = this;
            InitializeComponent();

            fdsChoisie = pFDS;

            NumSemaine         = fdsChoisie.NumSemaine;
            Annee              = fdsChoisie.Annee;
            TotalHeuresSemaine = fdsChoisie.TotalHeuresSemaine;
            Etat = fdsChoisie.Etat;
        }
Ejemplo n.º 3
0
        private void onNumSemaineSelecteur_Validate(object sender, EventArgs e)
        {
            bool isNumSemAlreadyCreated = false;
            int  indexItemInFDSList     = 0;

            while (indexItemInFDSList < App.UserFDS.Count && isNumSemAlreadyCreated == false)
            {
                Console.WriteLine("Index : " + indexItemInFDSList + " / " + App.UserFDS.Count);
                if (numSelector.NumSemaine == App.UserFDS[indexItemInFDSList].NumSemaine)
                {
                    isNumSemAlreadyCreated = true;
                }
                else
                {
                    indexItemInFDSList++;
                }
            }

            if (isNumSemAlreadyCreated == false)
            {
                FeuilleSemaine createFDS = new FeuilleSemaine(App.ConnectedUser.ID, numSelector.NumSemaine, numSelector.Annee);

                numSelector.Reset();

                App.saisieHeuresView = new SaisieHeures(createFDS);
                App.saisieHeuresView.Show();
            }
            else
            {
                MsgBox.Show(MsgBox.MsgBoxType.Avertissement,
                            "Attention",
                            "La feuille de semaine n° " + numSelector.NumSemaine + " existe déjà, il n'est donc pas possible de la recréer. Merci de choisir un autre numéro de semaine.",
                            MessageBoxButton.OK,
                            MsgBox.MsgBoxIcone.Avertissement);
            }
        }