Esempio n. 1
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. 2
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;
            }
        }