示例#1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            errorProvider1.SetError(txtPassNew, "");
            errorProvider1.SetError(txtConfirmPass, "");

            if (txtPassNew.Text.Length < 8 || !txtPassNew.Text.Any(char.IsDigit) || !txtPassNew.Text.Any(char.IsLower) || !txtPassNew.Text.Any(char.IsUpper))
            {
                errorProvider1.SetError(txtPassNew, "Mật khẩu mới bao gồm ít nhất 8 kí tự, gồm chữ in hoa, in thường, số");
                return;
            }

            if (txtPassNew.Text != txtConfirmPass.Text)
            {
                errorProvider1.SetError(txtConfirmPass, "Nhập lại mật khẩu không đúng!");
                return;
            }

            frmMain f     = (frmMain)this.MdiParent;
            int     count = XLBANG.Thuc_hien_lenh("UPDATE NHANVIEN SET Password = '******' WHERE MaNV = '" + f.maNV + "'");

            if (count > 0)
            {
                MessageBox.Show("Cập nhật thành công!");
            }
            else
            {
                MessageBox.Show("Mật khẩu không hợp lệ!");
            }
        }
        private void btnDMK_Click(object sender, EventArgs e)
        {
            errorProvider1.SetError(tbMKM, "");
            errorProvider1.SetError(tbNLKM, "");
            if (tbMKM.Text.Length < 8 || !tbMKM.Text.Any(char.IsDigit) || !tbMKM.Text.Any(char.IsLower) || !tbMKM.Text.Any(char.IsUpper))
            {
                errorProvider1.SetError(tbMKM, "Mật khẩu mới tối thiểu 8 ký tự, gồm chữ số, in hoa và in thường.");
                return;
            }
            if (tbMKM.Text != tbNLKM.Text)
            {
                errorProvider1.SetError(tbNLKM, "Mật khẩu nhập lại không đúng .");
                return;
            }

            frmMain f     = (frmMain)this.MdiParent;
            int     count = XLBANG.Thuc_hien_lenh("Update NHANVIEN set Password ='******' where MaNV ='" + f.maNV + "'");

            if (count > 0)
            {
                MessageBox.Show("Đổi mật khẩu thành công!!!");
            }
            else
            {
                MessageBox.Show("Mật khẩu không hợp lệ!!!");
            }
        }
        private void btnCapnhap_Click(object sender, EventArgs e)
        {
            errorProvider1.SetError(txtDoimatkhau, "");
            errorProvider1.SetError(txtNhaplaimatkhau, "");
            if (txtDoimatkhau.Text.Length < 8 || !txtDoimatkhau.Text.Any(char.IsDigit) || !txtDoimatkhau.Text.Any(char.IsLower) || !txtDoimatkhau.Text.Any(char.IsUpper))
            {
                errorProvider1.SetError(txtDoimatkhau, "Mật khẩu mới tối thiểu 8 ký tự, gồm chữ số," + "in hoa, in thường");
                return;
            }
            if (txtDoimatkhau.Text != txtNhaplaimatkhau.Text)
            {
                errorProvider1.SetError(txtNhaplaimatkhau, "Mật khẩu nhập lại không đúng!!");
                return;
            }
            NhanVien f     = (NhanVien)this.MdiParent;
            int      count = XLBANG.Thuc_hien_lenh("Update NHANVIEN set Password ='******'where MaNV ='" + f.maNV + "'");

            if (count > 0)
            {
                MessageBox.Show("Cập nhật thành công");
            }
            else
            {
                MessageBox.Show("Mật khẩu không hợp lệ!!");
            }
        }
示例#4
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            errorProvider1.SetError(txtPassNew, "");
            errorProvider1.SetError(txtConfirmPass, "");
            if (txtPassNew.Text.Length < 8 || !txtPassNew.Text.Any(char.IsDigit) || !txtPassNew.Text.Any(char.IsLower) || !txtPassNew.Text.Any(char.IsUpper))
            {
                errorProvider1.SetError(txtPassNew, "Mật khẩu mới tối thiểu 8 kí tự, gồm chữ số, " + "in thường, in hoa.");
                return;
            }
            if (txtPassNew.Text != txtConfirmPass.Text)
            {
                errorProvider1.SetError(txtConfirmPass, "Mật khẩu nhập lại không trùng!!!");
                return;
            }
            frmMain f     = (frmMain)this.MdiParent;
            int     count = XLBANG.Thuc_hien_lenh("Update NHANVIEN set Password ='******' where MaNV = '" + f.maNV + "'");

            if (count > 0)
            {
                MessageBox.Show("Cập nhật thành công");
            }
            else
            {
                MessageBox.Show("Mật khẩu không hợp lệ!!!");
            }
        }
