Пример #1
0
        /// <summary>
        /// Updates the branch of a regular account
        /// </summary>
        /// <param name="accountNumber">Contains the account number of the account.</param>
        /// <returns>Determines whether the branch is updated or not.</returns>
        public override bool UpdateBranchDAL(RegularAccount updateAccount)
        {
            bool AccountBranchUpdated = false;


            return(AccountBranchUpdated);
        }
Пример #2
0
        public Form1()
        {
            accounts = new List <Account>();
            klanten  = new List <Klant>();
            if (account == null)
            {
                Account acdcount = new RegularAccount("TEST-ACCOUNT", 1000.50d, DateTime.Now, 0.2d, new Klant("Test", "Von Tester"), new List <string> {
                    "TEST-CARD-0", "TEST-CARD-1"
                });
                this.account = acdcount;
            }


            Klant klant1 = new Klant("Mike", "Dhoore");

            klanten.Add(klant1);
            Klant klant2 = new Klant("Mikea", "Dhoore");

            klanten.Add(klant2);
            Klant klant3 = new Klant("Mikeb", "Dhoore");

            klanten.Add(klant3);
            Klant klant4 = new Klant("Mikec", "Dhoore");

            klanten.Add(klant4);

            InitializeComponent();
            makeLabels();
        }
Пример #3
0
        /// <summary>
        /// Updates the account type from savings to current or vice-versa
        /// </summary>
        /// <param name="accountNumber">Contains the account number of the account.</param>
        /// <param name="accountType">Contains the new account type of the account.</param>
        /// <returns>Determines whether the account type is updated or not.</returns>
        public override bool UpdateAccountTypeDAL(RegularAccount updateAccount)
        {
            bool AccountTypeUpdated = false;


            return(AccountTypeUpdated);
        }
Пример #4
0
        static void Main(string[] args)
        {
            XDocument doc = XDocument.Load(FILENAME);

            foreach (XElement client in doc.Descendants("client"))
            {
                Client newClient = new Client();
                Client.clients.Add(newClient);
                newClient.name = (string)client.Element("name");
                newClient.ssid = (string)client.Element("ssid");
                newClient.pswd = (string)client.Element("pswd");
                List <XElement> xAccounts = client.Elements().Where(x => (x.Name.LocalName == "savingsAcc") || (x.Name.LocalName == "regularAcc")).ToList();
                foreach (XElement xAccount in xAccounts)
                {
                    Account newAccount = null;
                    switch (xAccount.Name.LocalName)
                    {
                    case "savingsAcc":
                        newAccount = new SavingsAccount();
                        break;

                    case "regularAcc":
                        newAccount = new RegularAccount();
                        break;
                    }
                    newClient.accounts.Add(newAccount);
                    newAccount.name          = (string)xAccount.Element("name");
                    newAccount.accountNumber = (string)xAccount.Element("accountNumber");
                    newAccount.balance       = (decimal)xAccount.Element("balance");
                }
            }
        }
Пример #5
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         Account newAccount;
         if (radioButton1.Checked)
         {
             newAccount = new RegularAccount(textBox1.Text, 0d, DateTime.Now, 0.2d, (Klant)comboBox1.SelectedItem, listBox1.Items.Cast <string>().ToList());
             form1.accounts.Add(newAccount);
             form1.account = newAccount;
         }
         else if (radioButton2.Checked)
         {
             newAccount = new SavingsAccount(textBox1.Text, 0d, DateTime.Now, 0.5d, (Klant)comboBox1.SelectedItem, 1.5d);
             form1.accounts.Add(newAccount);
             form1.account = newAccount;
         }
         form1.makeLabels();
         this.Close();
     }
     catch (Exception ex)
     {
         label2.Text = "Fout";
     }
 }
        public void DepositTest()
        {
            var regularAccount = new RegularAccount(600);

            regularAccount.Deposit(50);
            Assert.Equal(650, regularAccount.getBalance());

            regularAccount.setBalance(600);
            regularAccount.Deposit(0);
            Assert.Equal(600, regularAccount.getBalance());
        }
Пример #7
0
        /// <summary>
        /// Adds new account to Regular Accounts collection.
        /// </summary>
        /// <param name="newAccount">Contains the account details to be added.</param>
        /// <returns>Determinates whether the new account is added.</returns>
        public override bool CreateAccountDAL(RegularAccount newAccount)
        {
            using (TeamEEntities db = new TeamEEntities())
            {
                ObjectResult <CreateRegularAccount_Result> CreateRegularAccount = db.CreateRegularAccount(newAccount.CustomerID, newAccount.AccountType, newAccount.Branch, newAccount.MinimumBalance, newAccount.InterestRate);
                var result = CreateRegularAccount.FirstOrDefault();

                int v = result.Column1;
                newAccount.AccountNo = result.Column2;
            }

            return(true);
        }
        public void AddInterestTest()
        {
            var regularAccount = new RegularAccount(1000);

            regularAccount.AddInterest();
            Assert.Equal(1000.416, regularAccount.getBalance(), 3);

            regularAccount.setBalance(150);
            regularAccount.AddInterest();
            Assert.Equal(150, regularAccount.getBalance());

            regularAccount.setBalance(10000);
            regularAccount.AddInterest();
            Assert.Equal(10008.333, regularAccount.getBalance(), 2);
        }
        public void WithdrawalTest()
        {
            var regularAccount = new RegularAccount(600);

            regularAccount.Withdrawal(599);
            Assert.Equal(1, regularAccount.getBalance());

            regularAccount.setBalance(600);
            regularAccount.Withdrawal(600);
            Assert.Equal(0, regularAccount.getBalance());

            regularAccount.setBalance(600);
            regularAccount.Withdrawal(601);
            Assert.Equal(-36, regularAccount.getBalance());

            regularAccount.setBalance(-1);
            regularAccount.Withdrawal(1);
            Assert.Equal(-1, regularAccount.getBalance());
        }