《ATM自助取款机系统java代码(共11页)》由会员分享,可在线阅读,更多相关《ATM自助取款机系统java代码(共11页)(11页珍藏版)》请在金锄头文库上搜索。
1、精选优质文档-倾情为你奉上public void actionPerformed(ActionEvent e) /界面显示控制 String IC_Number=; String password=; String IC_No=; z30.setVisible(false); float leftmoney=0; float moneys=0; float mon=0; float money1=0; float money2=0; if(true) int No_50=0,No_100=0; String strin=select NO_50,NO_100 from ATM where AT
2、M_ID=; ResultSet rsSQLSelect=executeQuery(strin); try if(rsSQLSelect.next() No_50=Integer.parseInt(rsSQLSelect.getString(NO_50); No_100=Integer.parseInt(rsSQLSelect.getString(NO_100); catch(Exception er)System.out.println(查询ATM机信息出错!); if(No_50=0&No_100=0) z1.setVisible(false); t1.setText(对不起,本ATM自动
3、取款机暂停服务!); cl.show(c,1); cl.show(c,1); if(e.getSource()=z1) t3.setText(); text1.setText(); cl.show(c,2); if(e.getSource()=z4|e.getSource()=z6|e.getSource()=z11|e.getSource()=z16|e.getSource()=z18|e.getSource()=z22) closeDBConnection(); cl.show(c,1); if(e.getSource()=z2) closeDBConnection(); System.e
4、xit(0); if(e.getSource()=z3) IC_Number=text1.getText().trim(); if(getname(IC_Number) z5.setVisible(true); pw1.setVisible(true); t4.setVisible(true); pw1.setText(); t5.setText(); cl.show(c,3); else t3.setText(您输入的卡号不存在,请重新输入!); cl.show(c,2); if(e.getSource()=z5) password=pw1.getText().trim(); IC_Numb
5、er=text1.getText().trim(); if(!login(IC_Number,password) t5.setText(您输入的密码错误,请重新输入!); pw1.setText(); n-; cl.show(c,3); else t5.setText(); cl.show(c,4); if(n0) n=2; t5.setText(您已经三次输入错误密码,谢谢您的使用,欢迎下次光临!); z5.setVisible(false); pw1.setVisible(false); t4.setVisible(false); cl.show(c,3); if(e.getSource(
6、)=z7) t33.setText(); cl.show(c,5); if(e.getSource()=z8) /余额查询 DBAccess d=new DBAccess(); String str3=; String stri=; IC_Number=text1.getText().trim(); t29.setText(IC_Number); leftmoney=getmoney(IC_Number); t30.setText(Float.toString(leftmoney); stri=select bank_name from IC,bank where IC.bank_NO=ban
7、k.bank_NO and IC_ID=+IC_Number+; ResultSet rsSQLSelect=d.executeQuery(stri); try if(rsSQLSelect.next() str3=rsSQLSelect.getString(bank_name); /mit(); catch(Exception er) t32.setText(str3); cl.show(c,10); if(e.getSource()=z9) t23.setText(); cl.show(c,9); if(e.getSource()=z10) t28.setText(); cl.show(c
8、,11); if(e.getSource()=z12) DBAccess d=new DBAccess(); IC_Number=text1.getText().trim(); fetchmoney=Integer.parseInt(text2.getText(); if(fetchmoney1000) t9.setText(每次交易金额最大为1000元!); text2.setText(); cl.show(c,6); return ; if(fetchmoney%50!=0) t9.setText(取款金额只能为50的倍数!); text2.setText(); cl.show(c,6);
9、 return ; leftmoney=getmoney(IC_Number); if(fetchmoneyleftmoney) t9.setText(您的余额不足,请重新输入取款金额!); text2.setText(); cl.show(c,6); return ; int No_50=0,No_100=0,x_50=0,x_100=0,mo=0; String str1=select NO_50,NO_100 from ATM where ATM_ID=; ResultSet rsSQLSelect=d.executeQuery(str1); try if(rsSQLSelect.next()