コード例 #1
0
        public double validateInput(double nr, string input, ref systemInitialise system)
        {
            switch (input)
            {
            case "1":
                return(2.1);

            case "2":
                return(2.2);

            case "3":
                return(2.3);

            case "4":
                return(2.4);

            case "5":
                return(2.5);

            case "6":
                return(2.6);

            case "7":
                return(2.0);

            default:
                Console.WriteLine("You must only enter from the above delection");
                return(2.0);
            }
        }
コード例 #2
0
ファイル: menuWithdrawal.cs プロジェクト: azasel/MiBank
 public void displayMenuItem(ref systemInitialise system)
 {
     Console.WriteLine("");
     Console.WriteLine("   ****  WITHDRAWAL  ****");
     Console.WriteLine("");
     Console.WriteLine("Please Enter The Amount: ");
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: azasel/MiBank
        static void Main(string[] args)
        {
            systemInitialise system = new systemInitialise();
            Console.ForegroundColor = ConsoleColor.Blue;
            Console.WriteLine("");
            Console.WriteLine("          *   *    * *****  *****  *    *   *   *    ");
            Console.WriteLine("         * * * *     *   *  *   *  * *  *   *  *   ");
            Console.WriteLine("        *   *   *  * *****  *****  *  * *   * * ");
            Console.WriteLine("        *       *  * *   *  *   *  *   **   *  *      ");
            Console.WriteLine("        *       *  * *****  *   *  *    *   *   *      ");
            Console.ForegroundColor = ConsoleColor.White;
            //await system.api.getResponse();
            //javaScriptSerialixer serializer = new JavaScriptSerializer();

            string val;
            double wLevel;

                do {
                double level = system.currMenu.level;
                wLevel = system.currMenu.level;
                system.currMenu.displayMenuItem(ref system);
                val = Console.ReadLine();
                system.SetMenu(system.currMenu.validateInput(wLevel, val,ref system));
                } while (wLevel != 2.0 || string.Compare(val,"7")!=0);
        }
コード例 #4
0
 public void displayMenuItem(ref systemInitialise system)
 {
     Console.WriteLine("");
     Console.WriteLine("   ****  DEPOSIT  ****");
     Console.WriteLine("");
     Console.WriteLine("Please Enter The Amount or X to exit: ");
 }
コード例 #5
0
        public double validateInput(double level, string input, ref systemInitialise system)
        {
            string accountType;

            if (String.Compare("X", input.ToUpper()) == 0)
            {
                return(2.0);
            }
            if (!system.validations.isDouble(input))
            {
                return(2.1);
            }
            do
            {
                System.Console.WriteLine("Please Select Account Savings (S) or Checking (C):");
                accountType = Console.ReadLine();
                if (String.Compare("X", input.ToUpper()) == 0)
                {
                    return(2.0);
                }
            } while (!system.validations.CheckStringInput(new string[] { "C", "S" }, accountType));

            system.customer.GetAccountByType(accountType).deposit(Convert.ToDouble(input));
            return(2.0);
        }
コード例 #6
0
 public void displayMenuItem(ref systemInitialise system)
 {
     Console.ForegroundColor = ConsoleColor.Green;
     Console.WriteLine("");
     Console.WriteLine($"********* WELCOME {system.customer._firstName.ToUpper()} ****************");
     Console.ForegroundColor = ConsoleColor.White;
     Console.WriteLine();
     Console.WriteLine("[1] Deposit");
     Console.WriteLine("[2] Withdraw");
     Console.WriteLine("[3] Transfer");
     Console.WriteLine("[4] My Statement");
     Console.WriteLine("[5] Logout");
     Console.WriteLine("[6] Reset System");
     Console.WriteLine("[7] Exit");
     Console.WriteLine();
     Console.Write("Choose an option: ");
 }
コード例 #7
0
ファイル: menuStatement.cs プロジェクト: azasel/MiBank
 public void displayMenuItem(ref systemInitialise system)
 {
     throw new System.NotImplementedException();
 }
コード例 #8
0
ファイル: menuStatement.cs プロジェクト: azasel/MiBank
 public double validateInput(double level, string input, ref systemInitialise system)
 {
     Console.WriteLine("STETMENT!!!!");
     return(2.0);
 }
コード例 #9
0
ファイル: menuWithdrawal.cs プロジェクト: azasel/MiBank
 public double validateInput(double level, string input, ref systemInitialise system)
 {
     return(2.0);
 }
コード例 #10
0
ファイル: menuLogin.cs プロジェクト: azasel/MiBank
        public double validateInput(double level, string input, ref systemInitialise system)
        {
            string drowssap = "";
            bool   pwCheck;
            string userPW;

            if (input.Length > 0)
            {
                userPW = system.api.GetResponse(input).Result;
                if (String.IsNullOrEmpty(userPW))
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("****** USER NOT FOUND PLEASE TRY AGAIN ******");
                    Console.ForegroundColor = ConsoleColor.White;
                    system.LoginAttemps     = system.LoginAttemps + 1;
                    if (system.LoginAttemps == 3)
                    {
                        Environment.Exit(0);
                    }
                    return(1.0);
                }
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("****** USER NOT FOUND PLEASE TRY AGAIN ******");
                Console.ForegroundColor = ConsoleColor.White;
                system.LoginAttemps     = system.LoginAttemps + 1;
                if (system.LoginAttemps == 3)
                {
                    Environment.Exit(0);
                }
                return(1.0);
            }

            do
            {
                Console.WriteLine("{0}Please Enter Your Password: "******"{0}****** INCORRECT PASSWORD - PLEASE TRY AGAIN ******{0}", Environment.NewLine);
                    Console.ForegroundColor = ConsoleColor.White;
                    system.LoginAttemps     = system.LoginAttemps + 1;
                }
                if (system.LoginAttemps == 3)
                {
                    Environment.Exit(0);
                }
            } while (!system.validations.validatePassword(drowssap, userPW));



            SavingsAccount testAccount = new SavingsAccount();

            Console.WriteLine($"the created account has an account type {testAccount._accType}");
            List <account> tempList = new List <account>();

            tempList.Add(testAccount);
            system.customer = new Customer(tempList, "Steven", "Jones", 100);
            return(2.0);
        }
コード例 #11
0
ファイル: menuLogin.cs プロジェクト: azasel/MiBank
 public void displayMenuItem(ref systemInitialise system)
 {
     Console.WriteLine();
     Console.WriteLine("LOGIN");
     Console.WriteLine("Please Enter Your Login ID: ");
 }