public void VerifyToViewAccountSavingBalance(double Sab)
        {
            savings = new Savings(18000);
            double bal = savings.Bal;

            savings.AccountNumb();
        }
        public void VerifyToViewAccountWithdrawSAVBalance1(double Savings)
        {
            Savings savings     = new Savings(1000);
            double  RESWithdarw = savings.Bal;

            Assert.AreNotEqual(Savings, RESWithdarw);
        }
Beispiel #3
0
        public double savingsCurrentAmount(Savings savings)
        {
            ObservableCollection <SmallTransactions> collection = DatabaseHandler.getSmallTransactionValues();
            double deposit  = 0.0;
            double withdraw = 0.0;
            String type;

            foreach (SmallTransactions st in collection)
            {
                if (st.Id.Equals(savings.Id))
                {
                    type = st.Type.ToString();
                    if (type.Equals("d"))
                    {
                        deposit += st.Amount;
                    }
                    else if (type.Equals("w"))
                    {
                        withdraw += st.Amount;
                    }
                }
            }

            double balance = (savings.Initial + deposit) - withdraw;

            Debug.WriteLine("Deposit : " + deposit + "Withdraw : " + withdraw);

            return(balance);
        }
 public SavingsAccountTypeController(Maintenance.Model.SavingsAccountTypeModel savingsAccountTypeModel, Maintenance.View.SavingsAccountType savingsAccountType, Savings.SavingsMenu savingsMenu)
 {
     this.savingsAccountTypeModel = savingsAccountTypeModel;
     this.savingsAccountType = savingsAccountType;
     this.savingsAccountType.btnAddEventHandler(this.btnAdd);
     this.savingsAccountType.btnEditEventHandler(this.btnEdit);
     this.savingsAccountType.btnDeleteEventHandler(this.btnDelete);
     this.savingsAccountType.btnSaveEventHandler(this.btnSave);
     this.savingsAccountType.btnCancelEventHandler(this.btnCancel);
     this.savingsAccountType.btnRetrieveEventHandler(this.btnRetrieve);
     this.savingsAccountType.checkArchived_CheckStateChanged(this.checkArchived);
     this.savingsAccountType.accountTypeGrid(this.savingsAccountTypeModel.selectAccountTypes());
     this.savingsAccountType.removeColumns();
     this.savingsAccountType.disableFunction();
     this.savingsAccountType.MdiParent = savingsMenu;
     this.savingsAccountType.Show();
 }
Beispiel #5
0
        public bool ReadAccounts()
        {
            string path = @"c:\Accounts.txt";
            StreamReader sr = new StreamReader(path);
            {
                string str = sr.ReadLine();

                while (str != null)
                {
                    string accounttype ="";
                    string pinnumb = "";
                    string accountnumb = "";
                    string accountbalance = "";

                    accounttype = str.Substring(0, 1);
                    pinnumb = str.Substring(2,4);
                    accountnumb = str.Substring(7,5);
                    accountbalance = str.Substring(13);

                    if (accounttype == "C")
                    {
                        Checking a = new Checking();

                        a.AccountType = accounttype;
                        a.PinNumbers = pinnumb;
                        a.AccountNumber = Double.Parse(accountnumb);
                        a.AccountBalance = Double.Parse(accountbalance);

                        chkacc.AddAccount(a);
                    }

                    if (accounttype == "S")
                    {
                        Savings a = new Savings();
                        a.AccountType = accounttype;
                        a.PinNumbers = pinnumb;
                        a.AccountNumber = Double.Parse(accountnumb);
                        a.AccountBalance = Double.Parse(accountbalance);

                        savacc.AddAccount(a);
                    }

                    if (accounttype == "B")
                    {
                        Bank a = new Bank();
                        a.AccountType = accounttype;
                        a.PinNumbers = pinnumb;
                        a.AccountNumber = Double.Parse(accountnumb);
                        a.AccountBalance = Double.Parse(accountbalance);

                        bnkacc.AddAccount(a);
                    }
                    str = sr.ReadLine();
                }
                sr.Close();
            }
            return true;
        }
 public static Account[] AccountData()
 {
     Person[] p = PersonData();
     Account p1Savings = new Savings(1500.00,p[0],4.0);
     Account p1Checking = new Checking(p[0],2500.00,.50);
     Account p2Savings = new Savings(1000.00,p[1],3.5);
     Account[] a = {p1Savings,p1Checking,p2Savings};
     return a;
 }