示例#5
0
        private void btcapnhat_Click(object sender, EventArgs e)
        {
            dxErrorProvider1.SetError(tbnhapmoimatkhau, "");
            dxErrorProvider1.SetError(tbxnhaplaimatkhau, "");
            if (tbnhapmoimatkhau.Text.Length < 8 || (tbnhapmoimatkhau.Text.Any(char.IsDigit)) || (tbnhapmoimatkhau.Text.Any(char.IsLower)) || (tbnhapmoimatkhau.Text.Any(char.IsUpper)))
            {
                dxErrorProvider1.SetError(tbnhapmoimatkhau, "Mật khẩu mới gồm 8 kí tự,gồm chữ số," + "in hoa in thường");
                return;
            }
            if (tbnhapmoimatkhau.Text != tbxnhaplaimatkhau.Text)
            {
                dxErrorProvider1.SetError(tbxnhaplaimatkhau, "Mật khẩu nhập lại không trủng");
                return;
            }
            formmain f     = (formmain)this.MdiParent;
            int      count = XLBANG.thuc_hien_lenh("Update NHANVIEN set Password='******'" + f.maNV + "'");

            if (count > 0)
            {
                MessageBox.Show("Cập nhật thành công");
            }
            else
            {
                MessageBox.Show("Mật khẩu không hợp lệ");
            }
        }
示例#6
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            errorProvider1.SetError(txtMKCu, "");
            errorProvider1.SetError(txtNhapLaiMK, "");
            if (txtMKCu.Text.Length < 8 || !txtMKCu.Text.Any(char.IsUpper))
            {
                errorProvider1.SetError(txtMKCu, "Mat khau toi thieu 8 ki tu" + "in hoa, in thuong.");
                return;
            }
            if (txtMKCu.Text != txtNhapLaiMK.Text)
            {
                errorProvider1.SetError(txtNhapLaiMK, "Mat khau khong trung!");
                return;
            }
            Form1 f     = (Form1)this.MdiParent;
            int   count = XLBANG.Thuc_hien_lenh("update NHANVIEN set Password='******'where MaNV ='" + f.maNV + "'");

            if (count > 0)
            {
                MessageBox.Show("Cap nhat thanh cong!.");
            }
            else
            {
                MessageBox.Show("Mat khau khong hop le");
            }
        }
示例#7
0
        private void btncapnhat_Click(object sender, EventArgs e)
        {
            errorProvider1.SetError(txbmkmoi, "");
            errorProvider1.SetError(txbnhaplaimk, "");

            if (txbmkmoi.Text.Length < 8 || !txbmkmoi.Text.Any(char.IsDigit) || !txbmkmoi.Text.Any(char.IsLower) || !txbmkmoi.Text.Any(char.IsUpper))
            {
                errorProvider1.SetError(txbmkmoi, "Mật khẩu mới tối thiểu 8 ký tự, gồm chữ số,in hoa và chữ thường.");
                return;
            }
            if (txbmkmoi.Text != txbnhaplaimk.Text)
            {
                errorProvider1.SetError(txbnhaplaimk, "Mật khẩu nhập lại không trùng!!!");
                return;
            }

            frmmain f     = (frmmain)this.MdiParent;
            int     count = XLBANG.Thuc_hien_lenh("Update NHANVIEN set password ='******' where MaNV ='" + f.maNV + "'");

            if (count > 0)
            {
                MessageBox.Show("Cập nhật thành công!!!");
            }
            else
            {
                MessageBox.Show("Mật Khẩu không hợp lệ!!!");
            }
        }
示例#8
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            errorProvider1.SetError(txtPassNew, "");
            errorProvider1.SetError(txtConfirmPass, "");
            //check password new
            if (txtPassNew.Text.Length < 8 || !txtPassNew.Text.Any(char.IsDigit) || !txtPassNew.Text.Any(char.IsLower) || !txtPassNew.Text.Any(char.IsUpper))
            {
                errorProvider1.SetError(txtPassNew, "Mật Khẩu Mới Tối Thiểu 8 Kí Tự, Bao Gồm Cả Chữ Số, " + "In Hoa, In Thường.");
                return;
            }
            //check pasword confirm
            if (txtPassNew.Text != txtConfirmPass.Text)
            {
                errorProvider1.SetError(txtConfirmPass, "Mật Khẩu Nhập Lại Không Trùng!!! Vui Lòng Kiểm Tra Lại!");
                return;
            }

            frmMain f     = (frmMain)this.MdiParent;
            int     count = XLBANG.Thuc_hien_lenh("Update NHANVIEN set Password= '******' where MaNV ='" + f.maNV + " ' ");

            if (count > 0)
            {
                MessageBox.Show("Cập Nhật Mật Khẩu Thành Công!");
            }
            else
            {
                MessageBox.Show("Mật Khẩu Không Hợp Lệ!!! Vui Lòng Kiểm Tra Lại!");
            }
        }