Example #1
0
        private void btnSua_Click(object sender, EventArgs e)
        {
            string gt;

            if (txtMaNV.Text == "")
            {
                MessageBox.Show("Bạn chưa chọn bản ghi nào", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (txtTenNV.Text.Trim().Length == 0)
            {
                MessageBox.Show("Bạn phải nhập tên nhân viên", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtTenNV.Focus();
                return;
            }
            if (txtDiaChi.Text.Trim().Length == 0)
            {
                MessageBox.Show("Bạn phải nhập địa chỉ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtDiaChi.Focus();
                return;
            }
            if (txtDienThoai.Text.Trim().Length == 0)
            {
                MessageBox.Show("Bạn phải nhập số điện thoại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtDienThoai.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtLuongThang.Text))
            {
                MessageBox.Show("Bạn phải nhập lương tháng", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtLuongThang.Focus();
                return;
            }
            gt = chkNam.Checked ? "Nam" : "Nữ";
            BLL.updateNV(txtMaNV.Text, txtTenNV.Text, gt, dtpNgaySinh.Value.Date, txtDiaChi.Text, txtDienThoai.Text,
                         float.Parse(txtLuongThang.Text), cbxChucVu.Text);
            hienThi();
            resetValue();
        }