Exemplo n.º 1
0
        private void buttCancel_Click(object sender, EventArgs e)
        {
            ShowProject project = new ShowProject();

            this.Hide();
            DialogResult answer = MessageBox.Show("A project must be selected.", "Attention", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (answer == DialogResult.OK)
            {
                project.ShowDialog();
                this.Close();
            }
            else if (answer == DialogResult.Cancel)
            {
                this.Close();
            }
        }
Exemplo n.º 2
0
        private void LoginBttn_Click(object sender, EventArgs e)
        {
            FakeAppUserRepository test = new FakeAppUserRepository();
            string user_name           = UserNameBox.Text;
            string password            = PasswordBox.Text;
            bool   result = test.Login(user_name, password);

            if (result == true)
            {
                test.SetAuthentication(user_name, result);
                LoginUser = test.GetByUserName(user_name);
                ShowProject login = new ShowProject();
                this.Hide();
                login.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Incorrect UsereName or Password. Try again!", "Attention");
            }
        }