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 IniGrid1()
        {
            grid1.Cell(0, 0).Text = "序号";
            grid1.Column(0).Width = 40;

            grid1.Cell(0, 1).Text = "用户ID";
            grid1.Column(1).Width = 50;

            grid1.Cell(0, 2).Text = "用户账号";
            grid1.Column(2).Width = 80;

            grid1.Cell(0, 3).Text = "用户名称";
            grid1.Column(3).Width = 100;

            grid1.Cell(0, 4).Text = "用户部门";
            grid1.Column(4).Width = 100;

            grid1.Cell(0, 5).Text = "用户状态";
            grid1.Column(5).Width = 60;

            var   au = ActUser.FindAll();
            Int32 ir = 1;

            if (au.Count > 0)
            {
                grid1.Rows = ir;

                foreach (ActUser u in au)
                {
                    if (u.isStop == 0)
                    {
                        ir        += 1;
                        grid1.Rows = ir;
                        try
                        {
                            grid1.Cell(ir - 1, 1).Text = u.id.ToString();
                            grid1.Cell(ir - 1, 2).Text = u.UserID.ToString();
                            grid1.Cell(ir - 1, 3).Text = u.UserName.ToString();
                            grid1.Cell(ir - 1, 4).Text = u.Detp.ToString();
                            grid1.Cell(ir - 1, 5).Text = u.isStop.ToString();
                        }
                        catch { }
                    }
                }
            }
        }
Exemplo n.º 4
0
        private void grid1_RowColChange(object Sender, FlexCell.Grid.RowColChangeEventArgs e)
        {
            try
            {
                Int32 uid = 0;
                uid = grid1.Cell(e.Row, 1).Text.ToInt();

                var au = ActUser.Find(ActUser._.id, uid);
                textBox1.Text     = au.id.ToString();
                textBox2.Text     = au.UserID.ToString();
                textBox3.Text     = au.UserName.ToString();
                textBox4.Text     = au.Detp.ToString();
                textBox5.Text     = DESHelper.DesDecrypt(au.Pwd.ToString());
                checkBox1.Checked = au.isStop.ToBoolean();
            }
            catch { }
        }
Exemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            string sUserName = txtUserName.Text.ToString();
            int    ir        = 2;
            var    au        = ActUser.FindByUserName(sUserName);

            grid1.Rows = ir;

            try
            {
                grid1.Cell(ir - 1, 1).Text = au.id.ToString();
                grid1.Cell(ir - 1, 2).Text = au.UserID.ToString();
                grid1.Cell(ir - 1, 3).Text = au.UserName.ToString();
                grid1.Cell(ir - 1, 4).Text = au.Detp.ToString();
                grid1.Cell(ir - 1, 5).Text = au.isStop.ToString();
            }
            catch { }
        }
Exemplo n.º 6
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;
            }
        }