Ejemplo n.º 1
0
 public void NewTransaction()
 {
     if (CashCustomer != null)
     {
         ScreenCoordinator.NavigateToCustomer(CashCustomer);
     }
 }
Ejemplo n.º 2
0
        public void CheckPin()
        {
            Working = true;

            Task.Factory
            .StartNew(() =>
            {
                var pinValid = CustomerService.CheckPin(Customer.Id, Pin);
                if (!pinValid)
                {
                    Execute.OnUIThread(() =>
                    {
                        FailureCount++;

                        lock (Pin)
                        {
                            PinState = IncorrectPinState;
                            Pin      = "";
                        }

                        Working = false;
                    });

                    // Reset text or go home if too many failures...
                    Task.Delay(1000).ContinueWith(t => Execute.OnUIThread(() =>
                    {
                        if (FailureCount < 3)
                        {
                            lock (Pin)
                            {
                                if (Pin.Length == 0)
                                {
                                    PinState = EmptyPinState;
                                }
                            }
                        }
                        else
                        {
                            if (IsActive)
                            {
                                GoHome();
                            }
                        }
                    }));
                }
                else
                {
                    Task.Factory.StartNew(() => CardService.Write(Customer));
                    Execute.OnUIThread(() => ScreenCoordinator.NavigateToCustomer(Customer));
                }
            })
            .ContinueWith(task =>
            {
                if (task.IsFaulted)
                {
                    ScreenCoordinator.HandleFault(task.Exception);
                }
            });
        }
Ejemplo n.º 3
0
 public void NewTransaction(AccountHomeItemViewModel item)
 {
     if (String.IsNullOrEmpty(item.Customer.Pin))
     {
         ScreenCoordinator.NavigateToCustomer(item.Customer);
     }
     else
     {
         ScreenCoordinator.NavigateToPinEntry(item.Customer);
     }
 }
Ejemplo n.º 4
0
 public void Handle(CardInserted message)
 {
     if (IsActive)
     {
         Task.Factory.StartNew(() =>
         {
             var customer = CustomerService.GetCustomerByNumber(message.CardId);
             if (customer != null)
             {
                 Execute.OnUIThread(() => ScreenCoordinator.NavigateToCustomer(customer, true));
             }
         });
     }
 }
Ejemplo n.º 5
0
 public void NewTransaction(HomeItemViewModel item)
 {
     ScreenCoordinator.NavigateToCustomer(item.Customer);
 }