Exemple #1
0
 bool CoChua(ThueBao tb)
 {
     for (int i = 0; i < length; i++)
     {
         if (a[i].soCMND == tb.soCMND)
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #2
0
 public void SapXep(KieuSapXep k)
 {
     for (int i = 0; i < length - 1; i++)
     {
         for (int j = i + 1; j < length; j++)
         {
             if (KiemTraDieuKien(a[i], a[j], k) == 1)
             {
                 ThueBao tam = a[i];
                 a[i] = a[j];
                 a[j] = tam;
             }
         }
     }
 }
Exemple #3
0
 private int KiemTraDieuKien(ThueBao thueBao1, ThueBao thueBao2, KieuSapXep k)
 {
     if (k == KieuSapXep.TangTheoHoTen)
     {
         return(thueBao1.hoTen.CompareTo(thueBao2.hoTen));
     }
     if (k == KieuSapXep.GiamTheoHoTen)
     {
         return(-thueBao1.hoTen.CompareTo(thueBao2.hoTen));
     }
     if (k == KieuSapXep.TangTheoNgaySinh)
     {
         return(thueBao1.ngaySinh.CompareTo(thueBao2.ngaySinh));
     }
     if (k == KieuSapXep.GiamTheoNgaySinh)
     {
         return(-thueBao1.ngaySinh.CompareTo(thueBao2.ngaySinh));
     }
     return(-1);
 }
Exemple #4
0
 public void Them(ThueBao tb)
 {
     a[length++] = tb;
 }
Exemple #5
0
 public void Them_TB(ThueBao x)
 {
     DS_TB.Add(x);
 }