Esempio n. 1
0
        public ListerStagesVue(Utilisateur leUser, int idStageSelect)
        {
            InitializeComponent();
            Stage stageSelect;
            Rect  workArea = System.Windows.SystemParameters.WorkArea;

            this.Left   = (workArea.Width - this.Width) / 2 + workArea.Left;
            this.Top    = (workArea.Height - this.Height) / 2 + workArea.Top;
            stageSelect = ManagerStage.recupererStageParId(idStageSelect);

            style  = this.FindResource("BtnStyleNoHover") as Style;
            style2 = this.FindResource("BtnStyleNoHover2") as Style;

            lesStages        = new List <Stage>();
            LeStageAModifier = new Stage();
            lesStages.Add(stageSelect);
            User             = leUser;
            userName.Content = User.Nom;
            BtnValiderRechercher.IsEnabled = false;

            //MessageBox.Show("Saisir le courriel, svp." + lesStages[0].Salaire, "Erreur de saisie", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            ajouterStageVue();

            afficherDetailsStageSelect(stageSelect);
        }
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(this);
        }
        else
        {
            Destroy(this.gameObject);
        }

        SceneManager.sceneLoaded += Load;
        m_MyEvento = new UnityEvent();
    }
Esempio n. 3
0
        private void RechercheEntreprise_Click(object sender, RoutedEventArgs e)
        {
            String indexEntreprise = RechercheEntrepriseNom.Text;

            lesStages = ManagerStage.recupererListeStageParNomEntreprise(indexEntreprise);
            if (lesStages != null)
            {
                resultat.Visibility = System.Windows.Visibility.Hidden;
                ListeStagesVue.Children.Clear();
                ajouterStageVue();
            }
            else
            {
                resultat.Visibility = System.Windows.Visibility.Visible;
            }
        }
    void Load(Scene cena, LoadSceneMode modo)
    {
        WhichStage();

        if (WhichStage() == (int)Screen.HomeScreen)
        {
            try
            {
                textPlayGame = GameObject.Find("TxtPlayerGame").GetComponent <Button>();
            }
            catch
            {
                StartGame();
            }
            textPlayGame.onClick.RemoveListener(() => StartGame());
            textPlayGame.onClick.AddListener(() => StartGame());
            UIManager.instance.highScore      = GameObject.Find("ScoringRecord").GetComponent <Text>();
            UIManager.instance.highScore.text = UIManager.instance.RecoverSavedScore().ToString("D6");
            if (GameObject.Find("Mario"))
            {
                Destroy(GameObject.Find("Mario").gameObject);
            }
        }

        if (WhichStage() == (int)Screen.GameOver)
        {
            try
            {
                SoundManager.instance.TocarBG(1);
                Invoke("BackHomeScreen", 2.5f);
            }
            catch
            {
                instance = this;
            }
        }
        if (WhichStage() == (int)Screen.Underground_Phase1)
        {
            Time.timeScale = 1;
            SoundManager.instance.TocarBG(2);
            GameObject mario      = GameObject.Find("Mario");
            GameObject pointStart = GameObject.Find("pointStart");
            mario.GetComponent <Collider2D>().enabled          = true;
            mario.GetComponent <SpriteRenderer>().sortingOrder = 5;
            mario.transform.position = new Vector3(pointStart.transform.position.x, pointStart.transform.position.y, mario.transform.position.z);
        }
    }
Esempio n. 5
0
        public ListerStagesVue(Utilisateur leUser)
        {
            InitializeComponent();
            Rect workArea = System.Windows.SystemParameters.WorkArea;

            this.Left = (workArea.Width - this.Width) / 2 + workArea.Left;
            this.Top  = (workArea.Height - this.Height) / 2 + workArea.Top;
            lesStages = ManagerStage.recupererListStage();


            style  = this.FindResource("BtnStyleNoHover") as Style;
            style2 = this.FindResource("BtnStyleNoHover2") as Style;

            LeStageAModifier = new Stage();
            User             = leUser;
            //PERMISSIONS
            //admin
            if (User.IdTypeUtilisateur == 1)
            {
                BtnComptes.Visibility        = System.Windows.Visibility.Visible;
                BtnConfigurations.Visibility = System.Windows.Visibility.Visible;
            }
            //ressources humaines
            else if (User.IdTypeUtilisateur == 2)
            {
                BtnComptes.Visibility        = System.Windows.Visibility.Hidden;
                BtnConfigurations.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                BtnComptes.Visibility           = System.Windows.Visibility.Hidden;
                BtnConfigurations.Visibility    = System.Windows.Visibility.Hidden;
                BtnAjouterStage.Visibility      = System.Windows.Visibility.Hidden;
                BtnValiderRechercher.Visibility = System.Windows.Visibility.Hidden;
                StatistiquesMenu.Visibility     = System.Windows.Visibility.Hidden;
            }
            userName.Content = User.Nom;
            BtnValiderRechercher.IsEnabled = false;

            //MessageBox.Show("Saisir le courriel, svp." + lesStages[0].Salaire, "Erreur de saisie", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            ajouterStageVue();
            resultat.Visibility = System.Windows.Visibility.Hidden;
        }
