示例#1
0
        public Library()
        {
            Members = new MemberCollection();
            Movies  = new MovieCollection();
            Staff   = new Staff("staff", "today123");

            MainMenu   = new MainMenu(Members, Staff);
            StaffMenu  = new StaffMenu(Members, Movies);
            MemberMenu = new MemberMenu(Movies);

            // Connect all pages
            MainMenu.StaffMenu  = StaffMenu;
            MainMenu.MemberMenu = MemberMenu;
            StaffMenu.MainMenu  = MainMenu;
            MemberMenu.MainMenu = MainMenu;
        }
示例#2
0
        /// <summary>
        ///  Reads input from console to perform member credential authentication,
        /// only loading the member menu screen if matching records are found.
        /// </summary>
        /// <returns></returns>
        public bool TryMemberLogin()
        {
            bool isInputValid = false;

            Console.Write("Enter member username: "******"Enter member password: "******"\nSuccessful Authentication! Logging in as {0}", member.GetUserName());
                MemberMenu.Load(member);
            }
            else
            {
                Console.WriteLine("Member username and password does not exist.");
            }
            return(isInputValid);
        }