示例#1
0
        private void buttonMenu_Click(object sender, EventArgs e)
        {
            FormMenu menu = new FormMenu();

            menu.Show();
            this.Hide();
        }
        private void buttonVhod_Click(object sender, EventArgs e)
        {
            bool key = false;

            if (textBoxLogin.Text != "" && textBoxPassword.Text == "")
            {
                MessageBox.Show("Введите данные", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                foreach (Authentitation authentitation in Program.projectForSinaptic.Authentitation)
                {
                    if (textBoxPassword.Text == authentitation.Password && textBoxLogin.Text == authentitation.Login)
                    {
                        key = true;
                    }
                }
            }
            if (key == true)
            {
                FormMenu formMenu = new FormMenu();
                formMenu.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Логин или пароль неверны!", "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textBoxLogin.Text    = "";
                textBoxPassword.Text = "";
            }
        }