Пример #1
0
        private int[] accounts;                           // contains an int[] of existing account numbers by reading the directory
        // Main constructor
        public Bank()
        {
            this.users = fe.getFileContents("login.txt");
            OperatingSystem os  = Environment.OSVersion;
            PlatformID      pid = os.Platform;

            createAccountsArray();
            viewLogin();
        }
Пример #2
0
        // Overload for initialising existing accounts
        public Account(int number, FileExplorer fe, Validator v)
        {
            string[] contents = fe.getFileContents(number.ToString() + ".txt");
            for (int i = 0; i < contents.Length; i++)
            {
                switch (i)
                {
                case 0:
                    FirstName = v.deleteFormLabel(contents[i]);
                    break;

                case 1:
                    LastName = v.deleteFormLabel(contents[i]);
                    break;

                case 2:
                    Address = v.deleteFormLabel(contents[i]);
                    break;

                case 3:
                    PhoneNo = Convert.ToInt32(v.deleteFormLabel(contents[i]));
                    break;

                case 4:
                    Email = v.deleteFormLabel(contents[i]);
                    break;

                case 5:
                    AccountNumber = Convert.ToInt32(v.deleteFormLabel(contents[i]));
                    break;

                case 6:
                    Balance = Convert.ToInt32(v.deleteFormLabel(contents[i]));
                    break;

                default:
                    this.Activities.Add(parseActivity(contents[i]));
                    break;
                }
            }
        }