コード例 #1
0
ファイル: RequeteEtudiant.cs プロジェクト: thachgiasoft/OOP
        //retour d'une liste de interets d'un etudiant avec id et description
        public static List <IdDescription> recupererInteretsEtudiant(int idEtudiant)
        {
            List <IdDescription> listeInterets = null;

            string       requete         = @"select i.id as id, i.description as description from interetEtudiant ie inner join interet i on i.id=ie.idInteret where i.actif=1 and ie.idEtudiant=@idEtudiant";
            SqlParameter idEtudiantParam = new SqlParameter("@idEtudiant", idEtudiant);

            using (SqlConnection conn = new SqlConnection(ConnectionString)) {
                conn.Open();
                using (SqlCommand cmd = new SqlCommand(requete, conn)) {
                    cmd.CommandType = CommandType.Text;
                    cmd.Parameters.Add(idEtudiantParam);
                    using (SqlDataReader rdr = cmd.ExecuteReader()) {
                        if (rdr.HasRows)
                        {
                            listeInterets = new List <IdDescription>();
                            while (rdr.Read())
                            {
                                IdDescription interet = new IdDescription();
                                interet.Id          = (int)rdr["id"];
                                interet.Description = rdr["description"].ToString();

                                listeInterets.Add(interet);
                            }
                        }
                    }
                }
            }
            return(listeInterets);
        }
コード例 #2
0
ファイル: RequeteEntreprise.cs プロジェクト: thachgiasoft/OOP
        public static List <IdDescription> recupererInteretsRecherches(int idEntreprise)
        {
            List <IdDescription> listeInterets = null;

            string       requete           = @"select distinct i.id as id, i.description as description from domaineRecherche dr inner join interet i on dr.idInteret=i.id where dr.idEntreprise=@idEntreprise and i.actif=1";
            SqlParameter idEntrepriseParam = new SqlParameter("@idEntreprise", idEntreprise);

            using (SqlConnection conn = new SqlConnection(ConnectionString)) {
                conn.Open();
                using (SqlCommand cmd = new SqlCommand(requete, conn)) {
                    cmd.CommandType = CommandType.Text;
                    cmd.Parameters.Add(idEntrepriseParam);
                    using (SqlDataReader rdr = cmd.ExecuteReader()) {
                        if (rdr.HasRows)
                        {
                            listeInterets = new List <IdDescription>();
                            while (rdr.Read())
                            {
                                IdDescription interet = new IdDescription();
                                interet.Id          = (int)rdr["id"];
                                interet.Description = rdr["description"].ToString();

                                listeInterets.Add(interet);
                            }
                        }
                    }
                }
            }
            return(listeInterets);
        }
コード例 #3
0
ファイル: RequeteEtudiant.cs プロジェクト: thachgiasoft/OOP
        //retour d'une liste de technologies preferees par un etudiant avec id et description
        public static List <IdDescription> recupererTechnologiesPrefereesEtudiant(int idEtudiant)
        {
            List <IdDescription> listeTechnologies = null;

            string       requete         = @"select t.[id] as id, t.[description] as description from  technologie t inner join technologiesPreferes tp on t.id=tp.idTechnologie where t.actif=1 and tp.idEtudiant=@idEtudiant";
            SqlParameter idEtudiantParam = new SqlParameter("@idEtudiant", idEtudiant);

            using (SqlConnection conn = new SqlConnection(ConnectionString)) {
                conn.Open();
                using (SqlCommand cmd = new SqlCommand(requete, conn)) {
                    cmd.CommandType = CommandType.Text;
                    cmd.Parameters.Add(idEtudiantParam);
                    using (SqlDataReader rdr = cmd.ExecuteReader()) {
                        if (rdr.HasRows)
                        {
                            listeTechnologies = new List <IdDescription>();
                            while (rdr.Read())
                            {
                                IdDescription technologie = new IdDescription();
                                technologie.Id          = (int)rdr["id"];
                                technologie.Description = rdr["description"].ToString();

                                listeTechnologies.Add(technologie);
                            }
                        }
                    }
                }
            }
            return(listeTechnologies);
        }
コード例 #4
0
        /// <summary>
        /// Id
        /// </summary>
        /// <returns></returns>
        public static IGroupContainer <T, IdDescription> Id <T>(this IGroupContainer <T> root, String displayName, Expression <PropertyGetter <T> > text, String stringFormat = null)
        {
            var item = new IdDescription(
                displayName,
                PropertyPath.GetPropertyPath(text),
                stringFormat);

            return(root.AddDescription(item));
        }
