Beispiel #1
0
        public static clsListEmployee GetEmployee()
        {
            //Liste temporaire
            clsListEmployee tmpListEmployee = new clsListEmployee();

            //Connection a la BDD
            //OleDbConnection myCon = new OleDbConnection(); //connection
            //myCon.ConnectionString = @"Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C:\Users\pc\Documents\Visual Studio 2015\Projects\prjCSWinADONET\prjCSWinADONET\bin\Debug\data\Sport.mdb";
            //myCon.Open();

            //Commande + Requete SQL
            OleDbCommand cmd = new OleDbCommand();     //commande

            cmd.Connection  = clsGlobal.myCon;
            cmd.CommandText = "SELECT * FROM Employees";
            OleDbDataReader rd = cmd.ExecuteReader();

            while (rd.Read())
            {
                clsEmployee eq = new clsEmployee(rd["User"].ToString(),
                                                 rd["Password"].ToString(), rd["Email"].ToString(),
                                                 rd["RefEmployee"].ToString(), rd["Poste"].ToString(),
                                                 rd["RefCompany"].ToString(), rd["Phone"].ToString(),
                                                 rd["FirstName"].ToString(), rd["LastName"].ToString());
                tmpListEmployee.Ajouter(eq);
                eq = null;
            }
            //fermer le reader
            rd.Close();
            //fermer la connection
            // myCon.Close();
            //retourne la valeur tmpList
            return(tmpListEmployee);
        }
Beispiel #2
0
 public clsCompany(clsListEmployee Employee, clsListClient Client, clsListHouse House)
 {
     this.VEmployee = Employee;
     this.Cliente   = Client;
     this.House     = House;
 }