private void fillCustomersListFromDatabase() { connectionManager cm = new connectionManager(); /*d = new DBOperation(); * Adatbazis a = new Adatbazis(); * MySQLDatabaseInterface mdi = a.kapcsolodas(); * mdi.open(); * string query = "SELECT * FROM vevok "; * = mdi.getToDataTable(query); * mdi.close();*/ string query = "select * from vevok"; MySqlConnection con = new MySqlConnection(cm.readG()); con.Open(); MySqlCommand cmd = new MySqlCommand(query, con); MySqlDataAdapter dp = new MySqlDataAdapter(cmd); DataTable dtCustomer = new DataTable(); dp.Fill(dtCustomer); foreach (DataRow row in dtCustomer.Rows) { int azon = Convert.ToInt32(row["azon"].ToString()); string nev = row["nev"].ToString(); int adoazon = Convert.ToInt32(row["adoazon"].ToString()); long banksz = Convert.ToInt64(row["banksz"].ToString()); long tel = Convert.ToInt64(row["tel"].ToString()); bool dolg = Convert.ToBoolean(row["dolg"].ToString()); bool torzs = Convert.ToBoolean(row["torzs"].ToString()); int vasmenny = Convert.ToInt32(row["vasmenny"].ToString()); string felh = row["felh"].ToString(); string jelsz = row["jelsz"].ToString(); string email = row["email"].ToString(); MDVevok v = new MDVevok(azon, nev, adoazon, banksz, tel, dolg, torzs, vasmenny, felh, jelsz, email); customers.Add(v); } }
public void addNewCustomer(int id, MDVevok vevo) { d = new DBOperation(); d.addNewCustomer(id, vevo); }