Exemplo n.º 1
0
        private void btnLuuNV_Click(object sender, EventArgs e)
        {
            DialogResult key = MessageBox.Show("Bạn có muốn lưu " + tbxTenNV.Text.ToString() + "vào Cơ Sở Dữ Liệu", "",
                                               MessageBoxButtons.YesNo, MessageBoxIcon.Information);

            if (key == DialogResult.Yes)
            {
                if (tbxTenNV.Text == "" || tbxSdtNV.Text == "" || tbxDiaChiNV.Text == "")
                {
                    MessageBox.Show("Dữ liệu chưa nhập đủ!", "Thông báo!", MessageBoxButtons.OK);
                }
                else
                {
                    bool GioiTinh;
                    if (rdoNam.Checked)
                    {
                        GioiTinh = true;
                    }
                    else
                    {
                        GioiTinh = false;
                    }
                    dgvNV.DataSource = nvbll.NhanVien_Insert(tbxTenNV.Text, GioiTinh, dtpNgaySinhNV.Value, tbxSdtNV.Text, tbxDiaChiNV.Text);
                    HienThiNV();
                }
            }
        }