public void adminMenu()
        {
            bool flag = true;

            while (flag)
            {
                Console.Clear();
                heading("IBS Admin");
                Console.WriteLine("\n\n\n\t\t\t\t\t\t\tAdmin\n");
                Console.ForegroundColor = ConsoleColor.DarkBlue;
                Console.WriteLine("\n\t\t\t\t\t 1. View all new Registered Users\n\t\t\t\t\t 2. View All transactions\n\t\t\t\t\t 3. Calculate interest\n\t\t\t\t\t 4. Exit");


                Console.ForegroundColor = ConsoleColor.Black;
                Console.WriteLine("\n\t\t\t\t\t\tEnter Choice");
                Console.SetCursorPosition(Console.CursorLeft + 57, Console.CursorTop);

                BLAccountCreation     ba = new BLAccountCreation();
                BLInterestCalculation bi = new BLInterestCalculation();
                BLReports             br = new BLReports();
                int choice = int.Parse(Console.ReadLine());
                switch (choice)
                {
                case 1:
                    heading("IBS Admin");
                    List <User> userlist = ba.b_newRegistrations();
                    if (userlist.Count > 0)
                    {
                        display_newRegistrations(userlist);
                        new_users_action(ba);
                    }
                    break;

                case 2:
                    heading("IBS Admin");
                    List <Transaction> transaclist = br.b_transactionDetails();
                    display_transactiondetails(transaclist);
                    break;

                case 3:
                    heading("IBS Admin");
                    List <Account> accountlist = new List <Account>();
                    try
                    {
                        accountlist = br.b_AccountDetails();
                        display_accountdetails(accountlist);
                        bi.b_CalculateInterest(accountlist);
                        Console.WriteLine("\n Account details after Calculate Interest\n Interest rate is 6% for Fixed Account and 8% for Saving Account\n");
                        accountlist = br.b_AccountDetails();
                        display_accountdetails(accountlist);
                    }
                    catch (InterestException e)
                    {
                        Console.WriteLine(e.Message);
                    }

                    Console.ReadKey();
                    break;

                case 4:
                    heading("IBS Admin");
                    flag = false;
                    break;
                }
            }
        }
Example #2
0
        //admin tasks page
        public void adminMenu(string adminid)
        {
            bool flag = true;

            while (flag)
            {
                try
                {
                    Console.Clear();
                    heading("IBS Admin");
                    Console.WriteLine("\n\n\n\t\t\t\t\t\t\tAdmin\n");
                    Console.ForegroundColor = ConsoleColor.DarkBlue;
                    Console.WriteLine("\n\t\t\t\t\t 1. View all new Registered Users\n\t\t\t\t\t 2. View All Account Details\n\t\t\t\t\t 3. View All transactions\n\t\t\t\t\t 4. Calculate interest\n\t\t\t\t\t 5. LOG OUT ");


                    Console.ForegroundColor = ConsoleColor.Black;
                    Console.WriteLine("\n\t\t\t\t\t\tEnter Choice");
                    Console.SetCursorPosition(Console.CursorLeft + 57, Console.CursorTop);
                    int choice = int.Parse(Console.ReadLine());

                    Console.WriteLine("\n\n");
                    switch (choice)
                    {
                    case 1:
                        List <User> userlist = ba.b_newRegistrations();
                        if (userlist.Count > 0)
                        {
                            display_newRegistrations(userlist);
                            new_users_action(ba);
                        }
                        Console.WriteLine("\nPress any key to go back");
                        Console.ReadKey();
                        break;

                    case 2:
                        try
                        {
                            List <Account> acclist = new List <Account>();
                            acclist = br.b_AccountDetails();
                            display_accountdetails(acclist);
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e.Message);
                        }
                        Console.WriteLine("\nPress any key to go back");
                        Console.ReadKey();
                        break;

                    case 3:
                        List <Transaction> transaclist = br.b_transactionDetails();
                        display_transactiondetails(transaclist);
                        Console.WriteLine("\nPress any key to go back");
                        Console.ReadKey();
                        break;

                    case 4:
                        heading("IBS Admin");
                        List <Account> accountlist = new List <Account>();
                        try
                        {
                            accountlist = br.b_AccountDetails();
                            display_accountdetails(accountlist);
                            bi.b_CalculateInterest(accountlist, adminid);
                            Console.WriteLine("\n\n\t Account details after Calculate Interest\n\tInterest rate is 0.5% permonth for Fixed Account and 0.7% permonth for Saving Account\n");
                            accountlist = br.b_AccountDetails();
                            display_accountdetails(accountlist);
                        }
                        catch (InterestException e)
                        {
                            Console.WriteLine(e.Message);
                        }
                        Console.WriteLine("\nPress any key to go back");
                        Console.ReadKey();
                        break;

                    case 5:

                        flag = false;
                        break;
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                    Console.WriteLine("Press any key to go back");
                    Console.ReadKey();
                }
            }
        }