private void toolStripMenuItem8_Click(object sender, EventArgs e)
        {
            switch (label4.Text)
            {
            case "Групи":
                AddGroup addGroup = new AddGroup();
                addGroup.Show();
                SqlConnection  sqlConnectionString1 = new SqlConnection(ConnectionString);
                SqlDataAdapter sqlDataAdapt1        = new SqlDataAdapter("SELECT * FROM Групи", sqlConnectionString1);
                DataTable      dataTable1           = new DataTable();
                sqlDataAdapt1.Fill(dataTable1);
                dataGridView1.DataSource = dataTable1;
                fitness_DbDataSet1.AcceptChanges();
                break;

            case "Тренер":
                AddCoach addCoach = new AddCoach();
                addCoach.Show();
                SqlConnection  sqlConnectionString = new SqlConnection(ConnectionString);
                SqlDataAdapter sqlDataAdapt        = new SqlDataAdapter("SELECT * FROM Тренер", sqlConnectionString);
                DataTable      dataTable           = new DataTable();
                sqlDataAdapt.Fill(dataTable);
                dataGridView1.DataSource = dataTable;
                fitness_DbDataSet1.AcceptChanges();
                break;

            case "Абонемент":
                AddSeasonTicket addSeasonTicket = new AddSeasonTicket();
                addSeasonTicket.Show();
                SqlConnection  sqlConnectionString3 = new SqlConnection(ConnectionString);
                SqlDataAdapter sqlDataAdapt3        = new SqlDataAdapter("SELECT * FROM Абонемент", sqlConnectionString3);
                DataTable      dataTable3           = new DataTable();
                sqlDataAdapt3.Fill(dataTable3);
                dataGridView1.DataSource = dataTable3;
                fitness_DbDataSet1.AcceptChanges();
                break;

            case "Клієнт":
                ClientRegistration clientRegistration = new ClientRegistration();
                clientRegistration.Show();
                string         query = "SELECT Клієнт.*, [Акаунт клієнта].Логін, [Акаунт клієнта].Пароль, [Акаунт клієнта].[Перевірочне слово] FROM Клієнт, [Акаунт клієнта] WHERE Клієнт.Id = [Акаунт клієнта].ID_клієнта";
                SqlConnection  sqlConnectionString4 = new SqlConnection(ConnectionString);
                SqlDataAdapter sqlDataAdapt4        = new SqlDataAdapter(query, sqlConnectionString4);
                DataTable      dataTable4           = new DataTable();
                sqlDataAdapt4.Fill(dataTable4);
                dataGridView1.DataSource = dataTable4;
                fitness_DbDataSet1.AcceptChanges();
                break;
            }
        }
Example #2
0
 private void iconButton1_Click(object sender, EventArgs e)
 {
     clientRegistration = new ClientRegistration();
     clientRegistration.Show();
 }