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);

                }

            }

  • 相关阅读:
    简单的三级联动练习
    JavaScript中定时器的暂停和继续
    关于ajax网络请求的封装
    关于JS历史
    KVC中setValuesForKeysWithDictionary:
    collectionView 中cell间距设置建议
    iOS中你必须了解的多线程
    iOS中关于动态Tableview中的cell数据传输的多线程问题解决之拙见
    Touch
    Filemanager 的使用
  • 原文地址:https://www.cnblogs.com/lingr/p/5563569.html
Copyright © 2011-2022 走看看