예제 #1
0
 public void KiemTraBtnCapNhat()
 {
     if (maBanChon != 0 && txtSucChuaCS.Text != "")
     {
         if (Ban.Ban.KiemTraSucChua(int.Parse(txtSucChuaCS.Text)) && dsBan.KiemTraTinhTrangBan(maBanChon))
         {
             btnCapNhat.Enabled = true;
         }
         else
         {
             btnCapNhat.Enabled = false;
         }
     }
     else
     {
         btnCapNhat.Enabled = false;
     }
 }
예제 #2
0
        public void KiemTraTinhTrangBan_MaBanKhongCo()
        {
            Ban b0 = new Ban(0, 0);
            Ban b1 = new Ban(111, 10, true);
            Ban b2 = new Ban(112, 15, false);
            Ban b3 = new Ban(113, 16);

            DSBan dsB = new DSBan();

            dsB.ThemBan(b0);
            dsB.ThemBan(b1);
            dsB.ThemBan(b2);
            dsB.ThemBan(b3);

            dsB.ThemBan(4);
            dsB.SapXep();

            bool excepted = false;
            bool actual   = dsB.KiemTraTinhTrangBan(112);

            Assert.AreEqual(excepted, actual);
        }