Exemplo n.º 1
0
        public CustomerProfile()
        {
            AccountInterface account1 = new AccountInterface(100.00m, 123456, (int)AccountType.CHECKING, "my_user",
                                                             "Checking Account", (decimal)0.00, DateTime.Now);

            this.accounts.Add(account1);
        }
Exemplo n.º 2
0
        public AccountInterface getAccount(int account_number, string customer)
        {
            AccountInterface account = null;

            this.dbcmd.CommandText = "select * from customer_acct where acct_id=@act";
            this.dbcmd.Parameters.AddWithValue("act", account_number);
            var balance_reader = this.dbcmd.ExecuteReader();

            while (balance_reader.Read())
            {
                var balance  = Convert.ToDecimal(balance_reader["balance"]);
                var number   = Convert.ToInt32(account_number);
                var type     = Convert.ToInt32(balance_reader["type"]);
                var name     = balance_reader["name"].ToString();
                var interest = Convert.ToDecimal(balance_reader["interest"]);
                var date     = DateTime.Parse(balance_reader["created"].ToString());
                account = new AccountInterface(balance, number, type, customer, name, interest, date);
            }
            balance_reader.Close();
            return(account);
        }
Exemplo n.º 3
0
        public void addAccount(decimal amount, long number, int type, string username, string name, decimal interest)
        {
            AccountInterface account = new AccountInterface(amount, number, type, username, name, interest, DateTime.Now);

            this.accounts.Add(account);
        }