Exemple #1
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     if (theLoaiBUS.Delete())
     {
         int kt = 1;
         foreach (string item in listTheLoai)
         {
             theLoaiDTO.TenTheLoai = item;
             if (!theLoaiBUS.Insert(theLoaiDTO) || !theLoaiBUS.KiemTra(theLoaiDTO))
             {
                 kiemtra = false;
                 kt      = 0;
                 MessageBox.Show("Thêm tên thể loại không thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 break;
             }
         }
         if (kt == 1)
         {
             MessageBox.Show("Thêm tên thể loại thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             kiemtra        = true;
             xacNhanCapNhap = true;
         }
     }
     else
     {
         MessageBox.Show("Lỗi hệ thống!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }