Пример #1
0
        private void usuńToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CreateDeleteEditForm createForm = new CreateDeleteEditForm(this);

            createForm.SetCreateForm("Usuń zawody", "", "", "", "", "Nazwa", "", "");
            createForm.Show();
        }
Пример #2
0
        private void utwórzNoweToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CreateDeleteEditForm createForm = new CreateDeleteEditForm(this);

            createForm.SetCreateForm("Utwórz nowe zawody", "Dyscyplina", "Liczba wyścigów", "Miasto", "Opiekun", "Nazwa", "Daty oddzielone średnikiem (DD-MM-RRRR)", "Rodzaj zawodów");
            createForm.Show();
        }
Пример #3
0
        private void załóżNowaDrużynęToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CreateDeleteEditForm createForm = new CreateDeleteEditForm(this);

            createForm.SetCreateForm("Załóż drużynę", "", "", "Nazwa", "", "", "", "");
            createForm.Show();
        }
Пример #4
0
        private void edytujZawodyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CreateDeleteEditForm createForm = new CreateDeleteEditForm(this);

            createForm.SetCreateForm("Edytuj zawody", "Dyscyplina", "Liczba wyścigów", "Miasto", "Opiekun", "Nazwa", "Daty oddzielone średnikiem (MM-DD-RRRR)", "Rodzaj wyścigu");
            createForm.Show();
        }
Пример #5
0
      private void label1_Click(object sender, EventArgs e)
      {
          CreateDeleteEditForm createDeleteEditForm = new CreateDeleteEditForm(this);

          createDeleteEditForm.SetCreateForm("Załóż konto", "", "", "Imię i nazwisko", "", "Email", "\nHasło", "");
          createDeleteEditForm.Show();
      }
        private void ResultView_CellClick(object sender, DataGridViewCellEventArgs e)       //kiedy klikam komorke w gridview moich zawodow/druzyn
        {
            var loggedUserType   = LoggedUserUtility.getCurrentUserType();
            var loggedContestant = LoggedUserUtility.getLoggedContestant();

            if (CompetitionBox.Text == "Lista zawodów")
            {
                DataGridViewTextBoxCell IDcell = (DataGridViewTextBoxCell)CompetitionView.Rows[e.RowIndex].Cells[3];      //cells[3] -> bierzemy dane z kolumny ID
                competitionId = Convert.ToInt32(IDcell.Value);


                CompetitionsTeamsForm competitionsTeamsForm = new CompetitionsTeamsForm(this);
                competitionsTeamsForm.SetWindow("wyścigi", competitionId);

                competitionsTeamsForm.ConfirmButton.Visible = false;
                competitionsTeamsForm.Show();
            }
            else if (CompetitionBox.Text == "Lista wyścigów")
            {
                DataGridViewCell        clickedCell = (DataGridViewCell)CompetitionView.Rows[e.RowIndex].Cells[e.ColumnIndex];
                DataGridViewTextBoxCell raceIdCell  = (DataGridViewTextBoxCell)CompetitionView.Rows[e.RowIndex].Cells[3];  //teamId w 3 kolumnie
                //na podstawie competitionId otworz wyscigi
                if (loggedUserType == LoggedUserUtility.userType.organiser || loggedUserType == LoggedUserUtility.userType.supervisor)
                {
                    CreateDeleteEditForm createDeleteEditForm = new CreateDeleteEditForm(this);
                    if (clickedCell.Value == "Dodaj trasę")
                    {
                        createDeleteEditForm.ModifiedRaceId = Convert.ToInt32(raceIdCell.Value);
                        createDeleteEditForm.SetCreateForm("Podaj trasę wyścigów", "", "", "", "Trasa", "", "", "");
                        createDeleteEditForm.dropDownTracks();
                        createDeleteEditForm.Show();
                    }
                }
                else if (loggedUserType == LoggedUserUtility.userType.captain || loggedUserType == LoggedUserUtility.userType.contestant)
                {
                    if (clickedCell.Value == "Akceptuj")
                    {
                        ContestantDataUtility.acceptRaceInvitation(loggedContestant.id_zawodnik, Convert.ToInt32(raceIdCell.Value));
                        fillWithRaces(CompetitionView, loggedContestant.id_zawodnik, competitionId);
                    }
                }
            }
            else if (CompetitionBox.Text == "Lista drużyn")
            {
                DataGridViewCell        clickedCell = (DataGridViewCell)CompetitionView.Rows[e.RowIndex].Cells[e.ColumnIndex];
                DataGridViewTextBoxCell teamIdCell  = (DataGridViewTextBoxCell)CompetitionView.Rows[e.RowIndex].Cells[3];  //teamId w 3 kolumnie
                if (clickedCell.Value == "Akceptuj")
                {
                    ContestantDataUtility.acceptTeamInvitation(loggedContestant.id_zawodnik, Convert.ToInt32(teamIdCell.Value));
                    fillWithInvitations(CompetitionView, loggedContestant.id_zawodnik);
                }
            }
        }