public void Insert(LoaiThanhTichDto dto) { string query="INSERT INTO LOAITHANHTICH VALUES('"+ dto.MaLoaiThanhTich+"','"+ dto.TenLoaiThanhTich+"')"; _provider.executeQuery(query); }
public ArrayList GetDanhSachLoaiThanhTich() { ArrayList arr = new ArrayList(); LoaiThanhTichDto dto; OleDbDataReader reader = (OleDbDataReader)dao.GetDanhSachLoaiThanhTich(); while (reader.Read()) { dto = new LoaiThanhTichDto(); dto.MaLoaiThanhTich = reader["MaLoaiThanhTich"].ToString(); dto.TenLoaiThanhTich = reader["TenLoaiThanhTich"].ToString(); arr.Add(dto); } reader.Close(); return arr; }
public LoaiThanhTichDto GetLoaiThanhTich(string str) { LoaiThanhTichDto dto; OleDbDataReader reader = (OleDbDataReader)dao.GetDanhSachLoaiThanhTich(); while (reader.Read()) { dto = new LoaiThanhTichDto(); dto.MaLoaiThanhTich = reader["MaLoaiThanhTich"].ToString(); dto.TenLoaiThanhTich = reader["TenLoaiThanhTich"].ToString(); if (dto.MaLoaiThanhTich == str) reader.Close(); return dto; } reader.Close(); return null; }