Esempio n. 6
0
        private void supprimerStage(object sender, RoutedEventArgs e)
        {
            MessageBoxResult ret = MessageBox.Show(this, "Êtes-vous sûr de vouloir supprimer ce stage?", "Avertissement", MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (ret == MessageBoxResult.Yes)
            {
                int idImage = (int)((Image)sender).DataContext;

                LeStageAModifier.Id = idImage;
                ManagerStage.supprimerStage(LeStageAModifier.Id);
                lesStages = ManagerStage.recupererListStage();

                ListeStagesVue.Children.Clear();

                if (lesStages != null)
                {
                    ajouterStageVue();
                }
            }
        }
Esempio n. 7
0
        // evenment sur les bouton
        private void BtnAjouterStage_Click(object sender, RoutedEventArgs e)
        {
            bool ajouter = true;

            if (ChoixType.SelectedValue != null && !ChoixType.SelectedValue.ToString().Equals(""))
            {
                LeStage.TypeStage = ListeDescription.recupererIdDescription(ChoixType.SelectedValue.ToString(), ListeDescription.listTypeStage);
            }
            else
            {
                ajouter = false;
            }


            if (ChoixDatePlacemet.SelectedDate != null)
            {
                DateTime?datePlacementValeur = ChoixDatePlacemet.SelectedDate;
                Object   datePlacementTemp   = ChoixDatePlacemet.SelectedDate;
                LeStage.DatePlacement = (DateTime)datePlacementTemp;
            }
            else
            {
                ajouter = false;
            }

            double salaireValeur;

            if (Double.TryParse(ChoixSalaire.Text, out salaireValeur))
            {
                LeStage.Salaire = salaireValeur;
            }
            else
            {
                LeStage.Salaire = null;
            }

            if (LeStage.IdEntreprise == -1)
            {
                ajouter = false;
            }
            if (LeStage.IdEtudiant == -1)
            {
                ajouter = false;
            }

            LeStage.Modification = new Modification();
            LeStage.Modification.DateModification = DateTime.Now;
            LeStage.Modification.UtilisateurId    = User.Id;

            LeStage.DateDebut = ChoixDateDebut.SelectedDate;
            LeStage.DateFin   = ChoixDateFin.SelectedDate;

            LeStage.Retenu      = false;
            LeStage.Commentaire = ChoixCommentaire.Text;


            if (ajouter)
            {
                ManagerStage.ajouterStage(LeStage);
                MessageBox.Show("Stage Ajouté.", "Ajout d'un stage", MessageBoxButton.OK, MessageBoxImage.Information);
                ListerStagesVue listerStages = new ListerStagesVue(User);
                listerStages.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Veuillez renseigner tous les champs", "Ajout d'un stage", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Esempio n. 8
0
        private void BtnValiderModifierStage_Click(object sender, RoutedEventArgs e)
        {
            bool ajouter = true;

            LeStageAModifier.Retenu = ChoixRetenu.IsChecked;

            DateTime?ChoixDateTemp;
            Object   objectdate;

            if (ChoixDatePlacement.SelectedDate != null)
            {
                ChoixDateTemp = ChoixDatePlacement.SelectedDate;
                objectdate    = ChoixDateTemp;
                LeStageAModifier.DatePlacement = (DateTime)objectdate;
            }
            else
            {
                ajouter = false;
            }


            if (ChoixDateDebut.SelectedDate != null)
            {
                ChoixDateTemp = ChoixDateDebut.SelectedDate;
                objectdate    = ChoixDateTemp;
                LeStageAModifier.DateDebut = (DateTime)objectdate;
            }
            else
            {
                LeStageAModifier.DateDebut = null;
            }


            if (ChoixDateFin.SelectedDate != null)
            {
                ChoixDateTemp            = ChoixDateFin.SelectedDate;
                objectdate               = ChoixDateTemp;
                LeStageAModifier.DateFin = (DateTime)objectdate;
            }
            else
            {
                LeStageAModifier.DateFin = null;
            }



            double salaireValeur;

            if (Double.TryParse(ChoixSalaire.Text, out salaireValeur))
            {
                LeStageAModifier.Salaire = salaireValeur;
            }
            else
            {
                LeStageAModifier.Salaire = null;
            }

            LeStageAModifier.Commentaire = ChoixCommentaire.Text;

            if (ajouter)
            {
                ManagerStage.modifierStage(LeStageAModifier);
                lesStages = ManagerStage.recupererListStage();

                ListeStagesVue.Children.Clear();

                if (lesStages != null)
                {
                    ajouterStageVue();
                }

                MessageBox.Show("Stage Modifié.", "Modification", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                MessageBox.Show("Veuillez renseigner tous les champs", "Ajout d'un stage", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }