public static ObservableCollection <EspeceNombreDAO> selectEspeceNombres()
        {
            ObservableCollection <EspeceNombreDAO> l = new ObservableCollection <EspeceNombreDAO>();
            string       query = "SELECT * FROM etude_has_plage_has_Espece;";
            MySqlCommand cmd   = new MySqlCommand(query, DALConnection.OpenConnection());

            try
            {
                cmd.ExecuteNonQuery();
                MySqlDataReader reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    EspeceNombreDAO p = new EspeceNombreDAO(reader.GetInt32(0), reader.GetInt32(1), reader.GetInt32(2), reader.GetInt32(3), reader.GetInt32(4), reader.GetDecimal(5));
                    l.Add(p);
                }
                reader.Close();
            }
            catch (Exception e)
            {
                MessageBox.Show("La base de données n'est pas connectée");
            }
            return(l);
        }
示例#2
0
        public static ObservableCollection <CommuneDAO> selectCommunes()
        {
            ObservableCollection <CommuneDAO> l = new ObservableCollection <CommuneDAO>();
            string       query = "SELECT * FROM Commune;";
            MySqlCommand cmd   = new MySqlCommand(query, DALConnection.OpenConnection());

            try
            {
                cmd.ExecuteNonQuery();
                MySqlDataReader reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    CommuneDAO p = new CommuneDAO(reader.GetInt32(0), reader.GetString(1), reader.GetString(2), reader.GetInt32(3));
                    l.Add(p);
                }
                reader.Close();
            }
            catch (Exception e)
            {
                MessageBox.Show("La base de données n'est pas connectée");
            }
            return(l);
        }
示例#3
0
 public EtudeDAL()
 {
     DALConnection.OpenConnection();
     connection = DALConnection.OpenConnection();
 }
示例#4
0
 public UsersDAL()
 {
     //  si la connexion est déjà ouverte, il ne la refera pas (voir code dans DALConnection)
     DALConnection.OpenConnection();
     connection = DALConnection.OpenConnection();
 }
示例#5
0
 public DepartementDAL()
 {
     DALConnection.OpenConnection();
     connection = DALConnection.OpenConnection();
 }
示例#6
0
 public EspeceDAL()
 {
     DALConnection.OpenConnection();
     connection = DALConnection.OpenConnection();
 }
示例#7
0
 public PlageDAL()
 {
     DALConnection.OpenConnection();
     connection = DALConnection.OpenConnection();
 }
 public ZoneInvestigationDAL()
 {
     DALConnection.OpenConnection();
     connection = DALConnection.OpenConnection();
 }
示例#9
0
 public CommuneDAL()
 {
     DALConnection.OpenConnection();
     connection = DALConnection.OpenConnection();
 }