




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、 . ATM系统源代码与可执行程序一、 模块总体设计:欢迎模块;登录模块;系统模块;窗体 控件模块;二、代码与可执行程序 private void label4_Click(object sender, EventArgs e) Adminform adminform = new Adminform(); adminform.Show(); this.Hide(); private void label4_Click(object sender, EventArgs e) Adminform adminform = new Adminform(); adminform.Show(); this
2、.Hide(); private void 退出ToolStripMenuItem_Click_1(object sender, EventArgs e) Application.Exit(); /*欢迎模块*/ Login login = new Login(); login.Show(); CustomerLogin customerLogin = new CustomerLogin(); customerLogin.Show(); /打开新的CustomerLogin窗体,对人工服务登录. BankManageSystem bankManageSystem = new BankManag
3、eSystem(); bankManageSystem.Show(); About about = new About(); about.Show(); LianXi lianxi = new LianXi(); lianxi.Show(); Application.Exit(); /* 操作界面窗体设计 */ string strsql = "Data Source=WIN-KOBGNACPI2KSQLEXPRESS;Initial Catalog=Bank;Integrated Security=True" sqlcon = new SqlConnection(strs
4、ql); CustomerLogin cl = new CustomerLogin(); cl.Show(); this.Hide(); /打开CustomerLogin窗体,并关闭Login窗体。 BankManageSystem bms = new BankManageSystem(); bms.Show(); this.Hide(); /* 连接数据库 */ private void button1_Click(object sender, EventArgs e) /db.Clogin(textBox1.Text, textBox2.Text); /CustomerOperatiom
5、co = new CustomerOperatiom(); /co.Show(); /this.Hide(); db = new DBManager(); string strsql="select * from Cardinfo" sqlds = db.seldemo(strsql); string cardid = this.textBox1.Text; string cardpwd = this.textBox2.Text; string tcardid = null; string tpwd = null; foreach (DataRow dr in sqlds.
6、Tables0.Rows) tcardid = dr"cardid".ToString(); tpwd = dr"cardpwd".ToString(); if (tcardid.Equals(cardid) && tpwd.Equals(tpwd) MessageBox.Show("登录成功"); this.Hide(); CustomerOperation cop = new CustomerOperation(); cop.Show(); else MessageBox.Show("卡号或密码错误&qu
7、ot;); break; private void button2_Click(object sender, EventArgs e) textBox1.Clear(); textBox2.Clear(); textBox1.Focus(); /清除textBox文本框中的数据 private void button3_Click(object sender, EventArgs e) this.Close(); /* ATM登录界面窗体设计 */ private void button1_Click(object sender, EventArgs e) Transform tf = new
8、 Transform(); tf.Show(); this.Hide(); private void button2_Click(object sender, EventArgs e) Save save = new Save(); save.Show(); this.Hide(); /打开新Save窗体,并关闭CustomerOperation窗体 private void button3_Click(object sender, EventArgs e) Get get = new Get(); get.Show(); this.Hide(); private void button5_C
9、lick(object sender, EventArgs e) Amend amend = new Amend(); amend.Show(); this.Hide(); /修改密码 private void button4_Click(object sender, EventArgs e) Query query = new Query(); query.Show(); this.Hide(); private void button6_Click(object sender, EventArgs e) this.Hide(); /* ATM机操作界面窗体设计 */ private voi
10、d button1_Click(object sender, EventArgs e) db = new DBManager(); string name = "select usename from Cardinfo" string usename = "所汇账户的户主为:"+db.Alluseb(name)+",确定?" if (MessageBox.Show(usename, "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageB
11、oxDefaultButton.Button1) = DialogResult.Yes) string get = "select cardid from Cardinfo" string getmoney = "update Cardinfo set cardmoney=cardmoney-'" + this.textBox2.Text + "' where cardid='" +db.Alluseb(get) + "'" string savemoney = "upda
12、te Cardinfo set cardmoney=cardmoney+'" + this.textBox2.Text + "'where cardid='" + this.textBox1.Text + "'" db.Allusea(getmoney); db.Allusea(savemoney); MessageBox.Show("转帐成功"); this.textBox1.Clear(); this.textBox2.Clear(); /访问数据库和修改数据库,主要用于转账 privat
13、e void button2_Click(object sender, EventArgs e) CustomerOperation co = new CustomerOperation(); co.Show(); this.Hide(); /* ATM机转账界面窗体设计 */ private void button1_Click(object sender, EventArgs e) if (Convert.ToInt32(this.textBox1.Text) > 0) string get = "select * from Cardinfo" string sa
14、ve = "update Cardinfo set cardmoney=cardmoney+'"+this.textBox1.Text+"'where cardid='"+db.Alluseb(get)+"'" db.Allusea(save); MessageBox.Show("存款成功"); this.textBox1.Clear(); else MessageBox.Show("存款不能为负"); CustomerOperation co = new Cus
15、tomerOperation(); co.Show(); this.Hide(); /* ATM机存款界面窗体设计 */ private void button1_Click(object sender, EventArgs e) db = new DBManager(); string get = "select cardmoney from Cardinfo" if (Convert.ToInt32(this.textBox1.Text) <=Convert.ToDecimal(db.Alluseb(get) string geta = "select
16、cardid from Cardinfo" string getmoney = "update Cardinfo set cardmoney=cardmoney-'" + textBox1.Text + "' where cardid='" + db.Alluseb(geta) + "'" db.Allusea(getmoney); MessageBox.Show("取款成功"); else MessageBox.Show("余额不足"); /对于输入金
17、额进行校验 private void button2_Click(object sender, EventArgs e) CustomerOperation co = new CustomerOperation(); co.Show(); this.Hide(); /* ATM机取款界面窗体设计 */ private void button1_Click(object sender, EventArgs e) db=new DBManager(); string pwd= "select cardpwd from Cardinfo" if(db.Alluseb(pwd).E
18、quals(this.textBox3.Text) if(this.textBox1.Text.Equals(this.textBox2.Text) string get = "select cardid from Cardinfo" string repwd = "update Cardinfo set cardpwd='"+this.textBox1.Text+"' where cardid='"+db.Alluseb(get)+"'" db.Allusea(repwd); st
19、ring repwda = "update Cardinfo set cardrepwd='" + this.textBox1.Text + "' where cardid='" + db.Alluseb(get) + "'" db.Allusea(repwda); MessageBox.Show("密码修成功"); else MessageBox.Show("密码确认不一致"); else MessageBox.Show("原始密码错误");
20、 /确认初始密码和修改初始密码是否一致 private void button2_Click(object sender, EventArgs e) CustomerOperation co = new CustomerOperation(); co.Show(); this.Hide(); /* ATM机修改密码界面窗体设计 */ private void button2_Click(object sender, EventArgs e) string get = "select * from Cardinfo" string query = "select c
21、ardmoney from Cardinfo where cardid='" + db.Alluseb(get) + "'" this.textBox1.Text = db.Alluseb(query); MessageBox.Show("查询成功"); /访问数据库,并读取cardmoney中的数据,且写入到textBox控件中 CustomerOperation co = new CustomerOperation(); co.Show(); this.Hide(); /* ATM余额查询界面窗体设计 */ private
22、void button1_Click(object sender, EventArgs e) string name = this.textBox1.Text; string number = this.textBox2.Text; string pwd = this.textBox10.Text; string repwd = this.textBox9.Text; string money = this.textBox11.Text; string lose = "" Random rd = new Random(); string cardid; cardid = C
23、onvert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Conv
24、ert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9); db.openaccount(cardid,name,number,pwd,repwd,money,lose); private void butt
25、on9_Click(object sender, EventArgs e) this.Hide(); private void button4_Click(object sender, EventArgs e) string closea= "select cardid,cardpwd,usenumber from Cardinfo where cardid='"+this.textBox4.Text+"' " if (db.Closeaccount(closea).Equals(this.textBox4.Text + this.tex
26、tBox12.Text + textBox3.Text) string xh = "delete from Cardinfo where cardid='"+this.textBox4.Text+"'" db.Allusea(xh); MessageBox.Show("销户成功"); private void button9_Click(object sender, EventArgs e) this.Hide(); private void button6_Click(object sender, EventArgs
27、 e) string guashi = "select cardlose from Cardinfo where cardid='"+this.textBox15.Text+"'" string closeb = "select cardid,cardpwd,usenumber,cardlose from Cardinfo where cardid='" + this.textBox15.Text + "' " if (db.Closeaccount(closeb).Equals(t
28、his.textBox15.Text + this.textBox13.Text + textBox5.Text) string str = db.Allusebb(closeb).ToString(); if (str.Equals("") string gua = "update Cardinfo set cardlose='已挂失' where cardid='" + this.textBox15.Text + "'" db.Allusea(gua); MessageBox.Show("成功挂失"); else MessageBox.Show("该卡已挂失"); else MessageBox.Show(&quo
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 企业如何利用区块链实现内部数据的高效共享
- 2025年中国抽屉柜式展架市场调查研究报告
- 2025年中国手腕带测试仪数据监测报告
- 2025年中国微型试验室用捏合机数据监测报告
- 打造高效的2024年纺织机械操作证书考试复习计划试题及答案
- 2025年中国强胶粉数据监测研究报告
- 发挥积极能量2024年纺织机械操作证书考试试题及答案
- 2025年中国府绸斜纹布数据监测研究报告
- 划分重点目标把握2024年CAD 工程师认证考试的内容与时机试题及答案
- 深入探讨商务礼仪师考试的前沿动态与职业发展机会试题及答案
- 《鸿门宴》公开课一等奖创新教学设计 统编版高中语文必修下册
- DZ∕T 0202-2020 矿产地质勘查规范 铝土矿(正式版)
- 二年级三位数加减法竖式计算
- 安全生产投入台账(模板)
- 清华大学领军计划语文试题强基计划
- 医疗欠款欠条范本
- 母亲节健康科普知识
- 《奥尔夫音乐教学法》课程标准
- 茶叶产品报价函
- 膀胱结石护理课件
- 生产工艺验证方案(药品)
评论
0/150
提交评论