Ejemplo n.º 1
0
 public void build(BankWindowCreator creator, int number, OperationManager manager)
 {
     bankWindow = creator.createWindow(number, manager);
     List<IOperation> operations = bankWindow.getProcessOperation();
     for (int i = 0; i < operations.Count; i++)
     {
         switch (operations[i].getNumberOperation())
         {
             case Credit.CREDIT: operations[i].setNameOperation("Credits"); break;
             case Deposit.DEPOSIT: operations[i].setNameOperation("Deposits"); break;
             case Card.CARD: operations[i].setNameOperation("Cards"); break;
             case Transfer.TRANSFER: operations[i].setNameOperation("Transfers"); break;
             case Payment.PAYMENT: operations[i].setNameOperation("Payments"); break;
         }
     }
     bankWindow.setBuilder(new EngBuilder());
 }
Ejemplo n.º 2
0
 public BankWindow(BankWindow bw)
 {
     this.number = bw.number;
     this.processOperation = new List<IOperation>();
     List<IOperation> oper = bw.getProcessOperation();
     for (int k = 0; k < oper.Count; k++)
     {
         this.addOperation(oper[k]);
     }
     if(bw.getClient() != null)
         this.client = new Client(bw.client);
     if (bw.getCurrentOperation() != null)
     {
         switch (bw.currentOperation.getNumberOperation())
         {
             case Credit.CREDIT: this.currentOperation = new Credit(); break;
             case Deposit.DEPOSIT: this.currentOperation = new Deposit(); break;
             case Card.CARD: this.currentOperation = new Card(); break;
             case Transfer.TRANSFER: this.currentOperation = new Transfer(); break;
             case Payment.PAYMENT: this.currentOperation = new Payment(); break;
         }
         this.currentOperation.setTimeOperation(bw.currentOperation.getTimeOperation());
     }
     this.manager = new OperationManager(bw.manager);
     if(bw.state.GetType() == typeof(BankWindowBusyState))
     {
         this.state = new BankWindowBusyState();
     }
     else
         if (bw.state.GetType() == typeof(BankWindowFreeState))
         {
             this.state = new BankWindowFreeState();
         }
         else
             if (bw.state.GetType() == typeof(BankWindowBreakState))
             {
                 this.state = new BankWindowBreakState();
             }
     this.isBreak = bw.isBreak;
     this.countAllOperations = bw.countAllOperations;
     this.countCredits = bw.countCredits;
     this.countDeposits = bw.countDeposits;
     this.countCards = bw.countCards;
     this.countTransfers = bw.countTransfers;
     this.countPayments = bw.countPayments;
 }