コード例 #5
0
        private void ajouterFormationVue()
        {
            listeFormation = new List <IdDescription>();
            foreach (Formation id in ListeDescription.listFormations)
            {
                IdDescription description = new IdDescription();
                description.Id          = id.Id;
                description.Description = id.Description;
                listeFormation.Add(description);
            }

            int i = 1;

            foreach (IdDescription description in listeFormation)
            {
                // !!!!!!!!!!!!!!!!!!!!!!!!!   a verifer les margins quand on aura les données


                //layout du bouton
                StackPanel hPanel = new StackPanel();
                hPanel.Orientation = Orientation.Horizontal;
                if (i % 2 == 0)
                {
                    hPanel.Background = new SolidColorBrush(Color.FromArgb(100, 240, 238, 239));
                }
                else
                {
                    hPanel.Background = null;
                }
                hPanel.Width = 531;
                hPanel.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
                hPanel.VerticalAlignment   = System.Windows.VerticalAlignment.Center;

                //etudiant
                ajouterLabel(hPanel, description.Description, 15, 350);

                //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  += supprimerFormation;
                imgSuppr.DataContext = description.Id;

                hPanel.Children.Add(imgSuppr);
                //ajouter le bouton au stackPanel principal

                ListeFormationVue.Children.Add(hPanel);
                i++;
            }
        }
コード例 #6
0
        //Ajouter type utilisateur
        public static void ajouterTypeUtilisateur(IdDescription typeUtilisateur)
        {
            using (SqlConnection conn = new SqlConnection(ConnectionString)) {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand()) {
                    cmd.CommandText = @"insert into typeUtilisateur (description) values (@description)";
                    cmd.Parameters.Add(new SqlParameter("description", typeUtilisateur.Description));


                    cmd.ExecuteNonQuery();
                }
            }
        }
コード例 #7
0
        //Ajouter status communication
        public static void ajouterStatusCommunication(IdDescription statusCommunication)
        {
            using (SqlConnection conn = new SqlConnection(ConnectionString)) {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand()) {
                    cmd.CommandText = @"insert into statusCommunication (description) values (@description)";
                    cmd.Parameters.Add(new SqlParameter("description", statusCommunication.Description));


                    cmd.ExecuteNonQuery();
                }
            }
        }
コード例 #8
0
        //Ajouter Niveau langue
        public static void ajouterNiveauLangue(IdDescription niveauLangue)
        {
            using (SqlConnection conn = new SqlConnection(ConnectionString)) {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand()) {
                    cmd.CommandText = @"insert into niveauLangue (description) values (@description)";
                    cmd.Parameters.Add(new SqlParameter("description", niveauLangue.Description));


                    cmd.ExecuteNonQuery();
                }
            }
        }
コード例 #9
0
        //Ajouter type stage
        public static void ajouterTypeEntrevue(IdDescription TypeStage)
        {
            using (SqlConnection conn = new SqlConnection(ConnectionString)) {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand()) {
                    cmd.CommandText = @"insert into typeEntrevue (description) values (@description)";
                    cmd.Parameters.Add(new SqlParameter("description", TypeStage.Description));


                    cmd.ExecuteNonQuery();
                }
            }
        }//Ajouter type stage
コード例 #10
0
        private void BtnAjouterStatusCarriere_Click(object sender, RoutedEventArgs e)
        {
            if (!choixAjouterCarriere.Text.Equals(""))
            {
                string        entree = choixAjouterCarriere.Text;
                IdDescription desc   = new IdDescription();
                desc.Description = entree;

                ManagerInformation.ajouterStatusCarriere(desc);

                ListeDescription.RemplirList();
                ListeStatusCarriereVue.Children.Clear();
                ajouterCarriereVue();
                MessageBox.Show("Status carrière ajouté.", "Ajout d'un status de carrière", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                MessageBox.Show("Veuillez remplir les champs obligatoires.", "Ajout d'un status de carrière", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
コード例 #11
0
        private void BtnAjouterDocument_Click(object sender, RoutedEventArgs e)
        {
            if (!choixAjouterDocument.Text.Equals(""))
            {
                string        entree = choixAjouterDocument.Text;
                IdDescription desc   = new IdDescription();
                desc.Description = entree;

                ManagerInformation.ajouterTypeDocument(desc);

                ListeDescription.RemplirList();
                ListeDocumentVue.Children.Clear();
                ajouterDocumentVue();
                MessageBox.Show("Document ajouté.", "Ajout d'un document", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                MessageBox.Show("Veuillez remplir les champs obligatoires.", "Ajout d'un document", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
コード例 #12
0
        //Recuperer list status residense
        public static List <IdDescription> recupererStatusResidence()
        {
            List <IdDescription> statusResidenses = new List <IdDescription>();

            using (SqlConnection conn = new SqlConnection(ConnectionString)) {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand()) {
                    cmd.CommandText = @"select * from statusResidence where actif = 1";
                    using (SqlDataReader reader = cmd.ExecuteReader()) {
                        while (reader.Read())
                        {
                            IdDescription statusResidense = new IdDescription();

                            statusResidense.Id          = (int)reader["id"];
                            statusResidense.Description = (string)reader["description"];


                            statusResidenses.Add(statusResidense);
                        }
                    }
                }
            }
            return(statusResidenses);
        }
コード例 #13
0
        //Recuperer list technologie
        public static List <IdDescription> recupererTechnologie()
        {
            List <IdDescription> technologies = new List <IdDescription>();

            using (SqlConnection conn = new SqlConnection(ConnectionString)) {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand()) {
                    cmd.CommandText = @"select * from technologie where actif = 1";
                    using (SqlDataReader reader = cmd.ExecuteReader()) {
                        while (reader.Read())
                        {
                            IdDescription technologie = new IdDescription();

                            technologie.Id          = (int)reader["id"];
                            technologie.Description = (string)reader["description"];


                            technologies.Add(technologie);
                        }
                    }
                }
            }
            return(technologies);
        }
コード例 #14
0
        //Recuperer list Type Doccument
        public static List <IdDescription> recupererListTypeDocument()
        {
            List <IdDescription> listTypeDocument = new List <IdDescription>();

            using (SqlConnection conn = new SqlConnection(ConnectionString)) {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand()) {
                    cmd.CommandText = @"select * from typeDocument where actif = 1";
                    using (SqlDataReader reader = cmd.ExecuteReader()) {
                        while (reader.Read())
                        {
                            IdDescription typeDocument = new IdDescription();

                            typeDocument.Id          = (int)reader["id"];
                            typeDocument.Description = (string)reader["description"];


                            listTypeDocument.Add(typeDocument);
                        }
                    }
                }
            }
            return(listTypeDocument);
        }
コード例 #15
0
        //Recuperer list interet
        public static List <IdDescription> recupererInterets()
        {
            List <IdDescription> interets = new List <IdDescription>();

            using (SqlConnection conn = new SqlConnection(ConnectionString)) {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand()) {
                    cmd.CommandText = @"select * from interet where actif = 1";
                    using (SqlDataReader reader = cmd.ExecuteReader()) {
                        while (reader.Read())
                        {
                            IdDescription interet = new IdDescription();

                            interet.Id          = (int)reader["id"];
                            interet.Description = (string)reader["description"];


                            interets.Add(interet);
                        }
                    }
                }
            }
            return(interets);
        }
コード例 #16
0
        //Recuperer list Niveau langue
        public static List <IdDescription> recupererNiveauLangue()
        {
            List <IdDescription> niveauLangues = new List <IdDescription>();

            using (SqlConnection conn = new SqlConnection(ConnectionString)) {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand()) {
                    cmd.CommandText = @"select * from niveauLangue where actif = 1";
                    using (SqlDataReader reader = cmd.ExecuteReader()) {
                        while (reader.Read())
                        {
                            IdDescription niveauLangue = new IdDescription();

                            niveauLangue.Id          = (int)reader["id"];
                            niveauLangue.Description = (string)reader["description"];


                            niveauLangues.Add(niveauLangue);
                        }
                    }
                }
            }
            return(niveauLangues);
        }
コード例 #17
0
        //Recuperer list type Utlisateur
        public static List <IdDescription> recupererTypeUtilisateur()
        {
            List <IdDescription> typeutlisateur = new List <IdDescription>();

            using (SqlConnection conn = new SqlConnection(ConnectionString)) {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand()) {
                    cmd.CommandText = @"select * from typeUtilisateur where actif = 1";
                    using (SqlDataReader reader = cmd.ExecuteReader()) {
                        while (reader.Read())
                        {
                            IdDescription statusCarriere = new IdDescription();

                            statusCarriere.Id          = (int)reader["id"];
                            statusCarriere.Description = (string)reader["description"];


                            typeutlisateur.Add(statusCarriere);
                        }
                    }
                }
            }
            return(typeutlisateur);
        }
コード例 #18
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);
            }
        }
コード例 #19
0
 //Ajouter status communication
 public static void ajouterStatusCommunication(IdDescription statusCommunication)
 {
     RequeteInformation.ajouterStatusCommunication(statusCommunication);
 }
