zoukankan      html  css  js  c++  java
  • C#三层ATM-10.改密码

    改密码

    1. dal cardinfo changePwd

    public bool changePwd(string CardID, string oldPwd, string newPwd)

            {

    string sql = "update  cardinfo set  pass='"+ newPwd + "' where cardID='" + CardID + "' and pass='"+oldPwd+ "'  and IsReportLoss=0";

    int n = DbHelperSQL.ExecuteSql(sql);

    if (n >= 1)

                {

    return true;

                }

    else

                { return false; }

            }

    2. bll- cardinfo changePwd

    public bool changePwd(string CardID, string oldPwd, string newPwd)

            {

    return dal.changePwd(CardID, oldPwd,newPwd);

            }

    3. winf- ChangePWD

    !)增加卡号字段

    public string CardID;

    2)编写按钮点击事件

    private void button1_Click(object sender, EventArgs e)

            {

                label4.Text = "";

    if (textBox2.Text != textBox3.Text)

                { label4.Text = "两次新密码不一致,请重输!"; }

    else

                {

                    BLL.cardinfo bll = new BLL.cardinfo();

    bool isOK=  bll.changePwd(CardID, textBox1.Text, textBox3.Text);

    if (isOK) {

    MessageBox.Show("密码修改成功,请重新登录!","成功");

    this.DialogResult = DialogResult.OK;

                    }

    else { label4.Text = "密码修改失败,请重试!"; }

                }

            }

    4. winf-main-菜单

    private void 改密码ToolStripMenuItem_Click(object sender, EventArgs e)

            {

    ChangePWD cp = new ChangePWD();

                cp.CardID = CardID;

    DialogResult OK=cp.ShowDialog();

    if (OK == DialogResult.OK) {

                    退出账户toolStripMenuItem_Click(null, null);

                }

            }

  • 相关阅读:
    高计数率下的梯形成形算法的计数率矫正
    梯形成形算法
    就业还是和一起创业?
    努力,还是会前进,世界一定是越来越好。
    一日黑客,SQL注入
    钱,money,人生
    一些技术生词记录
    江苏省计算机C语言考试记录
    NVIDIA显卡设置
    大二寒假 之 丢失的13天
  • 原文地址:https://www.cnblogs.com/lingr/p/5563569.html
Copyright © 2011-2022 走看看