private void metroButton_add_new_Click(object sender, EventArgs e)
 {
     if (metroButton_add_new.Text == "Ajouter Nouveau")
     {
         enable_false_nav_buttons();
         metroButton_update.Enabled = false;
         vider_form();
         metroButton_add_new.Text = "Save";
     }
     else if (metroButton_add_new.Text == "Save")
     {
         DialogResult x = MessageBox.Show("do you wanna save", "save", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
         if (x == DialogResult.OK)
         {
             string query = "";
             if (!metroCheckBox_add_diploma_En_cours.Checked)
             {
                 query = "insert into diplome(ID_candidat,Niveau,specialite,Etablissement,date_obtention) values(" + my_id + ",'" + metroComboBox_add_diploma_niveau.SelectedItem.ToString() + "'," +
                         "'" + metroTextBox_add_diploma_specialite.Text + "','" + metroTextBox_etablissement.Text + "','" + metroTextBox_date_obtention.Text + "')";
             }
             else
             {
                 query = "insert into diplome(ID_candidat,Niveau,specialite,Etablissement,date_obtention) values(" + my_id + ",'" + metroComboBox_add_diploma_niveau.SelectedItem.ToString() + "'," +
                         "'" + metroTextBox_add_diploma_specialite.Text + "','" + metroTextBox_etablissement.Text + "','0')";
             }
             Class_Database_app.add_data(query);
         }
         position = 0;
         Class_diplome diplome = Class_Database_app.get_diploma_by_id((int)my_list_diploma[position]);
         afficher(diplome);
         enable_true_nav_buttons();
         metroButton_update.Enabled = true;
     }
 }
Ejemplo n.º 2
0
        private void metroButton_envoyer_Click(object sender, EventArgs e)
        {
            ArrayList t = new ArrayList();

            t = Class_Database_app.get_ALL_emails();
            //foreach (string v in t)
            //    MessageBox.Show(v);
            try
            {
                foreach (String x in t)
                {
                    MailMessage mail = new MailMessage();
                    mail.To.Add(x);
                    mail.Subject = metroTextBox_objet.Text;
                    mail.From    = new MailAddress("*****@*****.**");
                    mail.Body    = richTextBox_message.Text;
                    SmtpClient smtp = new SmtpClient();
                    smtp.Host        = "smtp.gmail.com";
                    smtp.Port        = 587;
                    smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "Global16");
                    smtp.EnableSsl   = true;
                    smtp.Send(mail);
                }
                MessageBox.Show("Votre message à ete envoyer", "Envoyer", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ep)
            {
                MessageBox.Show(ep.ToString());
            }
        }
        private void metroButton_modifier_search_first_Click(object sender, EventArgs e)
        {
            position = 0;
            Class_diplome diplome = Class_Database_app.get_diploma_by_id((int)my_list_diploma[position]);

            afficher(diplome);
        }
Ejemplo n.º 4
0
        private void metroButton_serch_delete_Click(object sender, EventArgs e)
        {
            chercher_for_delete_ids = new ArrayList();
            string query_to_delete = "select c.ID from Candidat c where c.ID > -1 ";

            if (metroTextBox_delete_search_cin.Text != "")
            {
                query_to_delete += "and c.CIN = '" + metroTextBox_delete_search_cin.Text + "' ";
            }
            if (metroTextBox_delete_candidat_search_nom.Text != "")
            {
                query_to_delete += "and c.Nom='" + metroTextBox_delete_candidat_search_nom.Text + "' ";
            }
            if (metroTextBox_delete_candidat_search_prenom.Text != "")
            {
                query_to_delete += "and c.Prenom = '" + metroTextBox_delete_candidat_search_prenom.Text + "' ";
            }
            if (metroTextBox_delete_candidat_email_search.Text != "")
            {
                query_to_delete += "and c.Email='" + metroTextBox_delete_candidat_email_search.Text + "' ";
            }
            chercher_for_delete_ids = Class_Database_app.get_ids_to_update(query_to_delete);
            if (chercher_for_delete_ids.Count < 1)
            {
                MessageBox.Show("aucune candidat avec ses conditions");
            }
            else
            {
                afficher_candidat_to_delete((int)chercher_for_delete_ids[position_to_delete]);
            }
        }
Ejemplo n.º 5
0
        private void metroButton_set_password_Click(object sender, EventArgs e)
        {
            Regex regex = new Regex(@"^[a-zA-Z]{0,}[0-9]{1,}[a-zA-Z]{0,}[0-9]{1,}[a-zA-Z]{0,}[0-9]{1,}[a-zA-Z]{0,}$");
            Match match = regex.Match(metroTextBox_set_password_new_pass.Text);

            if (match.Success)
            {
                DialogResult x = MessageBox.Show("voulez vous vraiment modifier le mot de passe", "Etes-vous sûr", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (x == DialogResult.OK)
                {
                    Boolean is_updated = Class_Database_app.update_password(metroTextBox_set_password_new_pass.Text, metroTextBox_set_password_actuel_pass.Text, metroComboBox_all_users_set_password.SelectedItem.ToString());
                    if (is_updated == true)
                    {
                        MessageBox.Show("le mot de passe a ete modifier", "Modification", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("le procedure set password has annuler");
                    }
                }
                else
                {
                    MessageBox.Show("La modification a ete annule", "Annuler", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("Le mot de passe d'utilisateur doit composer au maximum de 20 caractères avec trois chiffres au minimum, pas de caractères spéciaux", "Les Règles De Gestion", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 6
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;
            }
        }
Ejemplo n.º 7
0
        private void metroButton_add_new_Click(object sender, EventArgs e)
        {
            if (metroButton_add_new.Text == "Ajouter Nouveau")
            {
                enable_true();
                metroButton_add_langage_save_close.Enabled = false;

                vider_form();
                metroButton_add_new.Text = "Save";
            }
            else if (metroButton_add_new.Text == "Save")
            {
                DialogResult x = MessageBox.Show("do you wanna save", "save", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (x == DialogResult.OK)
                {
                    string query = "insert into langues(ID_candidat,langue,Niveau) values(" + (int)my_arry_ids[position] + ",'" + metroTextBox_update_langage_number1.Text + "','" + metroComboBox_niveau_langage_1.SelectedItem.ToString() + "')";

                    Class_Database_app.add_data(query);
                }
                position = 0;
                Class_langage langue = Class_Database_app.get_langue_by_id((int)my_arry_ids[position]);
                afficher(langue);
                enable_false();
                metroButton_add_langage_save_close.Enabled = true;
            }
        }
Ejemplo n.º 8
0
        private void metroButton_modifier_search_first_Click(object sender, EventArgs e)
        {
            position = 0;
            Class_langage langue = Class_Database_app.get_langue_by_id((int)my_arry_ids[position]);

            afficher(langue);
        }
 private void metroButton_update_Click(object sender, EventArgs e)
 {
     if (metroButton_update.Text == "Save")
     {
         DialogResult c = MessageBox.Show("Do you wanna to save", "save", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
         if (c == DialogResult.OK)
         {
             string query = "update diplome  set Niveau = '" + metroComboBox_add_diploma_niveau.SelectedItem.ToString() + "',";
             query += "specialite='" + metroTextBox_add_diploma_specialite.Text + "',Etablissement='" + metroTextBox_etablissement.Text +
                      "',date_obtention='" + metroTextBox_date_obtention.Text + "' ";
             query += "where ID_diplome = " + (int)my_list_diploma[position];
             Boolean is_updated = Class_Database_app.update_diplome_infos(query);
             if (is_updated)
             {
                 MessageBox.Show("it is updated");
             }
             //----------------------
         }
         position = 0;
         Class_diplome diplome = Class_Database_app.get_diploma_by_id((int)my_list_diploma[position]);
         afficher(diplome);
         metroButton_update.Text = "Modifier";
         disable_false_all();
         enable_true_nav_buttons();
         metroButton_add_new.Enabled = true;
     }
     else if (metroButton_update.Text == "Modifier")
     {
         metroButton_update.Text = "Save";
         disable_true_all();
         enable_false_nav_buttons();
         metroButton_add_new.Enabled = false;
     }
 }
Ejemplo n.º 10
0
 private void metroButton_add_langage_save_close_Click(object sender, EventArgs e)
 {
     if (metroButton_add_langage_save_close.Text == "Modifier")
     {
         metroButton_add_new.Enabled = false;
         DialogResult c = MessageBox.Show("Do you wanna to save", "save", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
         if (c == DialogResult.OK)
         {
             string  query      = "update langues set langue = '" + metroTextBox_update_langage_number1.Text + "' ,Niveau='" + metroComboBox_niveau_langage_1.SelectedItem.ToString() + "' where ID_langue = " + (int)my_arry_ids[position];
             Boolean is_updated = Class_Database_app.update_diplome_infos(query);
             if (is_updated)
             {
                 MessageBox.Show("it is updated");
             }
         }
         position = 0;
         Class_langage langue = Class_Database_app.get_langue_by_id((int)my_arry_ids[position]);
         afficher(langue);
         metroButton_add_langage_save_close.Text = "save";
         enable_false();
     }
     else if (metroButton_add_langage_save_close.Text == "save")
     {
         enable_true();
         metroButton_add_langage_save_close.Text = "Modifier";
         metroButton_add_new.Enabled             = true;
     }
 }
 public void afficher_langues()
 {
     foreach (int i in langues_ids)
     {
         Class_langage langue = Class_Database_app.get_langue_by_id(i);
         richTextBox_langues.Text += langue.langue + "\t" + langue.niveau + "\n";
     }
 }
 public void afficher_emploi_metier()
 {
     foreach (int i in emploi_ids)
     {
         Class_emploi_metier metier = Class_Database_app.get_emploi_metier_by_id(i);
         richTextBox_emploi_metier.Text += metier.emploi_metier + "\n";
     }
 }
 public void afficher_tel()
 {
     foreach (int i in telephone_ids)
     {
         Class_telephone tel = Class_Database_app.get_telephone_by_id(i);
         richTextBox_telephone.Text += "Tel : 0" + tel.numero.ToString() + "\n";
     }
 }
 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();
 }
Ejemplo n.º 15
0
        public void afficher_combo_users()
        {
            ArrayList my_all_users = Class_Database_app.get_all_users();

            foreach (string u in my_all_users)
            {
                metroComboBox_all_users_set_password.Items.Add(u);
            }
        }
 public void afficher_atelier()
 {
     foreach (int i in ateliers_ids)
     {
         Class_ateliers atelier = Class_Database_app.get_atelier_by_id(i);
         richTextBox_ateliers.Text += atelier.theme + "\t" + atelier.observation + "\n";
         richTextBox_ateliers.Text += atelier.date_debut.ToString() + "\t" + atelier.date_Fin.ToString() + "\n";
     }
 }
 public void afficher_diplomas()
 {
     foreach (int id_diploma in diploma_ids)
     {
         Class_diplome diploma = Class_Database_app.get_diploma_by_id(id_diploma);
         richTextBox_formation.Text += diploma.specialite + "\t" + diploma.etablissement + "\n";
         richTextBox_formation.Text += diploma.niveau + "\t" + diploma.date_obtention;
         richTextBox_formation.Text += "\n -------------------------- \n";
     }
 }
Ejemplo n.º 18
0
        private void Form1_Load(object sender, EventArgs e)
        {
            not_enabeld_all();
            faire_water_mark();
            DataTable t = Class_Database_app.view_sourcing_by_date(DateTime.Now);

            dataGridView_view_sourcing.DataSource = t;
            metroTabControl_Starting.SelectedTab  = metroTabPage_login;
            afficher_combo_users();
        }
Ejemplo n.º 19
0
        private void metrobuutton_modifier_search_next_Click(object sender, EventArgs e)
        {
            position++;
            if (position > my_arry_ids.Count - 1)
            {
                position = 0;
            }
            Class_langage langue = Class_Database_app.get_langue_by_id((int)my_arry_ids[position]);

            afficher(langue);
        }
        private void metroButton_modifier_search_precedant_Click(object sender, EventArgs e)
        {
            position--;
            if (position < 0)
            {
                position = my_list_diploma.Count - 1;
            }
            Class_diplome diplome = Class_Database_app.get_diploma_by_id((int)my_list_diploma[position]);

            afficher(diplome);
        }
        private void metrobuutton_modifier_search_next_Click(object sender, EventArgs e)
        {
            position++;
            if (position > my_list_diploma.Count - 1)
            {
                position = 0;
            }
            Class_diplome diplome = Class_Database_app.get_diploma_by_id((int)my_list_diploma[position]);

            afficher(diplome);
        }
Ejemplo n.º 22
0
        private void metroButton_save_update_infos_Click(object sender, EventArgs e)
        {
            DialogResult d = MessageBox.Show("Voulez vraiment entregistrer", "Enregistrer", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (d == DialogResult.OK)
            {
                //update infos here
                string query_to_update_infos = "update Candidat set ";
                query_to_update_infos += " Nom = '" + metroTextBox_show_update_candidat_nom.Text + "' ,Prenom = '" + metroTextBox_show_updat_candidat_prenom.Text + "' , ";
                string genre = "";
                if (metroRadioButton_show_update_candidat_monsieur.Checked)
                {
                    genre = "True";
                }
                else
                {
                    genre = "False";
                }
                query_to_update_infos += " Genre = '" + genre + "' ,DateNaissance = '" + dateTimePicker_show_update_candidat_naissance.Value + "',";
                query_to_update_infos += " Ville = '" + metroTextBox_show_update_candidat_ville.Text + "' ,Quartier = '" + metroTextBox_show_update_candidat_quartier.Text + "',";
                query_to_update_infos += "  CIN = '" + metroTextBox_show_update_candidat_CIN.Text + "' ,Email = '" + metroTextBox_show_update_candidat_email.Text + "' , ";
                string vcc = "";
                if (metroRadioButton_show_update_candidat_vcc_oui.Checked)
                {
                    vcc = "True";
                }
                else
                {
                    vcc = "False";
                }
                query_to_update_infos += " vcc = '" + vcc + "' where ID = " + (int)chercher_for_update_ids[position_to_update];
                MessageBox.Show(query_to_update_infos);
                Boolean is_updated_ok = Class_Database_app.update_candidat_infos(query_to_update_infos);
                //code here to save updating data
                if (is_updated_ok)
                {
                    MessageBox.Show("Enregister bien fait", "Enregistrer", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("procedure n'a pas ressu");
                }
            }
            else
            {
                MessageBox.Show("Le produre d'enregistrer à ete annuler", "Annuler", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            metroPanel_update_candidat_data.Enabled = false;
            vider_panel_update_candidate_data();
        }
Ejemplo n.º 23
0
        private void metroButton_new_compte_Click(object sender, EventArgs e)
        {
            Regex regex = new Regex(@"^[a-zA-Z]{0,}[0-9]{1,}[a-zA-Z]{0,}[0-9]{1,}[a-zA-Z]{0,}[0-9]{1,}[a-zA-Z]{0,}$");
            Match match = regex.Match(metroTextBox_new_account_password.Text);

            if (match.Success)
            {
                //code here password is match
                //MessageBox.Show("Okay");
                Regex regex_username = new Regex(@"^[a-zA-Z]{0,10}$");
                Match match_user     = regex_username.Match(metroTextBox_new_account_username.Text);
                if (match_user.Success)
                {
                    //here username and password is okay
                    DialogResult x = MessageBox.Show("voulez vous vraiment Ajouter le nouveau utilisateur", "Etes-vous sûr", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                    if (x == DialogResult.OK)
                    {
                        //write code here for add new user
                        Boolean ok = Class_Database_app.add_application_user(metroTextBox_new_account_username.Text, metroTextBox_new_account_password.Text);
                        if (ok)
                        {
                            MessageBox.Show("le nouveau utilisateur à éte bien ajouter", "ajouter avec succès", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            metroTextBox_new_account_username.Text = "";
                            metroTextBox_new_account_password.Text = "";
                            afficher_combo_users();
                        }
                        else
                        {
                            MessageBox.Show("ajouter annuler");
                        }
                    }
                    else
                    {
                        MessageBox.Show("l'ajout a ete annulé", "Annuler", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    //code here is not okay username not okay
                    MessageBox.Show("Le nom d'utilisateur doit composer au maximum de 10 caractères alphabétiques, ni numériques ni spéciaux", "Les Règles De Gestion", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                //code here erreur password not match
                MessageBox.Show("Le mot de passe d'utilisateur doit composer au maximum de 20 caractères avec trois chiffres au minimum, pas de caractères spéciaux", "Les Règles De Gestion", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //MetroFramework.MetroMessageBox.Show(this, "Warning", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        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();
        }
Ejemplo n.º 25
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");
     }
 }
 public void afficher_experience()
 {
     foreach (int i in experience_ids)
     {
         Class_experience exp        = Class_Database_app.get_experience_by_id(i);
         string           experience = exp.entreprise + "\t" + exp.poste + "\t" + exp.secteur_activite + "\n";
         experience += exp.ville + "\t" + exp.type + "\t" + exp.Service + "\n";
         if (exp.enCours)
         {
             experience += exp.date_debut.ToString() + " \t enCours \n";
         }
         else
         {
             experience += exp.date_debut.ToString() + "\t" + exp.date_fin.ToString() + "\n";
         }
         richTextBox_experience.Text += experience;
     }
 }
        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");
            }
        }
Ejemplo n.º 29
0
        private void pictureBox_add_candidat_save_Click(object sender, EventArgs e)
        {
            add_candidat_procedure();
            Regex regex = new Regex(@"[\w-]+@([\w-]+\.)+[\w-]+");
            Match match = regex.Match(metroTextBox_add_candidat_email.Text);

            if (match.Success)
            {
                //code here email is valid do the work here
                //MessageBox.Show("Okay");
                Class_Database_app.add_new_candidat();
            }
            else
            {
                //code here erreur email not valid
                MessageBox.Show("L’email du candidat doit être en le format standard", "Les Règles De Gestion", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            Program.new_candidat_to_add = new Class_Candidat();
            reset_form_adding();
        }
 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();
 }