惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
NISL@THU
NISL@THU
E
Exploit-DB.com RSS Feed
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
K
Kaspersky official blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
S
Schneier on Security
G
GRAHAM CLULEY
The Hacker News
The Hacker News
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
爱范儿
爱范儿
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
S
Securelist
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Google Online Security Blog
Google Online Security Blog
美团技术团队
F
Fortinet All Blogs
小众软件
小众软件
Recorded Future
Recorded Future
V
Visual Studio Blog
B
Blog RSS Feed
H
Help Net Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
Latest news
Latest news
Spread Privacy
Spread Privacy
H
Heimdal Security Blog

博客园 - chenglingr

C#三层ATM-12.资产查询 C#三层ATM-13.ATM开户 C#三层ATM-11.查看交易信息 C#三层ATM-9.转账功能设计 C#三层ATM-7.挂失 C#三层ATM-8.存款、取款功能设计 C#三层ATM-6.查询账户基本信息 C#三层ATM-5.登陆功能设计 C#三层ATM-4.ATM界面设计 C#三层ATM-3.编写数据库访问类 C#三层ATM-2.编写Model项目实体类 C#三层ATM-1.搭建三层ATM项目框架 C#三层ATM-0.数据表设计 MVC系列15-首页 MVC系列-13.前台文章显示页 MVC系列14-后台我的文章页 MVC系列-12.项目的重新规划 MVC系列-11.两表联合-发表文章 - chenglingr MVC系列-10.用户验证-导航条改造
C#三层ATM-10.改密码
chenglingr · 2016-06-06 · via 博客园 - chenglingr

改密码

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

            }

        }