Esempio n. 1
0
        public void LoginMenu()
        {
            Console.WriteLine("Enter your username: "******"Enter your password: "******"Unable to verify account");
                Console.WriteLine("Try again? \n Y^(Yes) N^(No)");
                string input = Console.ReadLine();
                switch (input)
                {
                case "Y":
                    LoginMenu();
                    break;

                case "N":
                    ex.Exit();
                    LoginMenu();
                    break;

                default:
                    err.InvalidInputMsg();
                    break;
                }
            }
        }
Esempio n. 2
0
        public void SignupMenu()
        {
            //for new customers signing up
            CustomerHandler ch  = new CustomerHandler();
            ErrorHandler    err = new ErrorHandler();

uname:
            Console.WriteLine("Enter Username: "******"Enter Password: "******"Enter First Name: ");
            string firstName = Console.ReadLine();

            Console.WriteLine("Enter Last Name: ");
            string lastName = Console.ReadLine();

            if (err.VerifyName(firstName, lastName) == false)
            {
                err.InvalidInputMsg();
                goto name;
            }

addin:
            Console.WriteLine("Enter Address: ");
            Console.WriteLine("Street: ");
            string street = Console.ReadLine();

            Console.WriteLine("City: ");
            string city = Console.ReadLine();

            Console.WriteLine("State: ");
            string state = Console.ReadLine();

            Console.WriteLine("Zipcode: ");
            string zipcode = Console.ReadLine();

            if (err.VerifyAddress(street, city, state, zipcode) == false)
            {
                err.InvalidInputMsg();
                goto addin;
            }
            Address custAdd = new Address {
                Street  = street,
                City    = city,
                State   = state,
                Zipcode = zipcode
            };

            ch.AddCustomer(firstName, lastName, username, password, custAdd);
            Customer c = new Customer
            {
                FirstName   = firstName,
                LastName    = lastName,
                UserName    = username,
                CustAddress = custAdd
            };

            OrderMenu om = new OrderMenu();

            om.Ordermenu(c);
        }