示例#1
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     try
     {
         qdDTO.SoLuongSachToiDa = int.Parse(txtSoSachMuonToiDa.Text);
         qdDTO.SoNgayMuonToiDa  = int.Parse(txtSoNgayMuonToiDa.Text);
         if (qdBUS.KiemTra(qdDTO) && qdBUS.Update(qdDTO))
         {
             MessageBox.Show("Cập nhập thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("Cập nhập không thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch
     {
         MessageBox.Show("Kiểu dử liệu bạn nhập không hợp lệ!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtSoNgayMuonToiDa.Text = "";
         txtSoSachMuonToiDa.Text = "";
     }
 }