예제 #1
0
        public void afficher_candidat_to_delete(int id)
        {
            Class_Candidat candidat = new Class_Candidat();

            candidat = Class_Database_app.get_candidate_by_id(id);
            metroTextBox_delete_candidat_cin.Text               = candidat.cin;
            metroTextBox_delete_candidat_nom.Text               = candidat.Nom;
            metroTextBox_delete_candidat_prenom.Text            = candidat.Prenom;
            metroTextBox_delete_candidat_email.Text             = candidat.email;
            metroTextBoxdelete_candidat_quartier.Text           = candidat.quartier;
            metroTextBox_delete_candidat_ville.Text             = candidat.ville;
            dateTimePicker_delete_candidat_date_naissance.Value = candidat.date_naissace;
            if (candidat.genre)
            {
                metroRadioButton_delete_candidat_monsieur.Checked = true;
            }
            else
            {
                metroRadioButton_delete_candidat_madame.Checked = true;
            }
            if (candidat.vcc)
            {
                metroRadioButton_delete_candidat_vcc_oui.Checked = true;
            }
            else
            {
                metroRadioButton_delete_candidat_vcc_non.Checked = true;
            }
        }
 private void metroButton_modifier_search_first_Click(object sender, EventArgs e)
 {
     myCandidat = new Class_Candidat();
     position   = 1;
     myCandidat = Class_Database_app.get_candidat_position_query((int)select_ids[0], query);
     metroLabel_modifier_search_label_count.Text = position.ToString() + "/" + select_ids.Count;
     afficher_candidat();
     gestion_buttons();
 }
        public static Class_Candidat get_candidat_position_query(int query_position, string query_search)
        {
            Class_Candidat my_candidat_find = new Class_Candidat();

            try
            {
                if (connection_x.State != ConnectionState.Open)
                {
                    connection_x.Open();
                }
                query_search += " and c.ID =  " + query_position + " ";
                //MessageBox.Show(query_search);
                SqlCommand    myCountCommande = new SqlCommand(query_search, connection_x);
                SqlDataReader reader_count    = myCountCommande.ExecuteReader();
                if (reader_count.Read())
                {
                    my_candidat_find.cin = reader_count[0].ToString();
                    string genre = reader_count[1].ToString();
                    if (genre == "True" || genre == "true")
                    {
                        my_candidat_find.genre = true;
                    }
                    else
                    {
                        my_candidat_find.genre = false;
                    }
                    DateTime naissance = (DateTime)reader_count[2];
                    my_candidat_find.date_naissace = naissance;
                    my_candidat_find.Nom           = reader_count[3].ToString();
                    my_candidat_find.Prenom        = reader_count[4].ToString();
                    string vcc = reader_count[5].ToString();
                    if (vcc == "True" || vcc == "true")
                    {
                        my_candidat_find.vcc = true;
                    }
                    else
                    {
                        my_candidat_find.vcc = false;
                    }
                    my_candidat_find.ville    = reader_count[6].ToString();
                    my_candidat_find.quartier = reader_count[7].ToString();
                    my_candidat_find.email    = reader_count[8].ToString();
                    byte[] fileData = (byte[])reader_count[9];
                    File.WriteAllBytes(@"imzoughene_youssef.pdf", fileData);
                }
                reader_count.Close();
            }
            catch (Exception t)
            {
                MessageBox.Show(t.ToString());
            }
            return(my_candidat_find);
        }
        public static Class_Candidat get_candidate_by_id(int id)
        {
            Class_Candidat candidat = new Class_Candidat();

            try
            {
                if (connection_x.State != ConnectionState.Open)
                {
                    connection_x.Open();
                }
                string query = "select c.CIN,c.Genre,c.Nom,c.Prenom,c.DateNaissance,c.Ville,c.Quartier,c.Email,c.vcc from Candidat c where c.ID = ";
                query += id.ToString();
                SqlCommand    command3 = new SqlCommand(query, connection_x);
                SqlDataReader reader   = command3.ExecuteReader();
                while (reader.Read())
                {
                    candidat.cin = reader[0].ToString();
                    string genre = reader[1].ToString();
                    if (genre == "True" || genre == "true")
                    {
                        candidat.genre = true;
                    }
                    else
                    {
                        candidat.genre = false;
                    }
                    candidat.Nom           = reader[2].ToString();
                    candidat.Prenom        = reader[3].ToString();
                    candidat.date_naissace = (DateTime)reader[4];
                    candidat.ville         = reader[5].ToString();
                    candidat.quartier      = reader[6].ToString();
                    candidat.email         = reader[7].ToString();
                    string vcc = reader[8].ToString();
                    if (vcc == "True" || vcc == "true")
                    {
                        candidat.vcc = true;
                    }
                    else
                    {
                        candidat.vcc = false;
                    }
                }

                connection_x.Close();
            }
            catch (Exception t)
            {
                MessageBox.Show(t.ToString());
            }
            return(candidat);
        }
        private void metrobuutton_modifier_search_next_Click(object sender, EventArgs e)
        {
            position++;
            if (position > select_ids.Count)
            {
                metrobuutton_modifier_search_next.Enabled = false;
                position = 1;
            }

            myCandidat = new Class_Candidat();
            myCandidat = Class_Database_app.get_candidat_position_query((int)select_ids[position - 1], query);
            metroLabel_modifier_search_label_count.Text = position.ToString() + "/" + select_ids.Count;
            afficher_candidat();

            gestion_buttons();
        }
