示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Close();
            CoordinatorMenu coordinatorMenu = new CoordinatorMenu();

            coordinatorMenu.Show();
        }
示例#2
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();
            }
        }
示例#3
0
 private void button5_Click(object sender, EventArgs e)
 {
     Login.ActiveForm.Hide();
     Coordinator.CoordinatorMenu form = new Coordinator.CoordinatorMenu();
     form.Show();
 }