Example #1
0
        private void fifty_Click(object sender, RoutedEventArgs e)
        {
            int current1 = this.acc.CheckingTotal;
            int current2 = this.acc.SavingsTotal;

            if (current1 - 50 >= 0 && current2 + 50 <= 5000)
            {
                this.acc.CheckingTotal = current1 - 50;
                this.acc.changeBalance("Withdrawal (Transfer from) of 50 $CAD", "Checking");
                this.acc.SavingsTotal = current2 + 50;
                this.acc.changeBalance("Deposit (Transfer to) of 50 $CAD", "Savings");
                Sucess p3 = new Sucess(this.type, this.acc);
                this.NavigationService.Navigate(p3);
            }
            else if (current1 - 50 < 0)
            {
                InsuffFunds p4 = new InsuffFunds(this.type, this.acc);
                this.NavigationService.Navigate(p4);
            }
            else if (current2 + 50 > 5000)
            {
                ExceedLimit p4 = new ExceedLimit(this.type, this.acc);
                this.NavigationService.Navigate(p4);
            }
        }
Example #2
0
        private void Confirm_click(object sender, RoutedEventArgs e)
        {
            int current1 = this.acc.CheckingTotal;
            int current2 = this.acc.SavingsTotal;

            if (current1 - Int32.Parse(textbox_pin.Text) >= 0 && current2 + Int32.Parse(textbox_pin.Text) <= 5000)
            {
                this.acc.CheckingTotal = current1 - Int32.Parse(textbox_pin.Text);
                this.acc.changeBalance("Withdrawal (Transfer from) of " + textbox_pin.Text + "$CAD", "Checking");
                this.acc.SavingsTotal = current2 + Int32.Parse(textbox_pin.Text);
                this.acc.changeBalance("Deposit (Transfer to) of " + textbox_pin.Text + "$CAD", "Savings");
                Sucess p3 = new Sucess(this.type, this.acc);
                this.NavigationService.Navigate(p3);
            }
            else if (current1 - Int32.Parse(textbox_pin.Text) < 0)
            {
                InsuffFunds p4 = new InsuffFunds(this.type, this.acc);
                this.NavigationService.Navigate(p4);
            }
            else if (current2 + Int32.Parse(textbox_pin.Text) > 5000)
            {
                ExceedLimit p4 = new ExceedLimit(this.type, this.acc);
                this.NavigationService.Navigate(p4);
            }

            else if (Int32.Parse(textbox_pin.Text) > 5000)
            {
                ExceedLimit p2 = new ExceedLimit(this.type, this.acc);
                this.NavigationService.Navigate(p2);
            }
        }
Example #3
0
 private void fifty_Click(object sender, RoutedEventArgs e)
 {
     if (this.type.Equals("Checking"))
     {
         int current = this.acc.CheckingTotal;
         if (current - 50 >= 0)
         {
             this.acc.CheckingTotal = current - 50;
             this.acc.changeBalance("Withdrawal of 50 $CAD", this.type);
             Sucess p3 = new Sucess(this.type, this.acc);
             this.NavigationService.Navigate(p3);
         }
         else
         {
             InsuffFunds p4 = new InsuffFunds(this.type, this.acc);
             this.NavigationService.Navigate(p4);
         }
     }
     else if (this.type.Equals("Savings"))
     {
         int current = this.acc.SavingsTotal;
         if (current - 50 >= 0)
         {
             this.acc.SavingsTotal = current - 50;
             this.acc.changeBalance("Withdrawal of 50 $CAD", this.type);
             Sucess p3 = new Sucess(this.type, this.acc);
             this.NavigationService.Navigate(p3);
         }
         else
         {
             InsuffFunds p4 = new InsuffFunds(this.type, this.acc);
             this.NavigationService.Navigate(p4);
         }
     }
 }
Example #4
0
        private void Confirm_click(object sender, RoutedEventArgs e)
        {
            if (this.type.Equals("Checking") && this.acc.CheckingTotal + Int32.Parse(textbox_pin.Text) <= 5000)
            {
                int current = this.acc.CheckingTotal;

                this.acc.CheckingTotal = current + Int32.Parse(textbox_pin.Text);
                this.acc.changeBalance("Deposit of " + textbox_pin.Text + " $CAD", this.type);
                Sucess p3 = new Sucess(this.type, this.acc);
                this.NavigationService.Navigate(p3);
            }

            else if (this.type.Equals("Savings") && this.acc.SavingsTotal + Int32.Parse(textbox_pin.Text) <= 5000)
            {
                int current = this.acc.SavingsTotal;

                this.acc.SavingsTotal = current + Int32.Parse(textbox_pin.Text);
                this.acc.changeBalance("Deposit of " + textbox_pin.Text + " $CAD", this.type);
                Sucess p3 = new Sucess(this.type, this.acc);
                this.NavigationService.Navigate(p3);
            }

            else
            {
                ExceedLimit p2 = new ExceedLimit(this.type, this.acc);
                this.NavigationService.Navigate(p2);
            }
        }
        private void Confirm_click(object sender, RoutedEventArgs e)
        {
            if (this.type.Equals("Checking") && this.acc.CheckingTotal - Int32.Parse(textbox_pin.Text) > 0)
            {
                int current = this.acc.CheckingTotal;

                this.acc.CheckingTotal = current - Int32.Parse(textbox_pin.Text);
                this.acc.changeBalance("Withdrawal of " + textbox_pin.Text + " $CAD", this.type);
                Sucess p3 = new Sucess(this.type, this.acc);
                this.NavigationService.Navigate(p3);
            }

            else if (this.type.Equals("Savings") && this.acc.SavingsTotal - Int32.Parse(textbox_pin.Text) > 0)
            {
                int current = this.acc.SavingsTotal;

                this.acc.SavingsTotal = current - Int32.Parse(textbox_pin.Text);
                this.acc.changeBalance("Withdrawal of " + textbox_pin.Text + " $CAD", this.type);
                Sucess p3 = new Sucess(this.type, this.acc);
                this.NavigationService.Navigate(p3);
            }

            else
            {
                InsuffFunds p2 = new InsuffFunds(this.type, this.acc);
                this.NavigationService.Navigate(p2);
            }
        }
Example #6
0
        private void fifty_Click(object sender, RoutedEventArgs e)
        {
            if (this.type.Equals("Checking"))
            {
                int current = this.acc.CheckingTotal;

                this.acc.CheckingTotal = current + 50;
                this.acc.changeBalance("Deposit of 50 $CAD", this.type);
                Sucess p3 = new Sucess(this.type, this.acc);
                this.NavigationService.Navigate(p3);
            }
            else if (this.type.Equals("Savings"))
            {
                int current = this.acc.SavingsTotal;


                this.acc.SavingsTotal = current + 50;
                this.acc.changeBalance("Deposit of 50 $CAD", this.type);
                Sucess p3 = new Sucess(this.type, this.acc);
                this.NavigationService.Navigate(p3);
            }
        }