Exemplo n.º 1
0
        private void SubmitButton_Click(object sender, EventArgs e)
        {
            string userInput = UserNameInput.Text;
            string pass      = PasswordInput.Text;
            bool   auth;

            LoginController login = new LoginController();

            auth = login.login(userInput, pass);
            if (auth)
            {
                User current = login.returnCurrentUser();
                var  user    = current.getCurrentUser();

                login.createIfMissing();

                MessageBox.Show("Welcome " + user.Item3 + " " + user.Item4 + " take time to smell the flowers.");
                this.Hide();
                //TestButtons runProgram = new TestButtons();
                mainmenuController mainmenu = new mainmenuController(current);
                //runProgram.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Incorrect Username or Password", "Invalid Login", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        public mainmenuGUI(mainmenuController parent, string firstName, string lastName, int permissionLevel)
        {
            this.parent          = parent;
            this.firstName       = firstName;
            this.lastName        = lastName;
            this.permissionLevel = permissionLevel;

            InitializeComponent();
        }