예제 #6
0
        private void Form_update_langues_Load(object sender, EventArgs e)
        {
            Class_Candidat candidat = Class_Database_app.get_candidate_by_id(myid_candidat);

            metroTextBox_update_langage_nom.Text    = candidat.Nom;
            metroTextBox_update_langage_prenom.Text = candidat.Prenom;
            my_arry_ids = Class_Database_app.get_langues_by_id_candidat(myid_candidat);
            if (my_arry_ids.Count > 0)
            {
                Class_langage langue = Class_Database_app.get_langue_by_id((int)my_arry_ids[position]);
                afficher(langue);
            }
            else
            {
                MessageBox.Show("aucune langue à afficher");
            }
        }
 private void Form_view_candidat_data_Load(object sender, EventArgs e)
 {
     select_ids      = Class_Database_app.get_number_count_query(query_ids);
     list_to_contact = Class_Database_app.get_number_count_query(query_ids);
     //for (int i = 0; i < select_ids.Count; i++)
     //    MessageBox.Show("s"+i+" = "+select_ids[i]);
     if (select_ids.Count >= 1)
     {
         myCandidat = Class_Database_app.get_candidat_position_query((int)select_ids[0], query);
         metroLabel_modifier_search_label_count.Text = "1/" + select_ids.Count;
         afficher_candidat();
     }
     else
     {
         MessageBox.Show("Aucune candidat exist avec ces conditions");
     }
 }
        private void Form_update_diploma_Load(object sender, EventArgs e)
        {
            Class_Candidat candidat = Class_Database_app.get_candidate_by_id(my_id);

            metroTextBox_update_diploma_nom.Text    = candidat.Nom;
            metroTextBox_update_diploma_prenom.Text = candidat.Prenom;
            string query_diploma = "select ID_diplome from diplome where ID_candidat = " + my_id;

            my_list_diploma = Class_Database_app.get_ids_diploma_update(query_diploma);
            if (my_list_diploma.Count > 0)
            {
                Class_diplome diplome = Class_Database_app.get_diploma_by_id((int)my_list_diploma[position]);
                afficher(diplome);
            }
            else
            {
                MessageBox.Show("aucune diplome à afficher");
            }
        }
 private void Form_view_candidat_details_Load(object sender, EventArgs e)
 {
     my_candidat = Class_Database_app.get_candidate_by_id(id_candidat);
     afficher();
     diploma_ids    = Class_Database_app.get_diploma_ids_by_id_candidat(id_candidat);
     bac_ids        = Class_Database_app.get_bac_ids_by_id_candidat(id_candidat);
     niveu_bac_ids  = Class_Database_app.get_niveau_bac_ids_by_id_candidat(id_candidat);
     telephone_ids  = Class_Database_app.get_telephone_ids_by_id_candidat(id_candidat);
     emploi_ids     = Class_Database_app.get_emploi_metier_ids_by_id_candidat(id_candidat);
     experience_ids = Class_Database_app.get_experience_ids_by_id_candidat(id_candidat);
     ateliers_ids   = Class_Database_app.get_ateliers_ids_by_id_candidat(id_candidat);
     langues_ids    = Class_Database_app.get_langues_by_id_candidat(id_candidat);
     afficher_diplomas();
     afficher_bac();
     afficher_tel();
     afficher_emploi_metier();
     afficher_experience();
     afficher_atelier();
     afficher_langues();
 }