コード例 #20
0
 //Ajouter type utilisateur
 public static void ajouterTypeUtilisateur(IdDescription typeUtilisateur)
 {
     RequeteInformation.ajouterTypeUtilisateur(typeUtilisateur);
 }
コード例 #21
0
 //Ajouter type stage
 public static void ajouterTypeEntrevue(IdDescription typeStage)
 {
     RequeteInformation.ajouterTypeEntrevue(typeStage);
 }
コード例 #22
0
 //Ajouter type communication
 public static void ajouterTypeCommunication(IdDescription typeCommunication)
 {
     RequeteInformation.ajouterTypeCommunication(typeCommunication);
 }
コード例 #23
0
 //Ajouter Technologie
 public static void ajouterNiveauTechnologie(IdDescription technologie)
 {
     RequeteInformation.ajouterTechnologie(technologie);
 }
コード例 #24
0
 //Ajouter status resisidence
 public static void ajouterStatusResidence(IdDescription statusResidence)
 {
     RequeteInformation.ajouterStatusResidence(statusResidence);
 }
コード例 #25
0
 //Ajouter Niveau langue
 public static void ajouterNiveauLangue(IdDescription niveauLangue)
 {
     RequeteInformation.ajouterNiveauLangue(niveauLangue);
 }
コード例 #26
0
 //Ajouter interet
 public static void ajouterInteret(IdDescription interet)
 {
     RequeteInformation.ajouterInteret(interet);
 }
コード例 #27
0
 //Ajouter type stage
 public static void ajouterTypeDocument(IdDescription typeStage)
 {
     RequeteInformation.ajouterTypeDocument(typeStage);
 }
