private void button3_Click(object sender, EventArgs e) { try { string tendia = txt_tendia.Text; DateTime ngaynhapdia = DateTime.ParseExact(txt_ngaynhapdia.Text, "ddMMyyyy", System.Globalization.CultureInfo.InvariantCulture); int soluong = int.Parse(txt_soluongdia.Text); string thongtinlienquan = richtxt_thongtinlienquan.Text; float gia = float.Parse(txt_giasanpham.Text); string loaidia = cbo_loaidia.Text; string doangioithieu = xulychuoi(txt_doangioithieu.Text); Image hinhanhphim = pictureBox1.Image; if (hinhanhphim == null) { MessageBox.Show("VUI LÒNG CHÈN HÌNH ẢNH ĐẠI DIỆN CHO ĐĨA"); } else { //thuc hien thao tac them dia lg.themdia_GUI_nhanvien_quanlidia(tendia, ngaynhapdia, soluong, thongtinlienquan, gia, loaidia, hinhanhphim, doangioithieu); //thong bao thanh cong MessageBox.Show("CHÚC MỪNG!!! BẠN VỪA THÊM ĐĨA THÀNH CÔNG"); } } catch { MessageBox.Show("VUI LÒNG KIỂM TRA LẠI TOÀN BỘ THÔNG TIN VỪA NHẬP"); } }