Esempio n. 1
0
        private void bt_pwdOK_Click(object sender, EventArgs e)
        {
            MdPubFunc funcs = new MdPubFunc();
            string    pass  = funcs.EnCrypt(tb_pwdOld.Text);
            string    query = "select * from sUser where sUserCode = '" + tb_pwdId.Text + "' and sUserPass = '******'";

            if (funcs.ExcScalar(query, MdDefine.strcon) == null)
            {
                lbl_mess.Text = "Mật khẩu không đúng !!!";
            }
            else
            {
                if (tb_pwdNew.Text != tb_pwdNewR.Text)
                {
                    lbl_mess.Text = "Mật khẩu mới ko giống nhau !!!";
                }
                else
                {
                    pass  = funcs.EnCrypt(tb_pwdNew.Text.ToString());
                    query = "Update sUser Set sUserPass= '******' Where sUserCode='" + tb_pwdId.Text + "'";

                    if (funcs.ExecuteQuery(query, MdDefine.strcon) > 0)
                    {
                        MessageBox.Show("Bạn đã thay đổi thành công !!!");
                    }
                    else
                    {
                        MessageBox.Show("Có lỗi trong quá trình thay đổi!!!");
                    }
                }
            }
        }
Esempio n. 2
0
        private void bt_register_Click(object sender, EventArgs e)
        {
            // string name =  tb_NameRe.Text.ToString();
            string    hasPass = "";
            int       status  = ckb_status.Checked ? 1 : 0;
            MdPubFunc funcs   = new MdPubFunc();

            hasPass = funcs.EnCrypt(tb_PassRe.Text.ToString());
            string qry = "Insert into suser(susercode,suserpass,suserfullname,susercom_code,suserrole_code,suserdept_code,suserposi_code,suseremail,suserphone_extend,suserstatus) Values( '" + tb_id.Text + "','" + hasPass + "','" + tb_NameRe.Text + "','" + tb_company.Text + "','" + tb_role.Text + "','" + tb_dept.Text + "','" + tb_posi.Text + "','" + tb_email.Text + "','" + tb_phone.Text + "','" + status + "')";

            if (funcs.ExecuteQuery(qry, MdDefine.strcon) > 0)
            {
                MessageBox.Show("Bạn đã đăng kí thành công !!!");
            }
            else
            {
                MessageBox.Show("Có lỗi trong quá trình đăng kí !!!");
            }
        }