コード例 #28
0
        //Ajouter Etudiant
        private void BtnAjouterEtudiant_Click(object sender, RoutedEventArgs e)
        {
            MonEtudiant.Prenom     = ChoixPrenomVue.Text;
            MonEtudiant.Nom        = ChoixNomVue.Text;
            MonEtudiant.Courriel   = ChoixCourrierlVue.Text;
            MonEtudiant.Telephone1 = ChoixTel1Vue.Text;
            MonEtudiant.Telephone2 = ChoixTel2Vue.Text;
            MonEtudiant.Telephone3 = ChoixTel3Vue.Text;
            MonEtudiant.Adresse    = ChoixAdresseVue.Text;
            MonEtudiant.Ville      = ChoixVilleVue.Text;

            if (ChoixDateNaissaceVue.SelectedDate != null)
            {
                DateTime?ChoixDateTemp = ChoixDateNaissaceVue.SelectedDate;
                Object   objectdate    = ChoixDateTemp;
                MonEtudiant.DateNaissance = (DateTime)objectdate;
            }

            if (ChoixStatutsResidenceVue.SelectedValue != null)
            {
                MonEtudiant.IdStatusResidence = ListeDescription.recupererIdDescription(ChoixStatutsResidenceVue.SelectedValue.ToString(), ListeDescription.listStatusResidence);
            }

            MonEtudiant.Vehicule       = ChkBxVehicule.IsChecked;
            MonEtudiant.PermisConduire = ChkBxVehicule.IsChecked;
            MonEtudiant.RiveNord       = ChkBxRiveNord.IsChecked;
            MonEtudiant.RiveSud        = ChkBxRiveSud.IsChecked;
            MonEtudiant.Commentaire    = ChoixCommentaireVue.Text;
            MonEtudiant.Langues        = new List <Langue>();


            if (Langue1Choix.SelectedItem != null)
            {
                Langue langue1 = new Langue();
                langue1.Id     = ListeDescription.recupererIdLangue(Langue1Choix.SelectedValue.ToString());
                langue1.Niveau = ListeDescription.recupererIdDescription(Niveau1Choix.SelectedValue.ToString(), ListeDescription.listNiveauLangue);
                MonEtudiant.Langues.Add(langue1);
            }

            if (Langue2Choix.SelectedItem != null)
            {
                Langue langue2 = new Langue();
                langue2.Id     = ListeDescription.recupererIdLangue(Langue2Choix.SelectedValue.ToString());
                langue2.Niveau = ListeDescription.recupererIdDescription(Niveau2Choix.SelectedValue.ToString(), ListeDescription.listNiveauLangue);
                MonEtudiant.Langues.Add(langue2);
            }

            if (Langue3Choix.SelectedItem != null)
            {
                Langue langue3 = new Langue();
                langue3.Id     = ListeDescription.recupererIdLangue(Langue3Choix.SelectedValue.ToString());
                langue3.Niveau = ListeDescription.recupererIdDescription(Niveau3Choix.SelectedValue.ToString(), ListeDescription.listNiveauLangue);
                MonEtudiant.Langues.Add(langue3);
            }

            if (Langue4Choix.SelectedItem != null)
            {
                Langue langue4 = new Langue();
                langue4.Id     = ListeDescription.recupererIdLangue(Langue4Choix.SelectedValue.ToString());
                langue4.Niveau = ListeDescription.recupererIdDescription(Niveau4Choix.SelectedValue.ToString(), ListeDescription.listNiveauLangue);
                MonEtudiant.Langues.Add(langue4);
            }

            if (FormationChoix.SelectedValue != null)
            {
                MonEtudiant.IdFormation = ListeDescription.recupererIdFormation(FormationChoix.SelectedValue.ToString());
            }

            if (DateFinFormaionChoix.SelectedDate != null)
            {
                DateTime?dateFin       = DateFinFormaionChoix.SelectedDate;
                Object   objectdateFin = dateFin;
                MonEtudiant.DateFinFormation = (DateTime)objectdateFin;
            }

            if (StatusCarriereChoix.SelectedValue != null)
            {
                MonEtudiant.IdStatusCarriere = ListeDescription.recupererIdDescription(StatusCarriereChoix.SelectedValue.ToString(), ListeDescription.listStatusCarrieres);
            }


            if (MonEtudiant.Nom.Length <= 0 || MonEtudiant.Prenom.Length <= 0 || MonEtudiant.Courriel.Length <= 0 ||
                MonEtudiant.DateFinFormation == null || StatusCarriereChoix.SelectedValue == null || FormationChoix.SelectedValue == null)
            {
                MessageBox.Show("Veuillez remplir les champs obligatoire", "Ajout d'un étudiant", MessageBoxButton.OK, MessageBoxImage.Information);
            }


            else
            {
                Double SalaireEspereDouble;
                if (Double.TryParse(SalaireChoix.Text, out SalaireEspereDouble))
                {
                    Double.TryParse(SalaireChoix.Text, out SalaireEspereDouble);
                }
                else
                {
                    SalaireEspereDouble = 0;
                }

                Object objectSalaire = SalaireEspereDouble;
                MonEtudiant.SalaireEspere = (Double?)objectSalaire;

                MonEtudiant.PosteDesire = PosteDesirerChoix.Text;
                MonEtudiant.Experiences = ExperiencesAnterieurChoix.Text;


                List <int> listInteretRecherche = null;
                MonEtudiant.Interets = new List <IdDescription>();
                listInteretRecherche = new List <int>();
                if (InteretChoix.SelectedItems != null)
                {
                    foreach (var item in InteretChoix.SelectedItems)
                    {
                        if (item != null)
                        {
                            IdDescription interet = new IdDescription();
                            interet.Id = ListeDescription.recupererIdDescription(item.ToString(), ListeDescription.listInterets);
                            listInteretRecherche.Add(interet.Id);
                            interet.Description = item.ToString();
                            MonEtudiant.Interets.Add(interet);
                        }
                    }
                }
                List <int> listTechnologieRecherche = null;
                MonEtudiant.TechonologiesPreferees = new List <IdDescription>();
                if (TechnologieChoix.SelectedItems != null)
                {
                    listTechnologieRecherche = new List <int>();
                    foreach (var item in TechnologieChoix.SelectedItems)
                    {
                        if (item != null)
                        {
                            IdDescription technologie = new IdDescription();
                            technologie.Id = ListeDescription.recupererIdDescription(item.ToString(), ListeDescription.listTechnologie);
                            listTechnologieRecherche.Add(technologie.Id);
                            technologie.Description = item.ToString();
                            MonEtudiant.TechonologiesPreferees.Add(technologie);
                        }
                    }
                }
                if (MonEtudiant.PhotoURL == null)
                {
                    MonEtudiant.PhotoURL = "images\\ProfilImageVide.png";
                }

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

                int reponse = ManagerEtudiant.ajouterEtudiant(MonEtudiant, listInteretRecherche, listTechnologieRecherche, MonEtudiant.Langues);

                if (reponse != -1)
                {
                    ListerEtudiantsVue listeretudiant = new ListerEtudiantsVue(User);
                    listeretudiant.Show();
                    this.Close();
                }
            }
        }
コード例 #29
0
 //Ajouter status Carriere
 public static void ajouterStatusCarriere(IdDescription statusCarrire)
 {
     RequeteInformation.ajouterStatusCarrire(statusCarrire);
 }