private void btnEnregistrer_Click_1(object sender, EventArgs e) { try { string fileName = fonction.PictureName(pbEmploye); if (SiFormulaireRempliCorrectement) { if (SiAgeConvient) { if (PersonneBLO.VerifierCNIExist(txbNumeroCNI.Text, new Client(), new Employe())) { if (SiMDPConvient) { employeBLO.AjouterEmploye(txbNomComplet.Text, dtDateNaissance.Value.Date, txbLieuNaissance.Text, RetourSexe(cmbSexe.Text), txbNumeroCNI.Text, $"{cmbCodeTelephone1.Text} {txbNumero1.Text} ", $"{cmbCodeTelephone2.Text} {txbNumero2.Text} ", paysBLO.RechercherUnPays(cmbPays.Text), villeBLO.RechercherUneVille(cmbVille.Text), txbAdresse.Text, fileName, txbMotDePasse.Text, RetourStatutEmploye(cmbRoleEmploye.Text), this.employe); new Uc_GererEmploye(this.employe).RefreshDataGrid(employeBLO.TousEmployes); fonction.AfficheMessageNotification(Color.FromArgb(33, 191, 116), "Enregistrement", $"Employe ajoute !"); InitForm(); } else { fonction.AfficheMessageNotification(Color.FromArgb(248, 43, 43), "Enregistrement", "Les mots de passe non identiques !"); } } else { fonction.AfficheMessageNotification(Color.FromArgb(248, 43, 43), "Enregistrement", "Ce numero de CNI est deja utilise !"); } } else { fonction.AfficheMessageNotification(Color.FromArgb(248, 43, 43), "Enregistrement", $"Votre age ne convient pas a l'age minimal " + $"({new ParametreGeneralBLO().TousParametreGenerals[0].AgeMinimalRequis}) !"); } } else { fonction.AfficheMessageNotification(Color.FromArgb(248, 43, 43), "Enregistrement", "Veillez remplir tous les champs !"); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); } }