Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Admin.Volunteers.ActiveForm.Hide();
            MenuAdm menuAdm = new MenuAdm();

            menuAdm.Show();
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            EditCharity.ActiveForm.Hide();
            MenuAdm menuAdm = new MenuAdm();

            menuAdm.Show();
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            MenuAdm menuAdm = new MenuAdm();

            menuAdm.Show();
            Close();
        }
Пример #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                connectionSql.Open();
                dataAdapter = new SqlDataAdapter($"SELECT [Email], [Password], [RoleId] FROM [dbo].[User] WHERE [Email] = '{textBox1.Text}' and [Password] = '{textBox2.Text}'", connectionSql);
                DataSet dataSet = new DataSet();
                dataAdapter.Fill(dataSet);

                table = dataSet.Tables[0];

                if (table.Rows.Count != 0)
                {
                    email = textBox1.Text;
                    DataRow dataRow = table.Rows[0];
                    if (dataRow[2].ToString() == "A")
                    {
                        Login.ActiveForm.Hide();
                        Admin.MenuAdm form = new Admin.MenuAdm();
                        form.Show();
                    }
                    if (dataRow[2].ToString() == "C")
                    {
                        Login.ActiveForm.Hide();
                        Coordinator.CoordinatorMenu form = new Coordinator.CoordinatorMenu();
                        form.Show();
                    }
                    if (dataRow[2].ToString() == "R")
                    {
                        Login.ActiveForm.Hide();
                        Runer.RunnerMenu form = new Runer.RunnerMenu();
                        form.Show();
                    }
                }
                else
                {
                    MessageBox.Show("Неверный логин или пароль");
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
            finally
            {
                connectionSql.Close();
            }
        }
Пример #5
0
 private void button4_Click(object sender, EventArgs e)
 {
     Login.ActiveForm.Hide();
     Admin.MenuAdm form = new Admin.MenuAdm();
     form.Show();
 }