可执行程序和代码_第1页
可执行程序和代码_第2页
可执行程序和代码_第3页
可执行程序和代码_第4页
可执行程序和代码_第5页
已阅读5页,还剩24页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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

2、 this.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 Bank

3、ManageSystem(); 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(strsql); C

4、ustomerLogin 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 co = n

5、ew 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.Tables0.Rows) tca

6、rdid = drcardid.ToString(); tpwd = drcardpwd.ToString(); if (tcardid.Equals(cardid) & tpwd.Equals(tpwd) MessageBox.Show(登录成功); this.Hide(); CustomerOperation cop = new CustomerOperation(); cop.Show(); else MessageBox.Show(卡号或密码错误); break; private void button2_Click(object sender, EventArgs e) textBo

7、x1.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 Transform(); tf.Show(); this.Hide(); private void button2_Click(object se

8、nder, 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_Click(object sender, EventArgs e) Amend amend = new Amend(); amend.Show();

9、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 void button1_Click(object sender, EventArgs e) db = new DBManager(); string n

10、ame = select usename from Cardinfo; string usename = 所汇账户的户主姓名为:+db.Alluseb(name)+,确定?; if (MessageBox.Show(usename, 信息, MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) = DialogResult.Yes) string get = select cardid from Cardinfo; string getmoney = update Cardin

11、fo set cardmoney=cardmoney- + this.textBox2.Text + where cardid= +db.Alluseb(get) + ; string savemoney = update Cardinfo set cardmoney=cardmoney+ + this.textBox2.Text + where cardid= + this.textBox1.Text + ; db.Allusea(getmoney); db.Allusea(savemoney); MessageBox.Show(转帐成功); this.textBox1.Clear(); t

12、his.textBox2.Clear(); /访问数据库和修改数据库,主要用于转账 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) if (Convert.ToInt32(this.textBox1.Text) 0) string get = s

13、elect * from Cardinfo; string save = 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 CustomerOperation(); co.Show(); this.Hide(); /* ATM

14、机存款界面窗体设计 */ 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 cardid from Cardinfo; string getmoney = update Cardinfo set cardmoney

15、=cardmoney- + textBox1.Text + where cardid= + db.Alluseb(geta) + ; db.Allusea(getmoney); MessageBox.Show(取款成功); else MessageBox.Show(余额不足); /对于输入金额进行校验 private void button2_Click(object sender, EventArgs e) CustomerOperation co = new CustomerOperation(); co.Show(); this.Hide(); /* ATM机取款界面窗体设计 */ pr

16、ivate void button1_Click(object sender, EventArgs e) db=new DBManager(); string pwd= select cardpwd from Cardinfo; if(db.Alluseb(pwd).Equals(this.textBox3.Text) if(this.textBox1.Text.Equals(this.textBox2.Text) string get = select cardid from Cardinfo; string repwd = update Cardinfo set cardpwd=+this

17、.textBox1.Text+ where cardid=+db.Alluseb(get)+; db.Allusea(repwd); string repwda = update Cardinfo set cardrepwd= + this.textBox1.Text + where cardid= + db.Alluseb(get) + ; db.Allusea(repwda); MessageBox.Show(密码修成功); else MessageBox.Show(密码确认不一致); else MessageBox.Show(原始密码错误); /确认初始密码和修改初始密码是否一致 pri

18、vate 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 cardmoney from Cardinfo where cardid= + d

19、b.Alluseb(get) + ; this.textBox1.Text = db.Alluseb(query); MessageBox.Show(查询成功); /访问数据库,并读取cardmoney中的数据,且写入到textBox控件中 CustomerOperation co = new CustomerOperation(); co.Show(); this.Hide(); /* ATM余额查询界面窗体设计 */ private void button1_Click(object sender, EventArgs e) string name = this.textBox1.Text

20、; 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 = Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(

21、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) + Convert.ToString(rd.Next(0,

22、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 button9_Click(object sender, EventArgs e) this.Hide(); private void button4_Click(object sende

23、r, EventArgs e) string closea= select cardid,cardpwd,usenumber from Cardinfo where cardid=+this.textBox4.Text+ ; if (db.Closeaccount(closea).Equals(this.textBox4.Text + this.textBox12.Text + textBox3.Text) string xh = delete from Cardinfo where cardid=+this.textBox4.Text+; db.Allusea(xh); MessageBox

24、.Show(销户成功); private void button9_Click(object sender, EventArgs e) this.Hide(); private void button6_Click(object sender, EventArgs e) string guashi = select cardlose from Cardinfo where cardid=+this.textBox15.Text+; string closeb = select cardid,cardpwd,usenumber,cardlose from Cardinfo where cardi

25、d= + this.textBox15.Text + ; if (db.Closeaccount(closeb).Equals(this.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.S

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论