Пример #1
0
 public void LoadGamesGrid()
 {
     try
     {
         ServiceReference1.Games Game = new ServiceReference1.Games();
         client.GetGamesEFCompleted += Cli_GetGamesEFCompleted;
         CPB3.Visibility             = Visibility.Visible;
         if (button_Copy15.IsEnabled)
         {
             button_Copy2.IsEnabled = true;
             button_Copy1.IsEnabled = true;
             button_Copy.IsEnabled  = true;
         }
         client.GetGamesEFAsync();
     }
     catch (Exception ex)
     {
         client.Logging(ex.Message, ex.StackTrace);
     }
 }
Пример #2
0
        private void button_Copy1_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                _addwindow = new AddWindow();

                ServiceReference1.Games Game = new ServiceReference1.Games();
                int upGame = Convert.ToInt32(dgGames.SelectedIndex);
                upGame = AllGames[upGame].ID_Game;

                List <DataGridCellInfo> tmp     = dgGames.SelectedCells.ToList();
                ServiceReference1.Games tmpGame = tmp[0].Item as ServiceReference1.Games;
                tmpID_Developer        = tmpGame.Developers.Developer_Name.ToString();
                tmpID_Publisher        = tmpGame.Publishers.Publisher_Name.ToString();
                tmpGame_Name           = tmpGame.Game_Name.ToString();
                tmpYear_of_Publication = tmpGame.Year_of_Publication.ToString();
                tmpBrutal_Rating       = tmpGame.Brutal_Rating.ToString();
                tmpOfficial_Site       = tmpGame.Official_Site.ToString();
                tmpCyber_Discipline    = tmpGame.Cyber_Discipline.ToString();
                tmpNetwork_Mode        = tmpGame.Network_Mode.ToString();

                _addwindow.FillField(tmpID_Developer, tmpID_Publisher, tmpGame_Name, tmpYear_of_Publication, tmpBrutal_Rating, tmpOfficial_Site, tmpCyber_Discipline, tmpNetwork_Mode);

                if (_addwindow.ShowDialog() == true)
                {
                    client.UpdateGame(upGame, _addwindow.ID_Developer, _addwindow.ID_Publisher, _addwindow.Game_Name, _addwindow.Year_of_Publication, _addwindow.Brutal_Rating, _addwindow.Official_Site, _addwindow.Cyber_Discipline, _addwindow.Network_Mode);
                    button_Click(sender, e);
                }
                else
                {
                    MessageBox.Show("No changes happened!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                client.Logging(ex.Message, ex.StackTrace);
            }
        }
