コード例 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtOldPassword.Text.Trim() == "")
            {
                MessageBox.Show("Кв╩С╚внГ├▄┬в!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (txtNewPassword.Text.Trim() != txtNewPassword2.Text.Trim())
            {
                MessageBox.Show("Кв╩С╚в┴й┤╬¤Я═гх─л┬├▄┬в!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            LoginUserManage lum = new LoginUserManage();

            if (!lum.CheckUserPassword(USERID, txtOldPassword.Text))
            {
                MessageBox.Show("├▄┬вляИ─╩Д░▄,Кв╝В▓жМ├╗Д├ч╗Ы├▄┬в╩С╚вН§╚илн!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }

            if (lum.ChangePassword(USERID, txtOldPassword.Text, txtNewPassword.Text))
            {
                MessageBox.Show("├▄┬вляИ─│╔╣д!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("├▄┬вляИ─╩Д░▄,Кв╝В▓жнГ├▄┬в╩Киы╩С╚вН§╚и!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }


            this.Close();
        }
コード例 #2
0
        private void login()
        {
            if (txtUserID.Text.Trim() == "")
            {
                MessageBox.Show("请选择用户名!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (txtPassword.Text.Trim() == "")
            {
                MessageBox.Show("请输入用户密码!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (lum.IsEnable(txtUserID.Text.Trim()) == false)
            {
                if (lum.CheckUserPassword(txtUserID.Text.Trim(), txtPassword.Text))
                {
                    SysParams.UserID   = txtUserID.Text.Trim();
                    SysParams.UserName = lum.GetLoginUserName(txtUserID.Text.Trim());

                    //将本次登陆的用户名与项目名称存起来
                    WriteLoginUnitXML();
                    //this.DialogResult = DialogResult.OK;
                    this.Visible = false;

                    //写日志
                    SysLog.AddOperateLog(SysParams.UserName, "系统登陆", "", SysParams.UserName + "用户进入系统");


                    frmErpMain frmErpMain = new frmErpMain();
                    frmErpMain.ShowDialog();
                }
                else
                {
                    MessageBox.Show("你输入的用户账号或用户密码有错误,请重输!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return;
                }
            }
            else
            {
                MessageBox.Show("此用户已禁用,无法登陆系统!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
        }
コード例 #3
0
        private void login()
        {
            if (cboUserID.Text.Trim() == "")
            {
                MessageBox.Show("请选择用户名!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (txtPassword.Text.Trim() == "")
            {
                MessageBox.Show("请输入用户密码!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }


            LoginUserManage lum = new LoginUserManage();

            if (lum.CheckUserPassword(((ListItem)cboUserID.SelectedItem).Value, txtPassword.Text))
            {
                SysParams.UserID   = ((ListItem)cboUserID.SelectedItem).Value;
                SysParams.UserName = ((ListItem)cboUserID.SelectedItem).Text;

                //将本次登陆的用户名与项目名称存起来
                WriteLoginUnitXML();
                //this.DialogResult = DialogResult.OK;
                this.Visible = false;

                frmStorageMain frmStorageMain = new frmStorageMain();
                frmStorageMain.ShowDialog();
            }
            else
            {
                MessageBox.Show("你输入的用户账号或用户密码有错误,请重输!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
        }