Exemplo n.º 1
0
        public void SigninUser()
        {
            OptionsMenu mainMenu   = new OptionsMenu();
            EntryMenu   signinMenu = new EntryMenu();

            Console.WriteLine("Welcome to deCruz Bank, to sign-in, please enter your username: "******"Please enter your pin number: ");
            var enteredPin = Console.ReadLine();

            Console.Clear();
            XmlDocument baseInfo = new XmlDocument();
            FileStream  database = new FileStream(@"bank-ledger:\bank-database.xml", FileMode.Open);

            baseInfo.Load(database);
            var list = baseInfo.GetElementsByTagName("User");

            for (var i = 0; i < list.Count; i++)
            {
                XmlElement user     = (XmlElement)baseInfo.GetElementsByTagName("User")[i];
                XmlElement pin      = (XmlElement)baseInfo.GetElementsByTagName("PinNumber")[i];
                XmlElement nickName = (XmlElement)baseInfo.GetElementsByTagName("NickName")[i];
                if (user.GetAttribute("username") == enteredName && pin.InnerText == enteredPin)
                {
                    Console.WriteLine("");
                    Console.WriteLine("Welcome back, {0}", nickName.InnerText);
                    mainMenu.MainMenu();
                    break;
                }
                else
                {
                    Console.WriteLine("");
                    Console.WriteLine("I'm sorry, your information did not match our records, please try again...");
                    Console.WriteLine("");
                    signinMenu.SignUp_In();
                }
            }
            database.Close();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            EntryMenu menu = new EntryMenu();

            menu.SignUp_In();
        }