Пример #3
0
        private void CheckCBstatus(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                ServiceReference1.Games      Game = new ServiceReference1.Games();
                ServiceReference1.Developers dev  = cbDevelopers.SelectedItem as ServiceReference1.Developers;
                ServiceReference1.Publishers pub  = cbPublishers.SelectedItem as ServiceReference1.Publishers;
                client.GetSpecialGamesEFCompleted += Client_GetSpecialGamesEFCompleted;
                CPB3.Visibility        = Visibility.Visible;
                button_Copy2.IsEnabled = false;
                button_Copy1.IsEnabled = false;
                button_Copy.IsEnabled  = false;

                if (cbDevelopers.SelectedIndex == 0 && cbPublishers.SelectedIndex == 0 && cbBrutals.SelectedIndex == 0)
                {
                    LoadGamesGrid();
                }
                else if (cbDevelopers.SelectedIndex != 0 && cbPublishers.SelectedIndex == 0 && cbBrutals.SelectedIndex == 0)
                {
                    client.GetSpecialGamesEFAsync(dev.ID_Developer, null, null);
                }
                else if (cbDevelopers.SelectedIndex == 0 && cbPublishers.SelectedIndex != 0 && cbBrutals.SelectedIndex == 0)
                {
                    client.GetSpecialGamesEFAsync(null, pub.ID_Publisher, null);
                }
                else if (cbDevelopers.SelectedIndex == 0 && cbPublishers.SelectedIndex == 0 && cbBrutals.SelectedIndex != 0)
                {
                    //if (cbBrutals.SelectedIndex < 6) client.GetSpecialGamesEFAsync(null, null, Int32.Parse(cbBrutals.SelectedItem.ToString()));
                    //else client.GetSpecialGamesEFAsync(null, null, 18);
                    switch (cbBrutals.SelectedIndex)
                    {
                    case 1: client.GetSpecialGamesEFAsync(null, null, 0); break;

                    case 2: client.GetSpecialGamesEFAsync(null, null, 2); break;

                    case 3: client.GetSpecialGamesEFAsync(null, null, 6); break;

                    case 4: client.GetSpecialGamesEFAsync(null, null, 12); break;

                    case 5: client.GetSpecialGamesEFAsync(null, null, 16); break;

                    case 6: client.GetSpecialGamesEFAsync(null, null, 18); break;
                    }
                }
                else if (cbDevelopers.SelectedIndex != 0 && cbPublishers.SelectedIndex != 0 && cbBrutals.SelectedIndex == 0)
                {
                    client.GetSpecialGamesEFAsync(dev.ID_Developer, pub.ID_Publisher, null);
                }
                else if (cbDevelopers.SelectedIndex != 0 && cbPublishers.SelectedIndex == 0 && cbBrutals.SelectedIndex != 0)
                {
                    switch (cbBrutals.SelectedIndex)
                    {
                    case 1: client.GetSpecialGamesEFAsync(dev.ID_Developer, null, 0); break;

                    case 2: client.GetSpecialGamesEFAsync(dev.ID_Developer, null, 2); break;

                    case 3: client.GetSpecialGamesEFAsync(dev.ID_Developer, null, 6); break;

                    case 4: client.GetSpecialGamesEFAsync(dev.ID_Developer, null, 12); break;

                    case 5: client.GetSpecialGamesEFAsync(dev.ID_Developer, null, 16); break;

                    case 6: client.GetSpecialGamesEFAsync(dev.ID_Developer, null, 18); break;
                    }
                }
                else if (cbDevelopers.SelectedIndex == 0 && cbPublishers.SelectedIndex != 0 && cbBrutals.SelectedIndex != 0)
                {
                    switch (cbBrutals.SelectedIndex)
                    {
                    case 1: client.GetSpecialGamesEFAsync(null, pub.ID_Publisher, 0); break;

                    case 2: client.GetSpecialGamesEFAsync(null, pub.ID_Publisher, 2); break;

                    case 3: client.GetSpecialGamesEFAsync(null, pub.ID_Publisher, 6); break;

                    case 4: client.GetSpecialGamesEFAsync(null, pub.ID_Publisher, 12); break;

                    case 5: client.GetSpecialGamesEFAsync(null, pub.ID_Publisher, 16); break;

                    case 6: client.GetSpecialGamesEFAsync(null, pub.ID_Publisher, 18); break;
                    }
                }
                else if (cbDevelopers.SelectedIndex != 0 && cbPublishers.SelectedIndex != 0 && cbBrutals.SelectedIndex != 0)
                {
                    switch (cbBrutals.SelectedIndex)
                    {
                    case 1: client.GetSpecialGamesEFAsync(dev.ID_Developer, pub.ID_Publisher, 0); break;

                    case 2: client.GetSpecialGamesEFAsync(dev.ID_Developer, pub.ID_Publisher, 2); break;

                    case 3: client.GetSpecialGamesEFAsync(dev.ID_Developer, pub.ID_Publisher, 6); break;

                    case 4: client.GetSpecialGamesEFAsync(dev.ID_Developer, pub.ID_Publisher, 12); break;

                    case 5: client.GetSpecialGamesEFAsync(dev.ID_Developer, pub.ID_Publisher, 16); break;

                    case 6: client.GetSpecialGamesEFAsync(dev.ID_Developer, pub.ID_Publisher, 18); break;
                    }
                }
            }
            catch (Exception ex)
            {
                client.Logging(ex.Message, ex.StackTrace);
            }
        }