Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            //判断输入的2次密码是否相同
            string spw1   = textBox1.Text.ToString().Trim();
            string spw2   = textBox2.Text.ToString().Trim();
            string strpwd = "";

            if (spw1 == spw2)
            {
                strpwd = DESHelper.DesEncrypt(textBox1.Text.ToString());
                var au = new ActUser
                {
                    id        = PubFunVar.LoginID.ToInt(),
                    UserID    = PubFunVar.LoginUserID.ToString().Trim(),
                    UserName  = PubFunVar.LoginUserName.ToString().Trim(),
                    PassWords = strpwd.ToString(),
                };
                au.Save();   //保存

                MessageBox.Show("提示:保存完成!");
            }
            else
            {
                MessageBox.Show("提示:输入2次密码不一致!");
                textBox1.Focus();
            }
        }
Exemplo n.º 2
0
        private void toolSave_Click(object sender, EventArgs e)
        {
            //保存
            var    itrue  = Convert.ToInt16(checkBox1.Checked);
            string strpwd = "";

            strpwd = DESHelper.DesEncrypt(textBox5.Text.ToString());
            var au = new ActUser
            {
                id = textBox1.Text.ToInt(),

                UserID   = textBox2.Text.ToString(),
                UserName = textBox3.Text.ToString(),
                Detp     = textBox4.Text.ToString(),
                Pwd      = strpwd.ToString(),
                isStop   = itrue
            };

            au.Save();   //保存

            toolSetTrue(true);
            groupBox2.Text = "";
            groupBox2.Tag  = "";
            IsSaved        = false;
        }
Exemplo n.º 3
0
        private void toolSave_Click(object sender, EventArgs e)
        {
            //保存
            if (textBox2.Text.ToString().Trim() != "admin" || PubFunVar.LoginUserName == "admin")
            {
                var    itrue  = Convert.ToInt16(checkBox1.Checked);
                string strpwd = "";
                strpwd = DESHelper.DesEncrypt(textBox5.Text.ToString());
                var au = new ActUser
                {
                    id = textBox1.Text.ToInt(),

                    UserID    = textBox2.Text.ToString(),
                    UserName  = textBox3.Text.ToString(),
                    Detp      = textBox4.Text.ToString(),
                    PassWords = strpwd.ToString(),
                    isStop    = itrue
                };

                au.Save();   //保存

                toolSetTrue(true);
                groupBox2.Text = "";
                groupBox2.Tag  = "";
                this.IsSaveds  = false;
            }
            else
            {
                //无权修改此用户密码
                MessageBox.Show("无权修改此用户密码!");
                toolSetTrue(true);
                groupBox2.Text = "";
                groupBox2.Tag  = "";
                this.IsSaveds  = false;
            }
        }