Beispiel #1
0
 public void Insert(LoaiQuanHeDto dto)
 {
     string query = "INSERT INTO LOAIQUANHE VALUES('" +
         dto.MaLoaiQuanHe + "','" +
         dto.TenLoaiQuanHe + "')";
     _provider.executeQuery(query);
 }
Beispiel #2
0
 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;
 }
Beispiel #3
0
 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;
 }