예제 #1
0
        private void btnDangKy_Click(object sender, EventArgs e)
        {
            if (SHAREVAR.MaNV_DK == null || SHAREVAR.TenNV_DK == null)
            {
                MessageBox.Show("Vui lòng chọn nhân viên trước !");
                return;
            }
            if (txtMK.Text != txtNhapLaiMK.Text)
            {
                MessageBox.Show("Mật khẩu nhập lại không khớp, vui lòng nhập lại !");
                return;
            }
            BLNhanVien blNV = new BLNhanVien();

            bool dktk = blNV.DangKyNV(this.lbMaNV.Text, this.txtTK.Text, this.txtMK.Text, ref err);

            //blXe.ThemXe("ba","con","co",1,1, ref err);
            if (dktk)
            {
                MessageBox.Show("Đăng ký thành công !");
                SHAREVAR.MaNV_DK  = null;
                SHAREVAR.TenNV_DK = null;
                txtTK.ResetText();
                txtMK.ResetText();
                txtNhapLaiMK.ResetText();
            }
            else
            {
                MessageBox.Show("Đăng ký thất bại, có thể nhân viên này đã có tài khoản rồi !!!");
            }
        }