Exemple #1
0
        private void Edit2_Copy2_Click(object sender, RoutedEventArgs e)
        {
            EditGameStartingGrid gameStartingGrid = new EditGameStartingGrid();

            gameStartingGrid.Namegroup = Country15.Content.ToString() + "-" + Country16.Content.ToString();
            gameStartingGrid.Score     = Point15.Content.ToString() + ":" + Point16.Content.ToString();
            gameStartingGrid.Owner     = this;
            gameStartingGrid.ShowDialog();
        }
Exemple #2
0
        private void Edit6Button_Click(object sender, RoutedEventArgs e)
        {
            EditGameStartingGrid gameStartingGrid = new EditGameStartingGrid();

            gameStartingGrid.Namegroup = Game6.Content.ToString() + "-" + Game1_Copy6.Content.ToString();
            gameStartingGrid.Score     = Label7.Content.ToString();
            gameStartingGrid.Owner     = this;
            gameStartingGrid.ShowDialog();
        }
Exemple #3
0
        private void Edit1_Click(object sender, RoutedEventArgs e)
        {
            EditGameStartingGrid gameStartingGrid = new EditGameStartingGrid();

            gameStartingGrid.Namegroup = Country1.Content.ToString() + "-" + Country2.Content.ToString();
            gameStartingGrid.Score     = Point1.Content.ToString() + ":" + Point2.Content.ToString();
            gameStartingGrid.Owner     = this;
            gameStartingGrid.ID_Stage  = ID_Stage;
            gameStartingGrid.IsEnded   = IsEnded;
            gameStartingGrid.ShowDialog();
        }
        private void OK(object sender, RoutedEventArgs e)
        {
            if (Valid())
            {
                Minute_ = int.Parse(Minute.Text);
                string SelectedTeam = "";
                if (Team1.IsChecked == true)
                {
                    SelectedTeam = Team1.Content.ToString();
                }
                else if (Team2.IsChecked == true)
                {
                    SelectedTeam = Team2.Content.ToString();
                }
                else
                {
                    MessageBox.Show("Выберите команду!");
                }
                Event_          = ListEvent.Text;
                AdditionalInfo_ = Additional.Text;
                DataTable Sel          = DBAdapter.DB.RunSelect("Select ID_Team from Teams where TeamName='" + SelectedTeam + "'");
                int       selectedTeam = int.Parse(Sel.Rows[0].ItemArray[0].ToString());
                if (Event_ == "Goal")
                {
                    if (SelectedTeam == Team1_)
                    {
                        Score1_++;
                    }
                    else
                    {
                        Score2_++;
                    }
                }
                EditGameStartingGrid editGameStartingGrid = new EditGameStartingGrid();
                if (IDEvent_ != 0)
                {
                    DBAdapter.DB.RunInsert("Update [Events] SET [Min] = '" + Minute_ + "', [Team_ID] = '" + selectedTeam + "', [Event] = '" + Event_ + "', [AdditionalInformation] = '" + AdditionalInfo_ + "' where [ID_Event] = '" + IDEvent_ + "'");

                    editGameStartingGrid.Refresh(Score1_, Score2_, StageID_, Team1_, Team2_);
                }
                else//add
                {
                    DBAdapter.DB.RunInsert("Insert Into [Events] (Stage_ID, Min, Team_ID,  Event, AdditionalInformation) values('" + StageID_ + "','" + Minute_ + "','" + selectedTeam + "','" + Event_ + "','" + AdditionalInfo_ + "')");

                    editGameStartingGrid.Refresh(Score1_, Score2_, StageID_, Team1_, Team2_);
                }
                Close();
            }
            else
            {
                MessageBox.Show("Заполните все поля!");
            }
        }