예제 #1
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            if (KiemTraDuLieu())
            {
                BUS_HangHoa h    = new BUS_HangHoa();
                var         flag = h.ThemHangHoa(txtTenHangHoa.Text, int.Parse(cbDVT.EditValue.ToString()), int.Parse(txtSoLuong.Text), float.Parse(txtDonGia.Text));

                if (flag == true)
                {
                    var tb = MessageBox.Show("Bạn đã thêm hàng hóa thành công.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    if (tb == DialogResult.OK)
                    {
                        txtTenHangHoa.Text = string.Empty;
                        cbDVT.EditValue    = null;
                        txtSoLuong.Text    = string.Empty;
                        txtDonGia.Text     = string.Empty;

                        KhiThemHangHoa(EventArgs.Empty);   //  https://msdn.microsoft.com/en-us/library/9aackb16(v=vs.110).aspx
                    }
                }
            }
        }