Esempio n. 1
0
        private void On_OK_Click(object sender, EventArgs e)
        {
            /*
             * if (!GetLoginAsync(unameText.Text, passText.Text).Result)
             * {
             *  MessageBox.Show("Error. Incorrect Credentials.");
             *  this.Close();
             * }
             */
            //show next window, pass permissions as level
            //idea modified from https://stackoverflow.com/questions/5548746/c-sharp-open-a-new-form-then-close-the-current-form
            this.Hide();
            var log = new Checks(2);

            log.FormClosed += (s, args) => this.Close();
            log.Show();
        }
Esempio n. 2
0
        private void On_OK_Click(object sender, EventArgs e)
        {
            string test = GetLoginAsync(unameText.Text, passText.Text);

            if (test.Contains("true"))
            {
                MessageBox.Show("Welcome!");
                //show next window, pass permissions as level
                //idea modified from https://stackoverflow.com/questions/5548746/c-sharp-open-a-new-form-then-close-the-current-form
                this.Hide();
                var log = new Checks(unameText.Text);
                log.FormClosed += (s, args) => this.Close();
                log.Show();
            }
            else
            {
                MessageBox.Show("Incorrect creditials");
            }
        }