public void Logout()
 {
     Console.Clear();
     LoginMethods.CurrentUser    = null;
     LoginMethods.CurrentBank    = null;
     LoginMethods.CurrentAccount = null;
     Console.WriteLine("Logged Out successfully");
     login.ValidateUser();
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            IUserService userService = new UserService();
            User         user        = new User()
            {
                Name         = "Admin",
                UserName     = "******",
                MobileNumber = "9999999999",
                Password     = "******",
                Type         = "staff",
                Address      = "Hyderabad",
                Email        = "*****@*****.**"
            };

            userService.AddUser(user);
            LoginMethods login = new LoginMethods();

            login.ValidateUser();
        }
Esempio n. 3
0
        public void furtherAction()
        {
            IUserActions userActions = new UserActions();
            string       decision    = commonMethods.ReadString("Do you want to continue >> 1. Yes 2. No : ");

            Console.Clear();
            if (decision == "Yes" || decision == "Y" || decision == "yes" || decision == "1")
            {
                if (LoginMethods.CurrentUser.Type == "staff")
                {
                    StaffActions staff = new StaffActions();
                    staff.DisplayMethods();
                }
                else
                {
                    userActions.SelectAction();
                }
            }
            else
            {
                Console.WriteLine("You are logged out");
                login.ValidateUser();
            }
        }
Esempio n. 4
0
        public void AdminActions()
        {
            Console.WriteLine("1. Add new bank ");
            Console.WriteLine("2. View all banks ");
            Console.WriteLine("3. Logout");

            int choice = commonMethods.ValidateInt("Your choice : ");

            switch (choice)
            {
            case 1:
                BankSetup bankSetup = new BankSetup();
                bankSetup.AddNewBank();
                AdminActions();
                break;

            case 2:
                IBankService bankService = new BankService();
                List <Bank>  banks       = bankService.GetAllBanks();
                foreach (Bank b in banks)
                {
                    Console.WriteLine("Bank Id : " + b.Id + " Bank Name : " + b.Name);
                }
                Console.WriteLine("Total Banks Count : " + banks.Count);
                AdminActions();
                break;

            case 3: LoginMethods loginMethods = new LoginMethods();
                loginMethods.ValidateUser();
                break;

            default:
                Console.Write("Please enter a valid choice : ");
                break;
            }
        }