Exemplo n.º 1
0
        private void btnEnter_Click(object sender, EventArgs e)
        {
            if (tbId.Text != "" && tbPassword.Text != "")
            {
                //Comprobar que el id es correcto FALTA
                User user = new User();
                user = Commons.ReadUser(Convert.ToInt32(tbId.Text));
                if (tbPassword.Text == user.Password)
                {
                    if (user.IsAdmin == true)
                    {
                        AdminPanel ap = new AdminPanel();
                        ap.Show();
                    }
                    else
                    {
                        SearchFlight searchFlight = new SearchFlight();
                        searchFlight.Show();
                    }

                    string[] numUsers = Commons.ReadUserFiles();
                    User     usuario  = new User();
                    foreach (string nu in numUsers)
                    {
                        usuario = Commons.ReadUser(nu);
                        UserList._users.Add(usuario);
                    }
                }
            }
            else
            {
                MessageBox.Show("Test your inputs");
            }
        }
Exemplo n.º 2
0
        private void OpenPanel(string type)
        {
            AuthForm authForm = new AuthForm(type);

            authForm.ShowDialog();

            switch (GlobalProperties.user_id)
            {
            case "1":
                AdminPanel adminPanel = new AdminPanel();
                adminPanel.ShowDialog();
                break;

            case "2":
                ManagerPanel managerPanel = new ManagerPanel();
                managerPanel.ShowDialog();
                break;

            case "3":
                ClientPanel clientPanel = new ClientPanel();
                clientPanel.ShowDialog();
                break;
            }
        }