Ejemplo n.º 1
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     if (txtTenTB.Text == "" || txtTinhTrang.Text == "" || txtSoLuong.Text == "" || txtMaTB.Text == "" ||
         txtLoai.Text == "" || txtSoLuongHu.Text == "" || ptbThietBi.Image == null)
     {
         MessageBox.Show("Vui lòng nhập đủ thông tin");
     }
     else
     {
         try
         {
             tb.ThemThietBi(txtMaTB.Text, txtTenTB.Text, txtLoai.Text, txtSoLuong.Text, txtHangSX.Text, txtSoLuongHu.Text, txtTinhTrang.Text, rtbGhiChu.Text, LuuAnh());
             MessageBox.Show("Đã thêm một thiết bị mới!!");
             this.Close();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }