public void Insert(LoaiQuanHeDto dto) { string query = "INSERT INTO LOAIQUANHE VALUES('" + dto.MaLoaiQuanHe + "','" + dto.TenLoaiQuanHe + "')"; _provider.executeQuery(query); }
public ArrayList GetDanhSachLoaiQuanHe() { ArrayList arr = new ArrayList(); LoaiQuanHeDto dto; OleDbDataReader reader = (OleDbDataReader)dao.GetDanhSachLoaiQuanHe(); while (reader.Read()) { dto = new LoaiQuanHeDto(); dto.MaLoaiQuanHe = reader["MaLoaiQuanHe"].ToString(); dto.TenLoaiQuanHe = reader["TenLoaiQuanHe"].ToString(); arr.Add(dto); } reader.Close(); return arr; }
public LoaiQuanHeDto GetLoaiQuanHe(string str) { LoaiQuanHeDto dto; OleDbDataReader reader = (OleDbDataReader)dao.GetDanhSachLoaiQuanHe(); while (reader.Read()) { dto = new LoaiQuanHeDto(); dto.MaLoaiQuanHe = reader["MaLoaiQuanHe"].ToString(); dto.TenLoaiQuanHe = reader["TenLoaiQuanHe"].ToString(); if (dto.MaLoaiQuanHe == str) reader.Close(); return dto; } reader.Close(); return null; }