public void Insert(QueQuanDto dto) { string query = "INSERT INTO QUEQUAN VALUES('" + dto.MaQueQuan + "','" + dto.TenQueQuan + "')"; _provider.executeQuery(query); }
public ArrayList GetDanhSachQueQuan() { ArrayList arr = new ArrayList(); QueQuanDto dto; OleDbDataReader reader = (OleDbDataReader)dao.GetDanhSachQueQuan(); while (reader.Read()) { dto = new QueQuanDto(); dto.MaQueQuan = reader["MaQueQuan"].ToString(); dto.TenQueQuan = reader["TenQueQuan"].ToString(); arr.Add(dto); } reader.Close(); return arr; }
public QueQuanDto GetQueQuan(string mqq) { QueQuanDto qq; OleDbDataReader reader = (OleDbDataReader)dao.GetDanhSachQueQuan(); while (reader.Read()) { qq = new QueQuanDto(); qq.MaQueQuan = reader["MaQueQuan"].ToString(); qq.TenQueQuan = reader["TenQueQuan"].ToString(); if (qq.MaQueQuan == mqq) reader.Close(); return qq; } reader.Close(); return null; }