コード例 #1
0
        private void btnProjects_Click(object sender, EventArgs e)
        {
            this.Hide();
            FormProjectsAdmin forma = new FormProjectsAdmin(user1);

            forma.ShowDialog();
            this.Show();
        }
コード例 #2
0
        private void btnLogin_Click_1(object sender, EventArgs e)
        {
            string username = txtUsername.Text;
            string password = txtPassword.Text;
            User   user     = broker.Login(username, password);

            if (user != null)
            {
                if (user.Role == 0)
                {
                    this.Hide();
                    FormAdmin forma = new FormAdmin(user);
                    forma.Text = "Welcome " + user.Name + " " + user.Surname;
                    forma.ShowDialog();
                    this.Show();
                }
                if (user.Role == 1)
                {
                    this.Hide();
                    FormProjectsAdmin forma = new FormProjectsAdmin(user);
                    forma.Text = "Welcome " + user.Name + " " + user.Surname;
                    forma.ShowDialog();
                    this.Show();
                }
                if (user.Role == 2)
                {
                    this.Hide();
                    FormDeveloperTasks forma = new FormDeveloperTasks(user);
                    forma.Text = "Welcome " + user.Name + " " + user.Surname;
                    forma.ShowDialog();
                    this.Show();
                }
            }
            else
            {
                lblProslo.Text = "Some error with login";
            }
        }