package com.ATM;
public class panduan {
int AccountID ;
Account account = new Account();
CardAccount ca1 = new PostalsavingsBank();
CardAccount ca2 = new MerchantsBank();
CardAccount ca3 = new ChinaBank();
UserAccount U = new UserAccount();
public void panduan1(){
System.out.println("******************");
System.out.println("请选择项目服务序号");
System.out.println("1.查询余额");
System.out.println("2.取款服务");
System.out.println("3.存款服务");
System.out.println("4.退出服务");
System.out.println("******************");
}
public void CardNamepanduan(int AccountID){
this.AccountID = AccountID;
Integer in = new Integer(AccountID);
String str = in.toString();
char[] a= new char[4];
a[0]=str.charAt(0);
System.out.println("888888");
if(a[0]=='1'){
ca1.getCardName();
}else{
if(a[0]=='2'){
ca2.getCardName();
}else{
if(a[0]=='3'){
ca3.getCardName();
}
}
}
}
public void getMoneypanduan(int a){
if(a<=0){
try{
throw new Exception("请输入正确的钱数");
}catch(Exception e ){
System.out.println(e.getMessage());
}
}else{
if(account.searchMoney1()>2000){
if(a>2000&&a<account.searchMoney1()){
try{
throw new Exception("您输入的金额超出了一次取款最大金额,请重新输入");
}catch(Exception e){
System.out.println(e.getMessage());
}
}else{
if(a>account.searchMoney1()){
try{
throw new Exception("超出了您的存款余额,请重新输入");
}catch(Exception e){
System.out.println(e.getMessage());
}
}else{
if(a%100!=0){
try{
throw new Exception("本机只提供100元纸钞,请重新输入合适的钱数");
}catch(Exception e){
System.out.println(e.getMessage());
}
}else{
account.getMoney(a);
}
}
}
}else{
if(a>account.searchMoney1()&&a<2000){
try{
throw new Exception("超出了您的存款余额,请重新输入");
}catch(Exception e){
}
}else{
if(a>2000){
try{
throw new Exception("您输入的金额超出了一次取款最大金额,请重新输入");
}catch(Exception e){
System.out.println(e.getMessage());
}
}else{
if(a%100!=0){
try{
throw new Exception("本机只提供100元纸钞,请重新输入合适的钱数");
}catch(Exception e){
System.out.println(e.getMessage());
}
}else{
account.getMoney(a);
}
}
}
}
}
}
public void putMoneypanduan(int a){
if(a<=0){
try{
throw new Exception("请输入正确的钱数");
}catch(Exception e ){
System.out.println(e.getMessage());
}
}else{
account.putMoney(a);
}
}
}