示例#1
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ệ");
            }
        }
示例#2
0
        private void btdangnhap_Click(object sender, EventArgs e)
        {
            tbnhnavien = new XLNHANVIEN();
            var r = tbnhnavien.Select("Username= '******'and Password='******'");

            if (r.Count() > 0)
            {
                formmain f = (formmain)this.MdiParent;
                f.Text = "Quản lý Nhà sách -Chào" + r[0]["TENNV"].ToString();
                f.maNV = r[0]["MaNV"].ToString();
                f.enablecontrol((int)r[0]["MaLTK"]);
                this.Close();
            }
            else
            {
                MessageBox.Show("Sai tên đăng nhập hoặc mật khẩu");
            }
        }