Exemple #1
0
 public void Insert(NguyenNhanDto dto)
 {
     string query = "INSERT INTO NGUYENNHAN VALUES('" +
     dto.MaNguyenNhan + "','" +
     dto.TenNguyenNhan + "')";
     _provider.executeQuery(query);
 }
Exemple #2
0
 public ArrayList GetDanhSachNguyenNhan()
 {
     ArrayList arr = new ArrayList();
     NguyenNhanDto dto;
     OleDbDataReader reader = (OleDbDataReader)dao.GetDanhSachNguyenNhan();
     while (reader.Read())
     {
         dto = new NguyenNhanDto();
         dto.MaNguyenNhan = reader["MaNguyenNhan"].ToString();
         dto.TenNguyenNhan = reader["TenNguyenNhan"].ToString();
         arr.Add(dto);
     }
     reader.Close();
     return arr;
 }
Exemple #3
0
 public NguyenNhanDto GetNguyenNhan(string str)
 {
     NguyenNhanDto dto;
     OleDbDataReader reader = (OleDbDataReader)dao.GetDanhSachNguyenNhan();
     while (reader.Read())
     {
         dto = new NguyenNhanDto();
         dto.MaNguyenNhan = reader["MaNguyenNhan"].ToString();
         dto.TenNguyenNhan = reader["TenNguyenNhan"].ToString();
         if (dto.MaNguyenNhan == str)
             reader.Close();
         return dto;
     }
     reader.Close();
     return null;
 }