可执行程序和代码

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

河南经贸职业学院1ATM系统源代码与可执行程序一、模块总体设计:欢迎模块;登录模块;系统模块;窗体控件模块;二、代码与可执行程序privatevoidlabel4_Click(objectsender,EventArgse){Adminformadminform=newAdminform();adminform.Show();this.Hide();}privatevoidlabel4_Click(objectsender,EventArgse){河南经贸职业学院2Adminformadminform=newAdminform();adminform.Show();this.Hide();}privatevoid退出ToolStripMenuItem_Click_1(objectsender,EventArgse){Application.Exit();}//*欢迎模块*/Loginlogin=newLogin();login.Show();河南经贸职业学院3CustomerLogincustomerLogin=newCustomerLogin();customerLogin.Show();//打开新的CustomerLogin窗体,对人工服务登录.BankManageSystembankManageSystem=newBankManageSystem();bankManageSystem.Show();Aboutabout=newAbout();about.Show();LianXilianxi=newLianXi();lianxi.Show();Application.Exit();//*操作界面窗体设计*/stringstrsql=@Data河南经贸职业学院4Source=WIN-KOBGNACPI2K\SQLEXPRESS;InitialCatalog=Bank;IntegratedSecurity=True;sqlcon=newSqlConnection(strsql);CustomerLogincl=newCustomerLogin();cl.Show();this.Hide();//打开CustomerLogin窗体,并关闭Login窗体。BankManageSystembms=newBankManageSystem();bms.Show();this.Hide();//*连接数据库*/privatevoidbutton1_Click(objectsender,EventArgse){河南经贸职业学院5//db.Clogin(textBox1.Text,textBox2.Text);//CustomerOperatiomco=newCustomerOperatiom();//co.Show();//this.Hide();db=newDBManager();stringstrsql=select*fromCardinfo;sqlds=db.seldemo(strsql);stringcardid=this.textBox1.Text;stringcardpwd=this.textBox2.Text;stringtcardid=null;stringtpwd=null;foreach(DataRowdrinsqlds.Tables[0].Rows){河南经贸职业学院6tcardid=dr[cardid].ToString();tpwd=dr[cardpwd].ToString();if(tcardid.Equals(cardid)&&tpwd.Equals(tpwd)){MessageBox.Show(登录成功);this.Hide();CustomerOperationcop=newCustomerOperation();cop.Show();}else{MessageBox.Show(卡号或密码错误);河南经贸职业学院7break;}}privatevoidbutton2_Click(objectsender,EventArgse){textBox1.Clear();textBox2.Clear();textBox1.Focus();}//清除textBox文本框中的数据privatevoidbutton3_Click(objectsender,EventArgse){this.Close();//*ATM登录界面窗体设计*/}河南经贸职业学院8privatevoidbutton1_Click(objectsender,EventArgse){Transformtf=newTransform();tf.Show();this.Hide();}privatevoidbutton2_Click(objectsender,EventArgse){Savesave=newSave();save.Show();this.Hide();}//打开新Save窗体,并关闭CustomerOperation窗体河南经贸职业学院9privatevoidbutton3_Click(objectsender,EventArgse){Getget=newGet();get.Show();this.Hide();}privatevoidbutton5_Click(objectsender,EventArgse){Amendamend=newAmend();amend.Show();this.Hide();}//修改密码河南经贸职业学院10privatevoidbutton4_Click(objectsender,EventArgse){Queryquery=newQuery();query.Show();this.Hide();}privatevoidbutton6_Click(objectsender,EventArgse){this.Hide();}//*ATM机操作界面窗体设计*/privatevoidbutton1_Click(objectsender,EventArgse){db=newDBManager();河南经贸职业学院11stringname=selectusenamefromCardinfo;stringusename=所汇账户的户主姓名为:+db.Alluseb(name)+,确定?;if(MessageBox.Show(usename,信息,MessageBoxButtons.YesNo,MessageBoxIcon.Information,MessageBoxDefaultButton.Button1)==DialogResult.Yes){stringget=selectcardidfromCardinfo;stringgetmoney=updateCardinfosetcardmoney=cardmoney-'+this.textBox2.Text+'wherecardid='+db.Alluseb(get)+';stringsavemoney=updateCardinfosetcardmoney=cardmoney+'+this.textBox2.Text+'wherecardid='+河南经贸职业学院12this.textBox1.Text+';db.Allusea(getmoney);db.Allusea(savemoney);MessageBox.Show(转帐成功);this.textBox1.Clear();this.textBox2.Clear();}}//访问数据库和修改数据库,主要用于转账privatevoidbutton2_Click(objectsender,EventArgse){CustomerOperationco=newCustomerOperation();co.Show();this.Hide();河南经贸职业学院13}//*ATM机转账界面窗体设计*/privatevoidbutton1_Click(objectsender,EventArgse){if(Convert.ToInt32(this.textBox1.Text)0){stringget=select*fromCardinfo;stringsave=updateCardinfosetcardmoney=cardmoney+'+this.textBox1.Text+'wherecardid='+db.Alluseb(get)+';db.Allusea(save);MessageBox.Show(存款成功);this.textBox1.Clear();河南经贸职业学院14}else{MessageBox.Show(存款不能为负);}}CustomerOperationco=newCustomerOperation();co.Show();this.Hide();//*ATM机存款界面窗体设计*/privatevoidbutton1_Click(objectsender,EventArgse){db=newDBManager();河南经贸职业学院15stringget=selectcardmoneyfromCardinfo;if(Convert.ToInt32(this.textBox1.Text)=Convert.ToDecimal(db.Alluseb(get))){stringgeta=selectcardidfromCardinfo;stringgetmoney=updateCardinfosetcardmoney=cardmoney-'+textBox1.Text+'wherecardid='+db.Alluseb(geta)+';db.Allusea(getmoney);MessageBox.Show(取款成功);}else{河南经贸职业学院16MessageBox.Show(余额不足);}}//对于输入金额进行校验privatevoidbutton2_Click(objectsender,EventArgse){CustomerOperationco=newCustomerOperation();co.Show();this.Hide();}//*ATM机取款界面窗体设计*/privatevoidbutton1_Click(objectsender,EventArgse){河南经贸职业学院17db=newDBManager();stringpwd=selectcardpwdfromCardinfo;if(db.Alluseb(pwd).Equals(this.textBox3.Text)){if(this.textBox1.Text.Equals(this.textBox2.Text)){stringget=selectcardidfromCardinfo;stringrepwd=updateCardinfosetcardpwd='+this.textBox1.Text+'wherecardid='+db.Alluseb(get)+';db.Allusea(repwd);stringrepwda=updateCardinfosetcardrepwd='+this.textBox1.Text+'wherecardid='+db.Alluseb(get)+';db.Allusea(repwda);河南经贸职业学院18MessageBox.Show(密码修成功);}else{MessageBox.Show(密码确认不一致);}}else{MessageBox.Show(原始密码错误);}}//确认初始密码和修改初始密码是否一致privatevoidbutton2_Click(objectsender,EventArgse)河南经贸职业学院19{CustomerOperationco=newCustomerOperation();co.Show();this.Hide();}//*ATM机修

1 / 29
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功