Beispiel #1
0
        private void button_connecter_Click(object sender, EventArgs e)
        {
            string mdp = textBox_MDP.Text;
            int    id  = Convert.ToInt32(textBox_id.Text);

            if (EmployesBD.UtilTrouve(id, mdp) != null)
            {
                Employes emp = new Employes();
                emp = EmployesBD.UtilTrouve(id, mdp);

                if (emp.Categorie == "Gestionnaire IT")
                {
                    Administration adm = new Administration();
                    adm.PersonneMP = emp.NoIdentifiant.ToString();
                    adm.Show();
                    this.Hide();
                }
                else if (emp.Categorie == "Gestionnaire Ventes")
                {
                    COMMIS com = new COMMIS();
                    com.PersonneMP = emp.NoIdentifiant.ToString();
                    com.Show();
                    this.Hide();
                }
                else if (emp.Categorie == "Commis")
                {
                    FeuilleCommis fCommis = new FeuilleCommis();
                    fCommis.PersonneMP = emp.NoIdentifiant.ToString();
                    fCommis.Show();
                    this.Hide();
                }
                else if (emp.Categorie == "Comptable")
                {
                    // formulaire à faire
                }
                else if (emp.Categorie == "Contrôleur")
                {
                    FeuilleControle fc = new FeuilleControle();
                    fc.PersonneMP = emp.NoIdentifiant.ToString();
                    fc.Show();
                    this.Hide();
                }
                else
                {
                    // Utilisateur lambda
                }
            }
            else
            {
                MessageBox.Show("Utilisateur inconnu", "Incorrect", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #2
0
 public List <Employes> rechercheParNomPrenom(string nom, string prenom)
 {
     return(EmployesBD.rechercheParNomPrenom(nom, prenom));
 }
Beispiel #3
0
 public List <Employes> rechercheParFonction(string fonction)
 {
     return(EmployesBD.rechercheParFonction(fonction));
 }
Beispiel #4
0
 public List <Employes> rechercheParPrenom(string prenom)
 {
     return(EmployesBD.rechercheParPreNom(prenom));
 }
Beispiel #5
0
 public Employes rechercheParId(int id)
 {
     return(EmployesBD.rechercheParId(id));
 }
Beispiel #6
0
 public bool modifyData(Employes emp)
 {
     return(EmployesBD.modifyData(emp));
 }
Beispiel #7
0
 public List <Employes> ListeEmployee()
 {
     return(EmployesBD.getListEmployes());
 }
Beispiel #8
0
 public bool DeleteEmploye(Employes emp)
 {
     return(EmployesBD.DeleteData(emp));
 }
Beispiel #9
0
 public bool SaveEmploye(Employes emp)
 {
     return(EmployesBD.InsertData(emp));
 }