public AjouterEntrevueEtudiantVue(Utilisateur user, int Id)
        {
            InitializeComponent();

            User = user;

            MonEntrevue              = new Entrevue();
            MonEntrevue.IdEtudiant   = Id;
            MonEntrevue.IdEntreprise = -1;

            listeTypeEntrevue = new List <string>();
            listeTypeResultat = new List <string>();
            IsModified        = false;

            foreach (IdDescription id in ListeDescription.listTypeEntrevue)
            {
                listeTypeEntrevue.Add(id.Description);
            }
            foreach (IdDescription id in ListeDescription.listTypeResultat)
            {
                listeTypeResultat.Add(id.Description);
            }

            choixEntrevueVue.ItemsSource = listeTypeEntrevue;
            resultatTypeVue.ItemsSource  = listeTypeResultat;

            lesEntreprise = ManagerEntreprise.recupererListeProfilesEntreprises();

            ajouterEntrepriseVue();
        }
 private void cbxListeEntreprise_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbxListeEntreprise.SelectedIndex >= 0)
     {
         cbxListeEntreprise.DataSource = ManagerEntreprise.GetInstanceManagerEntreprise().GetEntreprise(Convert.ToInt32(cbxListeEntreprise.SelectedValue));
     }
 }
Ejemplo n.º 3
0
        private void supprimerRepresentant(object sender, RoutedEventArgs e)
        {
            int idRepresentant = (int)(((Image)sender).DataContext);


            MessageBoxResult ret = MessageBox.Show(this, "Êtes-vous sûr de vouloir supprimer ce représentant ?", "Avertissement", MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (ret == MessageBoxResult.Yes)
            {
                ManagerEntreprise.supprimerRepresentant(idRepresentant);


                MonEntreprise.Representants = ManagerEntreprise.recupererRepresentant(MonEntreprise.Id);

                ListeRepresentantVue.Children.Clear();
                //reafficher le stackPanel avec la nouvelle liste

                if (MonEntreprise.Representants != null)
                {
                    ajouterRepresentantVue();
                }
                MessageBox.Show("Représentant supprimée.", "Suppression d'un représentant", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else if (ret == MessageBoxResult.No)
            {
                MessageBox.Show("Le représentant n'a pas été supprimée.", "Suppression d'un représentant", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Ejemplo n.º 4
0
        public ProfileRepresentantVue(Utilisateur user, int idRepresentant)
        {
            InitializeComponent();


            User = user;

            MonRepresentant = ManagerEntreprise.recupererRepresentantParId(idRepresentant);

            List <string> listLangue;

            listLangue = new List <string>();
            foreach (Langue id in ListeDescription.listLangue)
            {
                listLangue.Add(id.Description);
            }
            langueVue.ItemsSource = listLangue;

            prenomVue.Text      = MonRepresentant.Prenom;
            nomVue.Text         = MonRepresentant.Nom;
            courrielVue.Text    = MonRepresentant.Courriel;
            tel1Vue.Text        = MonRepresentant.Telephone1;
            tel2Vue.Text        = MonRepresentant.Telephone2;
            tel3Vue.Text        = MonRepresentant.Telephone3;
            departementVue.Text = MonRepresentant.Departement;
            posteVue.Text       = MonRepresentant.Poste;


            langueVue.SelectedValue = ListeDescription.recupererLaLangue(MonRepresentant.IdLangue);
        }
Ejemplo n.º 5
0
 private void cbxTypeControle_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbxTypeControle.SelectedIndex >= 0)
     {
         cbxEntreprise.DataSource = ManagerEntreprise.GetInstanceManagerEntreprise().GetEntreprise(Convert.ToInt32(cbxTypeControle.SelectedValue));
         cbxEntreprise.Visible    = true;
     }
 }
Ejemplo n.º 6
0
        // constructeur
        public AjouterStageVue(Utilisateur user)
        {
            InitializeComponent();
            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;
            User      = user;

            style = this.FindResource("BtnStyleNoHover2") as Style;
            //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;
                StatistiquesMenu.Visibility  = System.Windows.Visibility.Hidden;
            }

            userName.Content    = User.Nom;
            lesEtudiants        = ManagerEtudiant.recupererListeProfilesEtudiantsRechercheStage();
            lesEntreprises      = ManagerEntreprise.recupererListeProfilesEntreprises();
            resultat.Visibility = System.Windows.Visibility.Hidden;

            listTypeStage = new List <string>();

            foreach (IdDescription id in ListeDescription.listTypeStage)
            {
                listTypeStage.Add(id.Description);
            }

            LeStage = new Stage();
            LeStage.IdEntreprise = -1;
            LeStage.IdEtudiant   = -1;



            ChoixType.ItemsSource = listTypeStage;

            ajouterEntrepriseVue();
            ajouterEtudiantVue();
        }
        private void afficherDetailsCommunicationEntrepriseSelect(Communication communicationSelect)
        {
            BtnModifierCommunication.IsEnabled = true;
            communication = communicationSelect;

            ChoixStatus.SelectedItem = ListeDescription.recupererDescription(communication.StatusCommunication, ListeDescription.listStatusCommunication);
            ChoixDate.SelectedDate   = communication.DateCommunication;
            ChoixType.SelectedItem   = ListeDescription.recupererDescription(communication.TypeCommunication, ListeDescription.listTypeCommunication);
            choixCommentaire.Text    = communication.Commentaire;
            entreprise = ManagerEntreprise.recupererProfilesEntreprises(communication.IdTo);
            LblNomDeEtudiant.Content = entreprise.Nom;
            LblFormation.Text        = entreprise.Secteur;
            ImageEllipse.Source      = new BitmapImage(new Uri(@"" + entreprise.ImageLogo, UriKind.RelativeOrAbsolute));
        }
 private void RechercheEtudiant_Click(object sender, RoutedEventArgs e)
 {
     lesEntreprise = ManagerEntreprise.recupererListeProfilesEntreprisesSelonNom(RechercheEtudiantNom.Text);
     if (lesEntreprise != null)
     {
         resultat.Visibility = System.Windows.Visibility.Hidden;
         ListeEtudiantsVue.Children.Clear();
         ajouterEntrepriseVue();
     }
     else
     {
         resultat.Visibility = System.Windows.Visibility.Visible;
     }
 }
Ejemplo n.º 9
0
        private void BtnAjouterRepresentant_Click(object sender, RoutedEventArgs e)
        {
            AjouterRepresentant representant = new AjouterRepresentant(User, MonEntreprise.Id);

            representant.ShowDialog();
            if (representant.IsModified)
            {
                MonEntreprise.Representants = ManagerEntreprise.recupererRepresentant(MonEntreprise.Id);

                ListeRepresentantVue.Children.Clear();
                //reafficher le stackPanel avec la nouvelle liste
                ajouterRepresentantVue();
            }
            representant.Close();
        }
Ejemplo n.º 10
0
        private void BtnAjouteRepresentant_Click(object sender, RoutedEventArgs e)
        {
            //  bool ajouter = true;

            MonRepresentant.Prenom       = prenomVue.Text;
            MonRepresentant.Nom          = nomVue.Text;
            MonRepresentant.Courriel     = courrielVue.Text;
            MonRepresentant.Telephone1   = tel1Vue.Text;
            MonRepresentant.Telephone2   = tel2Vue.Text;
            MonRepresentant.Telephone3   = tel3Vue.Text;
            MonRepresentant.Departement  = departementVue.Text;
            MonRepresentant.Poste        = posteVue.Text;
            MonRepresentant.Modification = new Modification();
            MonRepresentant.Modification.UtilisateurId    = User.Id;
            MonRepresentant.Modification.DateModification = DateTime.Now;



            if (langueVue.SelectedValue != null && !langueVue.SelectedValue.ToString().Equals(""))
            {
                MonRepresentant.IdLangue = ListeDescription.recupererIdLangue(langueVue.SelectedValue.ToString());
            }
            else
            {
                MonRepresentant.IdLangue = null;
            }


            if (MonRepresentant.Prenom.Length <= 0 || MonRepresentant.Nom.Length <= 0 ||
                MonRepresentant.Courriel.Length <= 0 || MonRepresentant.Telephone1.Length <= 0)
            {
                MessageBox.Show("Veuillez remplir tous les champs necessaires : ", "Ajout d'un représentant", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                MessageBoxResult ret = MessageBox.Show(this, "Êtes-vous sûr de vouloir ajouter ce représentant?", "Avertissement", MessageBoxButton.YesNo, MessageBoxImage.Warning);
                if (ret == MessageBoxResult.Yes)
                {
                    IsModified = true;
                    ManagerEntreprise.ajouterRepresentant(MonRepresentant);

                    MessageBox.Show("Représentant ajouter.", "Ajout d'un représentant", MessageBoxButton.OK, MessageBoxImage.Information);

                    this.Close();
                }
            }
        }
Ejemplo n.º 11
0
        //evenement sur les differents elements
        //representant
        private void afficherRepresentant(object sender, RoutedEventArgs e)
        {
            int idRepresentant = (int)(((Button)sender).DataContext);

            ProfileRepresentantVue representant = new ProfileRepresentantVue(User, idRepresentant);

            representant.ShowDialog();
            if (representant.IsModified)
            {
                MonEntreprise.Representants = ManagerEntreprise.recupererRepresentant(MonEntreprise.Id);

                ListeRepresentantVue.Children.Clear();
                //reafficher le stackPanel avec la nouvelle liste
                ajouterRepresentantVue();
            }
            representant.Close();
        }
Ejemplo n.º 12
0
        private void afficherDetailsStageSelect(Stage LeStageAModifier)
        {
            BtnValiderRechercher.IsEnabled  = true;
            ChoixRetenu.IsChecked           = LeStageAModifier.Retenu;
            ChoixDatePlacement.SelectedDate = LeStageAModifier.DatePlacement;
            ChoixDateDebut.SelectedDate     = LeStageAModifier.DateDebut;
            ChoixDateFin.SelectedDate       = LeStageAModifier.DateFin;
            ChoixSalaire.Text     = LeStageAModifier.Salaire.ToString();
            ChoixCommentaire.Text = LeStageAModifier.Commentaire;
            Entreprise entreprise = ManagerEntreprise.recupererProfilesEntreprises(LeStageAModifier.IdEntreprise);

            NomEntreprise.Content  = entreprise.Nom;
            PhotoEntreprise.Source = new BitmapImage(new Uri(@"" + entreprise.ImageLogo, UriKind.RelativeOrAbsolute));
            Etudiant etudiant = ManagerEtudiant.recupererProfilesEtudiant(LeStageAModifier.IdEtudiant);

            NomEtudiant.Content  = etudiant.Nom;
            PhotoEtudiant.Source = new BitmapImage(new Uri(@"" + etudiant.PhotoURL, UriKind.RelativeOrAbsolute));
        }
Ejemplo n.º 13
0
        //entreprise event
        private void BtnSupprimerEntreprise_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult ret = MessageBox.Show(this, "Êtes-vous sûr de vouloir supprimer cette entreprise ?", "Avertissement", MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (ret == MessageBoxResult.Yes)
            {
                ManagerEntreprise.supprimerEntreprise(MonEntreprise.Id);

                MessageBox.Show("Entreprise supprimée.", "Suppression d'une entreprise", MessageBoxButton.OK, MessageBoxImage.Information);

                Acceuil vue = new Acceuil(User);
                vue.Show();
                this.Close();
            }
            else if (ret == MessageBoxResult.No)
            {
                MessageBox.Show("L'entreprise n'a pas été supprimée.", "Suppression d'une entreprise", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
        public ProfileEntrevueEtudiantVue(Utilisateur user, int idEntrevue)
        {
            InitializeComponent();
            User = user;

            MonEntrevue   = ManagerEntrevue.recupererEntrevueParId(idEntrevue);
            MonEntreprise = ManagerEntreprise.recupererProfilesEntreprises(MonEntrevue.IdEntreprise);

            listeTypeEntrevue = new List <string>();
            listeTypeResultat = new List <string>();
            IsModified        = false;

            foreach (IdDescription id in ListeDescription.listTypeEntrevue)
            {
                listeTypeEntrevue.Add(id.Description);
            }
            foreach (IdDescription id in ListeDescription.listTypeResultat)
            {
                listeTypeResultat.Add(id.Description);
            }

            choixEntrevueVue.ItemsSource = listeTypeEntrevue;
            resultatTypeVue.ItemsSource  = listeTypeResultat;

            choixEntrevueVue.SelectedValue = ListeDescription.recupererDescription(MonEntrevue.TypeEntrevue, ListeDescription.listTypeEntrevue);

            Object   dateE    = MonEntrevue.DateEntrevue;
            DateTime dateEtmp = (DateTime)dateE;

            choixDateVue.SelectedDate = dateEtmp;

            resultatTypeVue.SelectedItem = ListeDescription.recupererDescription(MonEntrevue.Resultat, ListeDescription.listTypeResultat);

            commentaireVues.Text = MonEntrevue.Commentaire;

            ImgEtudiant.Source     = new BitmapImage(new Uri(MonEntreprise.ImageLogo, UriKind.RelativeOrAbsolute));
            NomEtudiantVue.Content = MonEntreprise.Nom;
        }
        //evenement au click
        private void bntRechercher_Click(object sender, RoutedEventArgs e)
        {
            string ChoixRechercheValeur = Recherche.Text;
            // MessageBox.Show("valeur rechercher " + Recherche.Text, "LOGIN FAIL", MessageBoxButton.OK);

            bool?radioCheck = RadioBtnEtudiant.IsChecked;

            if (radioCheck == true)
            {
                lesEtudiants = ManagerEtudiant.recupererEtudiantParleNom(ChoixRechercheValeur);
                if (lesEtudiants != null)
                {
                    resultat.Visibility = System.Windows.Visibility.Hidden;
                    ListeEtudiantsEntrepriseVue.Children.Clear();
                    ajouterEtudiantVue();
                }
                else
                {
                    resultat.Visibility = System.Windows.Visibility.Visible;
                }
            }
            else
            {
                lesEntreprises = ManagerEntreprise.recupererListeProfilesEntreprisesSelonNom(ChoixRechercheValeur);

                if (lesEntreprises != null)
                {
                    resultat.Visibility = System.Windows.Visibility.Hidden;
                    ListeEtudiantsEntrepriseVue.Children.Clear();
                    ajouterEntrepriseVue();
                }
                else
                {
                    resultat.Visibility = System.Windows.Visibility.Visible;
                }
            }
        }
Ejemplo n.º 16
0
        //ajouter une entreprise
        private void BtnValiderAjouter_Click(object sender, RoutedEventArgs e)
        {
            bool peutAjouter = true;

            if (ChoixNomVue.Text.Length > 0)
            {
                MonEntreprise.Nom = ChoixNomVue.Text;
            }
            else
            {
                peutAjouter = false;
            }

            if (ChoixCourrielVue.Text.Length > 0)
            {
                MonEntreprise.Email = ChoixCourrielVue.Text;
            }
            else
            {
                peutAjouter = false;
            }


            if (ChoixTel1Vue.Text != null || !ChoixTel1Vue.Text.Equals(""))
            {
                MonEntreprise.Telephone1 = ChoixTel1Vue.Text;
            }
            else
            {
                MonEntreprise.Telephone1 = null;
            }

            if (ChoixTel2Vue.Text != null || !ChoixTel2Vue.Text.Equals(""))
            {
                MonEntreprise.Telephone2 = ChoixTel2Vue.Text;
            }
            else
            {
                MonEntreprise.Telephone1 = null;
            }

            if (ChoixTel3Vue.Text != null || !ChoixTel3Vue.Text.Equals(""))
            {
                MonEntreprise.Telephone3 = ChoixTel3Vue.Text;
            }
            else
            {
                MonEntreprise.Telephone3 = null;
            }

            if (ChoixAdresseVue.Text != null || !ChoixAdresseVue.Text.Equals(""))
            {
                MonEntreprise.Adresse = ChoixAdresseVue.Text;
            }
            else
            {
                MonEntreprise.Adresse = null;
            }

            if (ChoixVilleVue.Text != null || !ChoixVilleVue.Text.Equals(""))
            {
                MonEntreprise.Ville = ChoixVilleVue.Text;
            }
            else
            {
                MonEntreprise.Ville = null;
            }

            if (ChoixSecteurVue.Text != null || !ChoixSecteurVue.Text.Equals(""))
            {
                MonEntreprise.Secteur = ChoixSecteurVue.Text;
            }
            else
            {
                MonEntreprise.Secteur = null;
            }

            if (ChoixLangueVue.SelectedItem != null)
            {
                MonEntreprise.Langue = ListeDescription.recupererIdLangue(ChoixLangueVue.SelectedValue.ToString());
            }
            else
            {
                MonEntreprise.Langue = null;
            }

            if (ChoixCommentaireVue.Text != null || !ChoixCommentaireVue.Text.Equals(""))
            {
                MonEntreprise.Commentaire = ChoixCommentaireVue.Text;
            }
            else
            {
                MonEntreprise.Commentaire = null;
            }

            List <int> listFormationRechercher = null;

            if (ChoixFromationVue.SelectedItem != null)
            {
                // pour ajoute dans bdd
                listFormationRechercher             = new List <int>();
                MonEntreprise.FormationsRecherchees = new List <IdDescription>();
                foreach (var item in ChoixFromationVue.SelectedItems)
                {
                    if (item != null)
                    {
                        IdDescription formation = new IdDescription();
                        formation.Id = ListeDescription.recupererIdFormation(item.ToString());
                        listFormationRechercher.Add(formation.Id);
                        formation.Description = item.ToString();
                        MonEntreprise.FormationsRecherchees.Add(formation);
                    }
                }
            }
            else
            {
                MonEntreprise.FormationsRecherchees = null;
            }


            List <int> listTechnologieRecherche = null;

            if (ChoixTechnologieVue.SelectedItem != null)
            {
                listTechnologieRecherche = new List <int>();
                MonEntreprise.TechnologiesRecherchees = new List <IdDescription>();
                foreach (var item in ChoixTechnologieVue.SelectedItems)
                {
                    if (item != null)
                    {
                        IdDescription technologie = new IdDescription();
                        technologie.Id = ListeDescription.recupererIdDescription(item.ToString(), ListeDescription.listTechnologie);
                        listTechnologieRecherche.Add(technologie.Id);
                        technologie.Description = item.ToString();
                        MonEntreprise.TechnologiesRecherchees.Add(technologie);
                    }
                }
            }
            else
            {
                MonEntreprise.TechnologiesRecherchees = null;
            }

            List <int> listInteretRecherche = null;

            if (ChoixInteretVue.SelectedItem != null)
            {
                listInteretRecherche             = new List <int>();
                MonEntreprise.InteretsRecherches = new List <IdDescription>();
                foreach (var item in ChoixInteretVue.SelectedItems)
                {
                    if (item != null)
                    {
                        IdDescription interet = new IdDescription();
                        interet.Id = ListeDescription.recupererIdDescription(item.ToString(), ListeDescription.listInterets);
                        listInteretRecherche.Add(interet.Id);
                        interet.Description = item.ToString();
                        MonEntreprise.InteretsRecherches.Add(interet);
                    }
                }
            }
            else
            {
                MonEntreprise.InteretsRecherches = null;
            }


            if (MonEntreprise.ImageLogo == null)
            {
                MonEntreprise.ImageLogo = "images\\ProfilImageVide.png";
            }

            MonEntreprise.DateSaisie = DateTime.Now;

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


            if (peutAjouter)
            {
                // atente pas d inner join dans la requete
                if (ManagerEntreprise.ajouterEntreprise(MonEntreprise, listFormationRechercher, listInteretRecherche, listTechnologieRecherche) && peutAjouter)
                {
                    ListerEntreprisesVue listerentreprise = new ListerEntreprisesVue(User);
                    listerentreprise.Show();
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Veuillez saisir les champs obligatoires", "Ajout d'un étudiant", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Ejemplo n.º 17
0
        public void ajouterStageVue()
        {
            int i = 0;

            foreach (Stage stage in lesStages)
            {
                // !!!!!!!!!!!!!!!!!!!!!!!!!   a verifer les margins quand on aura les données
                Etudiant   etudiant   = ManagerEtudiant.recupererProfilesEtudiant(stage.IdEtudiant);
                Entreprise entreprise = ManagerEntreprise.recupererProfilesEntreprises(stage.IdEntreprise);

                // créer le bouton
                Button btn = new Button();
                if (i % 2 == 0)
                {
                    btn.Style = style;
                }
                else
                {
                    btn.Style = style2;
                }
                btn.DataContext = stage;
                btn.Click      += afficherDetailsStage;

                //layout du bouton
                StackPanel hPanel = new StackPanel();
                hPanel.Orientation = Orientation.Horizontal;
                //hPanel.Width = 148;
                hPanel.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
                hPanel.VerticalAlignment   = System.Windows.VerticalAlignment.Center;

                //nom prenom etudiant
                ajouterTextBlock(hPanel, etudiant.Prenom + " " + etudiant.Nom, 13, 130);

                //nom entreprise
                ajouterLabel(hPanel, entreprise.Nom, 13, 90);

                //Date debut

                if (stage.DateDebut != null)
                {
                    Object   DateTemp  = stage.DateDebut;
                    DateTime DateDebut = (DateTime)DateTemp;

                    ajouterLabel(hPanel, DateDebut.ToShortDateString(), 13, 100);
                }
                else
                {
                    ajouterLabel(hPanel, "", 13, 100);
                }
                //Type de stage
                ajouterTextBlock(hPanel, ListeDescription.recupererDescription(stage.TypeStage, ListeDescription.listTypeStage), 13, 130);

                // retenu ou pas
                CheckBox retenu = new CheckBox();
                retenu.Width     = 90;
                retenu.IsEnabled = false;
                if (stage.Retenu == true)
                {
                    retenu.IsChecked = true;
                }
                hPanel.Children.Add(retenu);

                if (User.IdTypeUtilisateur == 1 || User.IdTypeUtilisateur == 2)
                {
                    //ajouter l image pour supprimer
                    Image imgSuppr = new Image();
                    imgSuppr.DataContext = stage.Id;
                    imgSuppr.Width       = 25;
                    imgSuppr.Height      = 25;
                    imgSuppr.Stretch     = Stretch.Fill;
                    imgSuppr.Source      = new BitmapImage(new Uri(@"images\iconX.png", UriKind.RelativeOrAbsolute));
                    imgSuppr.MouseDown  += supprimerStage;
                    hPanel.Children.Add(imgSuppr);
                }

                //ajouter le bouton au stackPanel principal
                btn.Content = hPanel;

                ListeStagesVue.Children.Add(btn);


                i++;
            }
        }
 private void RadioBtnEntreprise_Click(object sender, RoutedEventArgs e)
 {
     ListeEtudiantsEntrepriseVue.Children.Clear();
     lesEntreprises = ManagerEntreprise.recupererListeProfilesEntreprises();
     ajouterEntrepriseVue();
 }
Ejemplo n.º 19
0
        //ajouter une entreprise
        private void BtnValiderModifier_Click(object sender, RoutedEventArgs e)
        {
            bool peutAjouter = true;

            if (ChoixNomVue.Text != null || !ChoixNomVue.Text.Equals(""))
            {
                MonEntreprise.Nom = ChoixNomVue.Text;
            }
            else
            {
                peutAjouter = false;
            }


            if (ChoixCourrielVue.Text != null || !ChoixCourrielVue.Text.Equals(""))
            {
                MonEntreprise.Email = ChoixCourrielVue.Text;
            }
            else
            {
                peutAjouter = false;
            }

            if (ChoixTel1Vue.Text != null || !ChoixTel1Vue.Text.Equals(""))
            {
                MonEntreprise.Telephone1 = ChoixTel1Vue.Text;
            }
            else
            {
                MonEntreprise.Telephone1 = null;
            }

            if (ChoixTel2Vue.Text != null || !ChoixTel2Vue.Text.Equals(""))
            {
                MonEntreprise.Telephone2 = ChoixTel2Vue.Text;
            }
            else
            {
                MonEntreprise.Telephone1 = null;
            }

            if (ChoixTel3Vue.Text != null || !ChoixTel3Vue.Text.Equals(""))
            {
                MonEntreprise.Telephone3 = ChoixTel3Vue.Text;
            }
            else
            {
                MonEntreprise.Telephone3 = null;
            }

            if (ChoixAdresseVue.Text != null || !ChoixAdresseVue.Text.Equals(""))
            {
                MonEntreprise.Adresse = ChoixAdresseVue.Text;
            }
            else
            {
                MonEntreprise.Adresse = null;
            }

            if (ChoixVilleVue.Text != null || !ChoixVilleVue.Text.Equals(""))
            {
                MonEntreprise.Ville = ChoixVilleVue.Text;
            }
            else
            {
                MonEntreprise.Ville = null;
            }

            if (ChoixSecteurVue.Text != null || !ChoixSecteurVue.Text.Equals(""))
            {
                MonEntreprise.Secteur = ChoixSecteurVue.Text;
            }
            else
            {
                MonEntreprise.Secteur = null;
            }

            if (ChoixLangueVue.SelectedItem != null)
            {
                MonEntreprise.Langue = ListeDescription.recupererIdLangue(ChoixLangueVue.SelectedValue.ToString());
            }
            else
            {
                MonEntreprise.Langue = null;
            }

            if (ChoixCommentaireVue.Text != null || !ChoixCommentaireVue.Text.Equals(""))
            {
                MonEntreprise.Commentaire = ChoixCommentaireVue.Text;
            }
            else
            {
                MonEntreprise.Commentaire = null;
            }

            List <int> listFormationRechercher = null;

            if (ChoixFromationVue.SelectedItems != null)
            {
                // pour ajoute dans bdd
                listFormationRechercher = new List <int>();
                foreach (ListBoxItem item in ChoixFromationVue.SelectedItems)
                {
                    if (item != null)
                    {
                        listFormationRechercher.Add(ListeDescription.recupererIdFormation(item.Content.ToString()));
                    }
                }
            }



            List <int> listTechnologieRecherche = null;

            if (ChoixTechnologieVue.SelectedItems != null)
            {
                listTechnologieRecherche = new List <int>();
                foreach (ListBoxItem item in ChoixTechnologieVue.SelectedItems)
                {
                    if (item != null)
                    {
                        listTechnologieRecherche.Add(ListeDescription.recupererIdDescription(item.Content.ToString(), ListeDescription.listTechnologie));
                    }
                }
            }


            List <int> listInteretRecherche = null;

            if (ChoixInteretVue.SelectedItems != null)
            {
                listInteretRecherche = new List <int>();
                foreach (ListBoxItem item in ChoixInteretVue.SelectedItems)
                {
                    if (item != null)
                    {
                        listInteretRecherche.Add(ListeDescription.recupererIdDescription(item.Content.ToString(), ListeDescription.listInterets));
                    }
                }
            }

            if (MonEntreprise.ImageLogo == null)
            {
                MonEntreprise.ImageLogo = "images\\ProfilImageVide.png";
            }

            MonEntreprise.DateSaisie = DateTime.Now;

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



            // atente pas d inner join dans la requete
            //if(ManagerEntreprise.modifierEntreprise(MonEntreprise, listFormationRechercher, listInteretRecherche, listTechnologieRecherche) && peutAjouter)

            if (peutAjouter)
            {
                ManagerEntreprise.modifierEntreprise(MonEntreprise, listFormationRechercher, listInteretRecherche, listTechnologieRecherche);
                MessageBox.Show("Entreprise modifiée.", "Modification d'une entreprise", MessageBoxButton.OK, MessageBoxImage.Information);
                ProfileEntrepriseVue vue = new ProfileEntrepriseVue(User, MonEntreprise.Id);
                vue.Show();
                this.Close();
            }

            else
            {
                MessageBox.Show("Veuillez remplir tous les champs obligatoires", "Modification d'une entreprise", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Ejemplo n.º 20
0
        public ListerEntreprisesVue(Utilisateur leUser)
        {
            InitializeComponent();
            resultat.Visibility = System.Windows.Visibility.Hidden;
            Rect workArea = System.Windows.SystemParameters.WorkArea;

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

            lL = new List <string>();
            lF = new List <string>();
            lI = new List <string>();
            lT = new List <string>();


            foreach (Langue id in ListeDescription.listLangue)
            {
                lL.Add(id.Description);
            }

            foreach (Formation id in ListeDescription.listFormations)
            {
                lF.Add(id.Description);
            }

            foreach (IdDescription id in ListeDescription.listTechnologie)
            {
                lI.Add(id.Description);
            }

            foreach (IdDescription id in ListeDescription.listInterets)
            {
                lT.Add(id.Description);
            }

            // pb recuperer bon fichier
            lesEntreprises = ManagerEntreprise.recupererListeProfilesEntreprises();

            Console.WriteLine(lesEntreprises.Count);

            ChoixLangue.ItemsSource      = lL;
            ChoixFormation.ItemsSource   = lF;
            ChoixInteret.ItemsSource     = lI;
            ChoixTechnologie.ItemsSource = lT;
            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;
                BtnAjouterEntreprise.Visibility = System.Windows.Visibility.Hidden;
                StatistiquesMenu.Visibility     = System.Windows.Visibility.Hidden;
            }
            userName.Content = User.Nom;
            ajouterEntrepriseVue();
        }
Ejemplo n.º 21
0
        //ajouter le les stages
        public void ajouterStageVue()
        {
            int i = 1;

            foreach (Stage stage in MonEtudiant.Stages)
            {
                // !!!!!!!!!!!!!!!!!!!!!!!!!   a verifer les margins quand on aura les données

                Entreprise stageEntreprise = ManagerEntreprise.recupererProfilesEntreprises(stage.IdEntreprise);

                // créer le bouton
                Button btn = new Button();
                if (i % 2 == 0)
                {
                    btn.Style = style;
                }
                else
                {
                    btn.Style = style2;
                }
                btn.DataContext = stage.Id;
                btn.Click      += afficherStage;

                //layout du bouton
                StackPanel hPanel = new StackPanel();
                hPanel.Orientation         = Orientation.Horizontal;
                hPanel.Width               = 531;
                hPanel.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
                hPanel.VerticalAlignment   = System.Windows.VerticalAlignment.Center;

                //etudiant
                ajouterLabel(hPanel, stageEntreprise.Nom, 15, 120);

                ////date debut
                Object   dateD     = stage.DateDebut;
                DateTime dateDTmps = (DateTime)dateD;
                ajouterLabel(hPanel, dateDTmps.ToShortDateString(), 15, 120);



                ////date Fin
                Object   dateF     = stage.DateFin;
                DateTime dateFTmps = (DateTime)dateF;
                ajouterLabel(hPanel, dateFTmps.ToShortDateString(), 15, 120);

                //retenu
                CheckBox retenu = new CheckBox();
                retenu.Width     = 120;
                retenu.IsEnabled = false;
                if (stage.Retenu == true)
                {
                    retenu.IsChecked = true;
                }
                hPanel.Children.Add(retenu);

                ////ajouter l image pour supprimer
                //Image imgSuppr = new Image();
                //imgSuppr.Width = 25;
                //imgSuppr.Height = 25;
                //imgSuppr.Stretch = Stretch.Fill;
                //imgSuppr.Source = new BitmapImage(new Uri(@"images\iconX.png", UriKind.RelativeOrAbsolute));
                //imgSuppr.MouseDown += supprimerStage;
                //imgSuppr.DataContext = stage.Id;
                //hPanel.Children.Add(imgSuppr);

                //ajouter le bouton au stackPanel principal

                btn.Content = hPanel;
                ListeStagetVue.Children.Add(btn);
                i++;
            }
        }
Ejemplo n.º 22
0
        //ajouter entrevue
        public void ajouterEntrevueVue()
        {
            int i = 1;

            foreach (Entrevue entre in MonEtudiant.Entrevues)
            {
                // !!!!!!!!!!!!!!!!!!!!!!!!!   a verifer les margins quand on aura les données
                // créer le bouton
                Entreprise entreprise = ManagerEntreprise.recupererProfilesEntreprises(entre.IdEntreprise);

                Button btn = new Button();
                if (i % 2 == 0)
                {
                    btn.Style = style;
                }
                else
                {
                    btn.Style = style2;
                }
                btn.DataContext = entre.Id;
                btn.Click      += afficherEntrevue;

                //layout du bouton
                StackPanel hPanel = new StackPanel();
                hPanel.Orientation         = Orientation.Horizontal;
                hPanel.Width               = 300;
                hPanel.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
                hPanel.VerticalAlignment   = System.Windows.VerticalAlignment.Center;

                //nom
                ajouterLabel(hPanel, entreprise.Nom, 12, 50);
                //date
                ajouterLabel(hPanel, entre.DateEntrevue.ToShortDateString(), 10, 70);
                //Type
                ajouterTextBlock(hPanel, ListeDescription.recupererDescription(entre.TypeEntrevue, ListeDescription.listTypeEntrevue), 10, 60);

                //resultat
                ajouterLabel(hPanel, ListeDescription.recupererDescription(entre.Resultat, ListeDescription.listTypeResultat), 12, 60);


                //ajouter l image pour supprimer
                Image imgSuppr = new Image();
                imgSuppr.Width       = 25;
                imgSuppr.Height      = 25;
                imgSuppr.Stretch     = Stretch.Fill;
                imgSuppr.Source      = new BitmapImage(new Uri(@"images\iconX.png", UriKind.RelativeOrAbsolute));
                imgSuppr.MouseDown  += supprimerEntrevue;
                imgSuppr.DataContext = entre.Id;


                hPanel.Children.Add(imgSuppr);

                //ajouter le bouton au stackPanel principal

                btn.Content = hPanel;
                ListeEntrevueVue.Children.Add(btn);


                i++;
            }
        }
        public void ajouterCommunicationEntrepriseVue()
        {
            int i = 1;

            foreach (Communication com in communicationsEntreprises)
            {
                // !!!!!!!!!!!!!!!!!!!!!!!!!   a verifer les margins quand on aura les données
                // créer le bouton
                //recuperer info necessaire (requete)
                Entreprise  entreprise = ManagerEntreprise.recupererProfilesEntreprises(com.IdTo);
                Utilisateur user       = ManagerUtilisateur.recupererUtilisateurParId(com.IdUtilisateur);

                Button btn = new Button();
                if (i % 2 == 0)
                {
                    btn.Style = style;
                }
                else
                {
                    btn.Style = style2;
                }
                btn.DataContext = com;
                btn.Click      += afficherDetailsCommunicationEntreprise;

                //layout du bouton
                StackPanel hPanel = new StackPanel();
                hPanel.Orientation = Orientation.Horizontal;
                //hPanel.Width = 148;
                hPanel.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
                hPanel.VerticalAlignment   = System.Windows.VerticalAlignment.Center;

                //nom prenom etudiant
                ajouterLabel(hPanel, entreprise.Nom, 13, 110);

                //nom admin
                ajouterLabel(hPanel, user.Nom, 13, 95);

                //date Communication
                ajouterLabel(hPanel, com.DateCommunication.ToShortDateString(), 13, 95);

                //Type de stage
                ajouterLabel(hPanel, ListeDescription.recupererDescription(com.TypeCommunication, ListeDescription.listTypeCommunication), 13, 95);

                //Type de status
                ajouterLabel(hPanel, ListeDescription.recupererDescription(com.StatusCommunication, ListeDescription.listStatusCommunication), 13, 95);

                //ajouter l image pour supprimer
                if (User.IdTypeUtilisateur == 1 || User.IdTypeUtilisateur == 2)
                {
                    Image imgSuppr = new Image();
                    imgSuppr.DataContext = com.Id;
                    imgSuppr.Width       = 25;
                    imgSuppr.Height      = 25;
                    imgSuppr.Stretch     = Stretch.Fill;
                    imgSuppr.Source      = new BitmapImage(new Uri(@"images\iconX.png", UriKind.RelativeOrAbsolute));
                    imgSuppr.MouseDown  += supprimerCommunicationEntreprise;
                    hPanel.Children.Add(imgSuppr);
                }
                //ajouter le bouton au stackPanel principal
                btn.Content = hPanel;
                ListeCommunicationEntreprise.Children.Add(btn);

                i++;
            }
        }
Ejemplo n.º 24
0
        //evenement pout rechercher une entreprise
        private void BtnValiderRechercher_Click(object sender, RoutedEventArgs e)
        {
            resultat.Visibility = System.Windows.Visibility.Hidden;
            String ChoixFormationValeur   = (String)ChoixFormation.SelectedValue;
            String ChoixInteretValeur     = (String)ChoixInteret.SelectedValue;
            String ChoixTechnologieValeur = (String)ChoixTechnologie.SelectedValue;
            String ChoixLangueValeur      = (String)ChoixLangue.SelectedValue;

            int idFormation   = ListeDescription.recupererIdFormation(ChoixFormationValeur);
            int idLangue      = ListeDescription.recupererIdLangue(ChoixLangueValeur);
            int idInteret     = ListeDescription.recupererIdDescription(ChoixInteretValeur, ListeDescription.listInterets);
            int idTechnologie = ListeDescription.recupererIdDescription(ChoixInteretValeur, ListeDescription.listTechnologie);

            String idFormationString   = idFormation.ToString();
            String idInteretString     = idInteret.ToString();
            String idLangueString      = idLangue.ToString();
            String idTechnologieString = idTechnologie.ToString();

            //MessageBox.Show(idStatusString + "     " + idFormationString);
            String ChoixNomValeur      = ChoixNom.Text;
            String ChoixCourrielValeur = ChoixCourriel.Text;
            String ChoixVilleValeur    = ChoixVille.Text;



            Dictionary <String, String> dictionnay = new Dictionary <String, String>();

            //dictionnay.Add("statusValeur", ChoixStatusValeur);
            //dictionnay.Add("ChoixFormation", ChoixFormationValeur);


            if (idFormation != -1)
            {
                dictionnay.Add("idFormation", idFormationString);
            }

            if (idInteret != -1)
            {
                dictionnay.Add("idInteret", idInteretString);
            }

            if (idLangue != -1)
            {
                dictionnay.Add("idLangue", idLangueString);
            }

            if (idTechnologie != -1)
            {
                dictionnay.Add("idTechnologie", idTechnologieString);
            }

            dictionnay.Add("nom", ChoixNomValeur);
            dictionnay.Add("courriel", ChoixCourrielValeur);
            dictionnay.Add("ville", ChoixVilleValeur);



            lesEntreprises = ManagerEntreprise.recupererListeProfilesEntreprisesSelonRecherche(dictionnay);

            if (lesEntreprises != null)
            {
                ListeEntreprisesVue.Children.Clear();
                ajouterEntrepriseVue();
            }
            else
            {
                ListeEntreprisesVue.Children.Clear();
                resultat.Visibility = System.Windows.Visibility.Visible;
                lesEntreprises      = ManagerEntreprise.recupererListeProfilesEntreprises();
            }
        }
Ejemplo n.º 25
0
        public ProfileEntrepriseVue(Utilisateur user, int idEntreprise)
        {
            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;
            this.User = user;

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

            //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;
                BtnSupprimerEntreprise.Visibility = System.Windows.Visibility.Hidden;
                BtnModifierEntreprise.Visibility  = System.Windows.Visibility.Hidden;
                StatistiquesMenu.Visibility       = System.Windows.Visibility.Hidden;
            }
            userName.Content   = User.Nom;
            this.MonEntreprise = ManagerEntreprise.recupererEntreprise(idEntreprise);


            if (MonEntreprise.Representants != null)
            {
                ajouterRepresentantVue();
            }
            if (MonEntreprise.FormationsRecherchees != null)
            {
                ajouterFormationVue();
            }
            if (MonEntreprise.TechnologiesRecherchees != null)
            {
                ajouterTechnologieVue();
            }
            if (MonEntreprise.InteretsRecherches != null)
            {
                ajouterInteretVue();
            }

            if (MonEntreprise.stages != null)
            {
                ajouterStageVue();
            }

            if (MonEntreprise.Documents != null)
            {
                ajouterDocumentsVue();
            }

            if (MonEntreprise.Communications != null)
            {
                ajouterCommunicationVue();
            }

            if (MonEntreprise.Entrevues != null)
            {
                ajouterEntrevueVue();
            }

            //binder info avec Mon entreprise
            ImageBrush brush = new ImageBrush();

            brush.ImageSource = new BitmapImage(new Uri(MonEntreprise.ImageLogo, UriKind.RelativeOrAbsolute));
            affichePhoto.Fill = brush;

            nomVue.Content    = MonEntreprise.Nom;
            langueVue.Content = ListeDescription.recupererLaLangue(MonEntreprise.Langue);
            villeVue.Content  = MonEntreprise.Adresse + " " + MonEntreprise.Ville;
            tel1Vue.Content   = MonEntreprise.Telephone1;
            tel2Vue.Content   = MonEntreprise.Telephone2;
            tel3Vue.Content   = MonEntreprise.Telephone3;

            emailVue.Content = MonEntreprise.Email;

            commentaireVue.Text = MonEntreprise.Commentaire;
        }