private void BtnThem_Click(object sender, EventArgs e) { if (TxtTensanpham.Text == "" || mtbGianhap.Text == "" || mtbSoluong.Text == "" || TxtGiaban.Text == "" || CbLoaisp.Text == "") { MessageBox.Show("Nhập đầy đủ thông tin", "Thông Báo", MessageBoxButtons.OK); } else { if (int.Parse(TxtGiaban.Text) < int.Parse(mtbGianhap.Text)) { MessageBox.Show("Giá bán nhỏ hơn giá nhập", "Thông Báo", MessageBoxButtons.OK); } else { ctpn.ThemCTPN(MaPN, TxtTensanpham.Text, int.Parse(mtbSoluong.Text), int.Parse(mtbGianhap.Text), int.Parse(TxtGiaban.Text), CbLoaisp.Text); MessageBox.Show("Thêm thành công", "Thông Báo", MessageBoxButtons.OK); } } Hien(); }