public Employe(string codeEmploye, string nomComplet, DateTime?dateNaissance, string lieuNaissance, StatutSexe?sexe, string numeroCNI, string numeroTelephone1, string numeroTelephone2, Pays pays, Ville ville, string adresse, string photoProfil, DateTime?dateEnregistrement, string nomUtilisateur, string motDePasse, StatutEmploye statutEmploye) : base(nomComplet, dateNaissance, lieuNaissance, sexe, numeroCNI, numeroTelephone1, numeroTelephone2, pays, ville, adresse, photoProfil, dateEnregistrement) { CodeEmploye = codeEmploye; NomUtilisateur = nomUtilisateur; MotDePasse = motDePasse; StatutEmploye = statutEmploye; }
public void AjouterEmploye(string nomComplet, DateTime?dateNaissance, string lieuNaissance, StatutSexe?sexe, string numeroCNI, string numeroTelephone1, string numeroTelephone2, Pays pays, Ville ville, string adresse, string photoProfil, string motDePasse, StatutEmploye statutEmploye, Employe employe) { operationBLO = new OperationBLO(); employeBLO.Add(new Employe(CodeEmploye(statutEmploye), nomComplet, dateNaissance, lieuNaissance, sexe, numeroCNI, numeroTelephone1, numeroTelephone2, pays, ville, adresse, photoProfil, DateTime.Now, NomUtilisateur(nomComplet, CodeEmploye(statutEmploye)), crypterMD5.GetMd5Hash(MD5.Create(), motDePasse.ToLower()), statutEmploye)); operationBLO.AjouterOperation(TypeOperation.Embauche, employe, new Client("Indefini"), new CompteClient("Indefini"), 0, "mdp : " + motDePasse); if (photoProfil != string.Empty) { fichierStockeBLO.AjouterFichierStocke($"Photo de l'employe {CodeEmploye(statutEmploye)}", photoProfil, new Client("Indefini"), new Garantie(0), StatutStockage.Image_des_employés, employe); } new IdentifiantBLO().AddIdEmploye(); }
public void ModifierEmploye(Employe employeModifie, string motDePasse, StatutEmploye statutEmploye, Employe employeModifieur) { operationBLO = new OperationBLO(); int index = employeBLO.IndexOf(employeModifie); employeModifie.MotDePasse = crypterMD5.GetMd5Hash(MD5.Create(), motDePasse.ToLower()); employeModifie.StatutEmploye = statutEmploye; employeModifie.CodeEmploye = CodeEmploye(statutEmploye).Split('-')[0] + "-" + employeModifie.CodeEmploye.Split('-')[1]; employeBLO[index] = employeModifie; operationBLO.AjouterOperation(TypeOperation.Modification, employeModifieur, new Client("Indefini"), new CompteClient("Indefini"), 0, "mdp : " + motDePasse); }
public string CodeEmploye(StatutEmploye statutEmploye) => ((statutEmploye == StatutEmploye.Caissier) ? "cai-" : (statutEmploye == StatutEmploye.Chef_Agence) ? "cag-" : (statutEmploye == StatutEmploye.Chef_Credit) ? "ccr-" : (statutEmploye == StatutEmploye.Comptable) ? "com-" : "sec-") + new IdentifiantBLO().IdEmploye.ToString().PadLeft(5, '0');
public IEnumerable <Employe> RechercherDesEmployesMemeStatut(StatutEmploye statutEmploye) => employeBLO.Find(x => x.StatutEmploye == statutEmploye);