//
        // GET: /Championship/GamesX1List
        public ActionResult GamesX1List(int id_champ)
        {
            Championship   c    = _championshipBLL.ChampionshipSelect(id_champ);
            ChampGamesX1VM cgvm = new ChampGamesX1VM();

            cgvm.CurrentPlayer = _sessionHelper.CurrentPlayer;

            if (c.Started)
            {
                List <List <GameX1> > games = new List <List <GameX1> >();

                for (int i = c.NumberOfRounds; i > 0; i--)
                {
                    games.Add(_championshipBLL.ChampionshipGameX1Select(id_champ, i));
                }

                cgvm.GamesX1 = games;
                cgvm.Champ   = c;
            }
            else
            {
                cgvm.Players     = _championshipBLL.ChampionshipPlayersList(id_champ);
                cgvm.TempPlayers = _championshipBLL.ChampionshipPlayersListTemporary(id_champ);
                cgvm.Champ       = c;
            }

            if (_sessionHelper.CurrentPlayer.Id == 0)
            {
                return(View("GameX1List", "_Master", cgvm));
            }
            else
            {
                return(View("GameX1List", "_Master2", cgvm));
            }
        }
Example #2
0
        private void InsertPlaceholderResult(VestActions va)
        {
            if (string.IsNullOrWhiteSpace(va.EventCode))
            {
                return;
            }

            Championship CChampionship = ((App)App.Current).CurrentChampionship.Championship;

            AEvent Event = CChampionship.listAllEvents().Where(e => e.ShortName == va.EventCode).FirstOrDefault();

            if (Event == null)
            {
                // do nothing as the event could not be found so ignore this VestAction
                return;
            }

            try
            {
                Event.AddPlaceholderResult();
                isProcessed = true;
            }
            catch (Exception)
            {
                throw new ArgumentException("Failed to enter placeholder result for: " + Event.Name);
            }
        }
Example #3
0
 public HomeVM(Championship c, Championship cx1, List <Team> tm, List <Player> pm)
 {
     CurrentChampionship   = c;
     CurrentChampionshipx1 = cx1;
     TeamsMatcher          = tm;
     PlayersMatcher        = pm;
 }
Example #4
0
        public ErrorView ChampionshipTeamCreate(int id_player, Championship c)
        {
            ErrorView err = new ErrorView();

            if (_championshipDAL.ChampionshipIsFull(c.Id, c.NumberOfGames))
            {
                Team t   = _teamBLL.TeamSelectByPlayerCap(id_player);
                bool aux = t.SubCaptain.Id == 0 ? false : true;

                if (_teamBLL.TeamCompleted(t.Id, aux))
                {
                    if (!_championshipDAL.ChampionshipTeamSelectTeamVerify(t.Id, c.Id))
                    {
                        if (c.Type == ChampionshipType.Grátis)
                        {
                            if (_championshipDAL.ChampionshipTeamCreate(c, t))
                            {
                                err.HasError = true;
                                err.MsgError = "Seu time foi cadastrado com sucesso neste campeonato!";
                            }
                            else
                            {
                                err.HasError = true;
                                err.MsgError = "Erro!";
                            }
                        }
                        else
                        {
                            if (_championshipDAL.ChampionshipTeamCreateTemporary(c, t))
                            {
                                err.HasError = true;
                                err.MsgError = "Aguardando comprovação de pagamento.";
                            }
                            else
                            {
                                err.HasError = true;
                                err.MsgError = "Erro!";
                            }
                        }
                    }
                    else
                    {
                        err.HasError = true;
                        err.MsgError = "Seu time já está cadastrado neste campeonato!";
                    }
                }
                else
                {
                    err.HasError = true;
                    err.MsgError = "Seu time está incompleto!";
                }
            }
            else
            {
                err.HasError = true;
                err.MsgError = "Infelimente não existe mais vagas para este campeonato, fique de olho que temos campeonatos todo fim de semana!";
            }

            return(err);
        }
Example #5
0
        public bool ChampionshipEnd(int id_champ_old, int id_champ_new)
        {
            int          id_winner = 0, id_second = 0, id_third = 0, id_fourth = 0;
            Championship c = _championshipDAL.ChampionshipSelect(id_champ_old);

            c.Games = _championshipDAL.ChampionshipGameSelect(c.Id, c.NumberOfRounds);

            foreach (Game g in c.Games)
            {
                if (g.IsFinal)
                {
                    id_winner = g.Winner.Id;
                    id_second = g.Loser.Id;
                }
                if (g.IsThird)
                {
                    id_third  = g.Winner.Id;
                    id_fourth = g.Loser.Id;
                }
            }

            LeagueUpdate(id_winner, id_second, id_third, id_fourth);

            return(_championshipDAL.ChampionshipEnd(id_champ_old, id_champ_new, id_winner, id_second, id_third, id_fourth));
        }
Example #6
0
 public ActionResult Edit(int id, Championship requestChampionship)
 {
     try
     {
         if (ModelState.IsValid)
         {
             Championship championship = db.Championships.Find(id);
             if (TryUpdateModel(championship))
             {
                 championship.ChampionshipName = requestChampionship.ChampionshipName;
                 championship.Country          = requestChampionship.Country;
                 TempData["message"]           = "Championship data was changed!";
                 db.SaveChanges();
             }
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View(requestChampionship));
         }
     }
     catch (Exception e)
     {
         return(View(requestChampionship));
     }
 }
Example #7
0
        public ErrorView ChampionshipPlayerCreate(Player player, Championship c)
        {
            ErrorView err = new ErrorView();

            if (_championshipDAL.ChampionshipIsFull(c.Id, c.NumberOfGames))
            {
                if (!_championshipDAL.ChampionshipPlayerSelectPlayerVerify(player, c.Id))
                {
                    if (_championshipDAL.ChampionshipPlayerCreate(c, player))
                    {
                        err.HasError = true;
                        err.MsgError = "Você foi cadastrado com sucesso neste campeonato!";
                    }
                    else
                    {
                        err.HasError = true;
                        err.MsgError = "Erro!";
                    }
                }
                else
                {
                    err.HasError = true;
                    err.MsgError = "Você já está cadastrado neste campeonato!";
                }
            }
            else
            {
                err.HasError = true;
                err.MsgError = "Infelimente não existe mais vagas para este campeonato, fique de olho que temos diversos campeonatos!";
            }

            return(err);
        }
Example #8
0
        private Championship MineEventsLoL(string html)
        {
            Championship c = new Championship();

            string[] aux = html.Split('>');

            string[] tst = aux[16].Split('/');

            c.Game    = "LOL";
            c.Name    = aux[4].Split(new string[] { "</a" }, StringSplitOptions.None)[0];
            c.Img     = "/Images/l_logo.jpg";
            c.Link    = "http://events.br.leagueoflegends.com" + aux[1].Split('\'')[3];
            c.Date    = new DateTime(DateTime.Now.Year, int.Parse(aux[16].Split('/')[1].Substring(0, 2)), int.Parse(aux[16].Split('/')[0]));
            c.Details = aux[10].Split('<')[0];
            c.Owner   = "";
            c.Place   = "";
            c.Prize   = "";
            c.IsLocal = false;
            c.Source  = "Riot Games";
            c.Stream  = "";

            return(c);

            //_champBLL.ChampionshipCreate(c);
        }
Example #9
0
        public static bool MergeResults(ref Championship championshipPreviousResults, Championship championship)
        {
            // Increment event number
            championshipPreviousResults.Events++;

            //Merge overall results
            championshipPreviousResults.Overall = MergeClassResults(championshipPreviousResults.Overall, championship.Overall, championshipPreviousResults.Events);
            championshipPreviousResults.N2      = MergeClassResults(championshipPreviousResults.N2, championship.N2, championshipPreviousResults.Events);
            championshipPreviousResults.N4      = MergeClassResults(championshipPreviousResults.N4, championship.N4, championshipPreviousResults.Events);
            championshipPreviousResults.E2      = MergeClassResults(championshipPreviousResults.E2, championship.E2, championshipPreviousResults.Events);
            championshipPreviousResults.E4      = MergeClassResults(championshipPreviousResults.E4, championship.E4, championshipPreviousResults.Events);
            championshipPreviousResults.Pro     = MergeClassResults(championshipPreviousResults.Pro, championship.Pro, championshipPreviousResults.Events);
            championshipPreviousResults.Truck   = MergeClassResults(championshipPreviousResults.Truck, championship.Truck, championshipPreviousResults.Events);

            // Update competitor count
            championshipPreviousResults.OverallCompetitors = championshipPreviousResults.Overall.Count();
            championshipPreviousResults.N2Competitors      = championshipPreviousResults.N2.Count();
            championshipPreviousResults.N4Competitors      = championshipPreviousResults.N4.Count();
            championshipPreviousResults.E2Competitors      = championshipPreviousResults.E2.Count();
            championshipPreviousResults.E4Competitors      = championshipPreviousResults.E4.Count();
            championshipPreviousResults.ProCompetitors     = championshipPreviousResults.Pro.Count();
            championshipPreviousResults.TruckCompetitors   = championshipPreviousResults.Truck.Count();

            // Reorder results based on total points

            return(false);
        }
Example #10
0
        private Championship MineChampsXFire(string html)
        {
            Championship c = new Championship();

            string[] aux = html.Split('<');

            string Name    = aux[7].Split('>')[1];
            string Link    = aux[7].Split('\'')[1];
            string Date    = aux[20].Split(new string[] { "Starts" }, StringSplitOptions.None)[1];
            string Game    = GamesXFire(aux[12].Split('>')[1]);
            string Details = aux[16].Split('>')[1];
            string Img     = aux[4].Split('\'')[3];

            c.Game    = Game;
            c.Name    = Name;
            c.Img     = Img;
            c.Link    = "http://xfire.com" + aux[1].Split('\'')[3];
            c.Date    = new DateTime(DateTime.Now.Year, Months(Date.Split(',')[0].Split(' ')[1]), int.Parse(Date.Split(',')[1].Substring(1, 2)));
            c.Details = Details;
            c.Owner   = "";
            c.Place   = "";
            c.Prize   = "";
            c.IsLocal = false;
            c.Source  = "XFire";
            c.Stream  = "";

            return(c);
        }
Example #11
0
        private Championship MineChampsBattlefy(string html)
        {
            Championship c = new Championship();

            string[] aux = html.Split('<');

            string Name    = aux[7].Split('>')[1];
            string Link    = aux[7].Split('\'')[5];
            string Date    = aux[12].Split('>')[1];
            string Game    = GamesBattlefy(aux[4].Split('>')[1]);
            string Details = aux[10].Split('>')[1];
            string Img     = aux[2].Split('\'')[3];

            c.Game    = Game;
            c.Name    = Name;
            c.Img     = ImgOfGame(Game, Img);
            c.Link    = "https://battlefy.com/" + Link;
            c.Date    = new DateTime(DateTime.Now.Year, Months(Date.Split(' ')[0]), int.Parse(Date.Split(' ')[1].Split(',')[0]));
            c.Details = Details;
            c.Owner   = "";
            c.Place   = "";
            c.Prize   = "";
            c.IsLocal = false;
            c.Source  = "Battlefy";
            c.Stream  = "";

            c = MineDeeperChampsBattlefy(c);

            return(c);
        }
Example #12
0
        private void deleteFromDatabase()
        {
            if (MessageBox.Show("Are you sure you want to delete " + Name + "? This cannot be undone.", "Are you sure",
                                MessageBoxButton.YesNo, MessageBoxImage.Exclamation, MessageBoxResult.No) == MessageBoxResult.Yes)
            {
                //CSDB context = FileIO.FConnFile.getContext();

                //if (context == null)
                //throw new Exception("File error when deleting championship");

                string dirPath = getChampionshipHomeDir();

                Championship temp = this.Championship;

                if (Directory.Exists(dirPath))
                {
                    Directory.Delete(dirPath);
                }

                selectDefaultChampionship();

                //context.Championships.DeleteOnSubmit(temp);
                //SaveChanges();

                //!*!
                GetFileDetails( ).IO.Delete <Championship> (temp);

                RaisePropertyChanged("Championships");
            }
        }
Example #13
0
        private void newEvent(object obj)
        {
            NewEvent ne = new NewEvent();



            if (ne.ShowDialog( ) == true)
            {
                if (ne.Event == null)
                {
                    MessageBox.Show("An error occurred, the event was not made");
                }

                Championship.addEvent(ne.Event);
                //SaveToDB ( );

                EditEvent ee = new EditEvent();
                ee.DataContext = new EventVM(ne.Event);
                ee.ShowDialog( );
                SaveToDB( );

                RaisePropertyChanged("Events");

                if (obj is EventsPage)
                {
                    ((EventsPage)obj).ReloadPage( );
                }
            }
            else
            {
                return;
            }
        }
    public void AddEntry(Entity inEntity, Championship inChampionship)
    {
        if (inEntity is Driver)
        {
            ChampionshipEntry_v1 inactiveEntry = this.GetInactiveEntry(inEntity);
            if (inactiveEntry != null)
            {
                this.mDrivers.Add(inactiveEntry);
                this.mInactiveDrivers.Remove(inactiveEntry);
                return;
            }
        }
        ChampionshipEntry_v1 championshipEntryV1 = new ChampionshipEntry_v1();

        championshipEntryV1.Create(inEntity, inChampionship);
        if (inEntity is Driver)
        {
            this.mDrivers.Add(championshipEntryV1);
            this.mDrivers[this.mDrivers.Count - 1].SetStartingChampionshipPosition();
        }
        else
        {
            this.mTeams.Add(championshipEntryV1);
            this.mTeams[this.mTeams.Count - 1].SetStartingChampionshipPosition();
        }
    }
Example #15
0
        public ActionResult Index()
        {
            Championship  c   = _champBLL.ChampionshipSelectCurrentByLeague(1);
            Championship  cx1 = _champBLL.ChampionshipSelectCurrentx1();
            List <Team>   tm  = _teamBLL.TeamMatcherList();
            List <Player> pm  = _playerBLL.PlayerMatcherList();

            HomeVM hvm = new HomeVM(c, cx1, tm, pm);

            if (_sessionHelper.CurrentPlayer.Id == 0)
            {
                return(View("index", "_Master", hvm));
            }
            else
            {
                if (_sessionHelper.CurrentPlayer.Admin)
                {
                    return(View("index", "_MasterAdmin", hvm));
                }
                else
                {
                    return(View("index", "_Master2", hvm));
                }
            }
        }
Example #16
0
 public void AddChampionship(string name, DateTime start, DateTime finish, string type)
 {
     using (context = new ChampionshipContext())
     {
         Championship championship = context.Championships
                                     .FirstOrDefault(c => c.Name == name && c.StartDate == start && c.FinishDate == finish && c.Type.Name == type);
         if (championship == null)
         {
             championship = new Championship {
                 Name = name, StartDate = start, FinishDate = finish
             };
             Entities.Type typeCup = context.Types.FirstOrDefault(t => t.Name == type);
             if (typeCup == null)
             {
                 typeCup = new Entities.Type {
                     Name = type
                 };
                 context.Types.Add(typeCup);
             }
             championship.Type = typeCup;
             context.Championships.Add(championship);
             context.SaveChanges();
         }
     }
 }
Example #17
0
        public void AddCompetitor_MovieNotInList_ShouldAddMovieToList()
        {
            var championship = new Championship();
            var movie        = new Movie("i01", "t01", 2018, 8.0);

            Assert.DoesNotThrow(() => championship.AddCompetitor(movie));
        }
        //
        // GET: /Championship/Current
        public ActionResult Current(int id_league)
        {
            Championship c = _championshipBLL.ChampionshipSelectCurrentByLeague(id_league);

            if (c.Type == ChampionshipType.X1)
            {
                ChampProfileVM cpvm = new ChampProfileVM(_sessionHelper.CurrentPlayer, c);

                if (_sessionHelper.CurrentPlayer.Id == 0)
                {
                    return(View("profilex1", "_Master", cpvm));
                }
                else
                {
                    return(View("profilex1", "_Master2", cpvm));
                }
            }
            else
            {
                ChampProfileVM cpvm = new ChampProfileVM(_sessionHelper.CurrentPlayer, c);

                if (_sessionHelper.CurrentPlayer.Id == 0)
                {
                    return(View("profile", "_Master", cpvm));
                }
                else
                {
                    return(View("profile", "_Master2", cpvm));
                }
            }
        }
Example #19
0
        public async Task <IActionResult> Edit(int id, [Bind("Name,ID")] Championship championship)
        {
            if (id != championship.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(championship);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ChampionshipExists(championship.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(championship));
        }
Example #20
0
 private void buttonDelete_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewCell oneCell in dataGridView1.SelectedCells)
     {
         if (oneCell.Selected && oneCell.OwningRow != null)
         {
             if (String.IsNullOrEmpty(dataGridView1.Rows[oneCell.RowIndex].Cells[0].Value?.ToString()))
             {
                 DialogResult res = MessageBox.Show("Выбраная строка не связанна с записью.",
                                                    "Не так надо", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 return;
             }
             int          pId = (int)dataGridView1.Rows[oneCell.RowIndex].Cells[0].Value;
             Championship pE  = ParentF.db.Championships.FirstOrDefault(p => p.Id == pId);
             if (pE == null)
             {
                 DialogResult res = MessageBox.Show("Запись не была найдена.",
                                                    "Не так надо", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 dataGridView1.Rows.RemoveAt(oneCell.RowIndex);
                 return;
             }
             DialogResult Ask = MessageBox.Show($"Вы уверены что хотите удалить данную запись? Id: {pId}",
                                                "Вопрос есть", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
             if (Ask == DialogResult.OK)
             {
                 ParentF.db.Championships.Remove(pE);
                 ParentF.db.SaveChanges();
                 dataGridView1.Rows.RemoveAt(oneCell.RowIndex);
                 labelCount.Text = ParentF.db.Championships.ToList().Count.ToString();
             }
         }
     }
 }
Example #21
0
        public async Task <IActionResult> PutChampionship([FromRoute] int id, [FromBody] Championship championship)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != championship.ChampionshipID)
            {
                return(BadRequest());
            }

            _context.Entry(championship).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ChampionshipExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public void Should_Register_Teams_on_Championship_and_not_remove_a_Player_reason_not_CBF()
        {
//      <~~~~~~~~~~~~~~~~~~~~~~~[Creating Championship]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>
            var champ = new Championship();

//      <~~~~~~~~~~~~~~~~~~~~~~~[Register User]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>

            champ.RegisterUser("Tiago", Profile.CBF, "admin123");
//      <~~~~~~~~~~~~~~~~~~~~~~~[Register Teams]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>
            var teamsmock = TeamsMock();

            champ.RegisterTeams(teamsmock);
//      <~~~~~~~~~~~~~~~~~~~~~~~[Remove Player of Teams]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>
            var teamId = champ.GetTeamIdByName("Flasco");

            var foundTeam   = champ.GetTeamById(teamId);
            var foundPlayer = foundTeam.GetPlayerById(foundTeam.GetPlayerIdByName("Tiago"));

            champ.RegisterUser("Leandro");

            var tryRemove = champ.RemovePlayer(foundPlayer, teamId);

            Assert.False(tryRemove);
            Assert.Equal(16, foundTeam.Players.Count);
            Assert.Contains(foundPlayer, foundTeam.Players);
        }
        public void AssertUseCase1ReturnExpectedWinners()
        {
            var movies = new List <IMovie>()
            {
                new Movie("tt3606756", "Os Incríveis 2", 2018, 8.5m),
                new Movie("tt4881806", "Jurassic World: Reino Ameaçado", 2018, 6.7m),
                new Movie("tt5164214", "Oito Mulheres e um Segredo", 2018, 6.3m),
                new Movie("tt7784604", "Hereditário", 2018, 7.8m),
                new Movie("tt4154756", "Vingadores: Guerra Infinita", 2018, 8.8m),
                new Movie("tt5463162", "Deadpool 2", 2018, 8.1m),
                new Movie("tt3778644", "Han Solo: Uma História Star Wars", 2018, 7.2m),
                new Movie("tt3501632", "Thor: Ragnarok", 2017, 7.9m)
            };

            var expectedWinner = "tt4154756";

            var expectedFinalists = new List <string> {
                "tt3606756", "tt4154756"
            }
            .OrderBy(x => x);

            var championship = new Championship();

            championship.Initialize(movies);

            var round = championship.Play();

            var orderedfinalistsIds = round.Movies.Select(x => x.Id).OrderBy(x => x);

            Assert.AreEqual(string.Join("", expectedFinalists), string.Join("", orderedfinalistsIds));

            Assert.AreEqual(round.Matches.First().Winner.Id, expectedWinner);
        }
        private bool parseBarcode(string Barcode, out Championship Championship, out AEvent Event)
        {
            Championship = null;
            Event        = null;

            if (Barcode.Contains("C-") && Barcode.Contains("%E-"))
            {
                string champStr = Barcode.Split('%')[0];
                string eventStr = Barcode.Split('%')[1];

                champStr = champStr.TrimStart(new char[] { 'C', '-' });
                eventStr = eventStr.TrimStart(new char[] { 'E', '-' });

                Championship = GetFileDetails( ).IO.GetAll <Championship>( ).ToArray( ).Where(c => c.ShortName.ToUpper( ).Trim( ) == champStr.ToUpper( ).Trim( )).FirstOrDefault( );

                if (Championship != null)
                {
                    Event = Championship.Events.Where(e => e.ShortName.ToUpper( ).Trim( ) == eventStr).FirstOrDefault( );
                    if (Event == null)
                    {
                        return(false);
                    }
                    return(true);
                }
                return(false);
            }
            else
            {
                return(false);
            }
        }
Example #25
0
        public List <Championship> ChampionshipList()
        {
            List <Championship> champs = _champDAL.ChampionshipList();
            Championship        ad     = new Championship();

            ad.Date = new DateTime(1993, 4, 28);

            for (int i = 0; i <= champs.Count; i++)
            {
                if (i == 21)
                {
                    ad.Name = "topo";
                    champs.Insert(i + 0, ad);
                }
                if (i == 43)
                {
                    ad.Name = "interno";
                    champs.Insert(i + 0, ad);
                }
                if (i == 65)
                {
                    ad.Name = "baixo";
                    champs.Insert(i + 0, ad);
                }
            }

            return(champs);
        }
        public bool MineFace()
        {
            bool         result = false;
            Championship c      = new Championship();

            WebClient webClient = new WebClient();
            string    html      = webClient.DownloadString("https://www.facebook.com/mixturadosneo/");

            string[] news = html.Split(new string[] { "<div class=\"" }, StringSplitOptions.None);

            for (int i = 1; i < news.Length; i++)
            {
                string[] aux = news[i].Split('"');

                c.Name    = aux[15].Split('<')[0].Substring(1);
                c.Link    = "https://www.gamersclub.com.br" + aux[4];
                c.Img     = "https://www.gamersclub.com.br" + aux[10];
                c.Date    = DateTime.Parse(aux[21].Split('>')[2].Substring(1, 10));
                c.Game    = "CSGO";
                c.Owner   = "GamersClub";
                c.Details = "";
                c.Owner   = "";
                c.Place   = "";
                c.Prize   = "";
                c.IsLocal = false;

                c = new Championship();
            }

            return(result);
        }
Example #27
0
        public async Task <ActionResult <Championship> > PostChampionship(Championship championship)
        {
            _context.Championships.Add(championship);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetChampionship", new { id = championship.ID }, championship));
        }
Example #28
0
 public ChampionshipPromotionData(Team inTeam, Championship inPreviousChampionship, ChampionshipPromotionData.TeamStatus inStatus, CarStats inStats)
 {
     this.team                 = inTeam;
     this.teamStatus           = inStatus;
     this.previousChampionship = inPreviousChampionship;
     this.teamPreviousChampPartStatRankings = inStats;
 }
        public ActionResult TeamEntry()
        {
            int id_champ = int.Parse(Request["id_champ"]);

            Championship c = _championshipBLL.ChampionshipSelect(id_champ);

            ChampProfileVM cpvm = new ChampProfileVM(_sessionHelper.CurrentPlayer, c);

            if (_sessionHelper.CurrentPlayer.Id != 0)
            {
                if (c.Type == ChampionshipType.X1)
                {
                    cpvm.Err = _championshipBLL.ChampionshipPlayerCreate(_sessionHelper.CurrentPlayer, c);
                }
                else
                {
                    if (_sessionHelper.CurrentPlayer.IsCaptain || _sessionHelper.CurrentPlayer.IsSubCaptain)
                    {
                        cpvm.Err = _championshipBLL.ChampionshipTeamCreate(_sessionHelper.CurrentPlayer.Id, c);
                    }
                }

                return(View("profile", "_Master2", cpvm));
            }
            else
            {
                return(View("profile", "_Master", cpvm));
            }
        }
Example #30
0
        private void DeleteResult(VestActions va)
        {
            if (va.Vest == null)
            {
                return;
            }

            Championship CChampionship = ((App)App.Current).CurrentChampionship.Championship;

            List <ACompetitor> Competitors = CChampionship.getCompetitor(va.Vest);

            if (Competitors.Count == 0)
            {
                // Competitor could not be found
                // We don't have to hold here.
                // We will assume this is an error on the data input part and ignore this request.
                //isProcessed = true;
            }
            else if (Competitors.Count == 1)
            {
                // one competitor was found
                throw new NotImplementedException();
            }
            else if (Competitors.Count > 1)
            {
                // more than one competitor was found
                throw new NotImplementedException();
            }
        }
Example #31
0
 /**
  * add championship to Championships table
  */
 public int AddChampionship(DateTime start, DateTime end, string city, string imageUrl)
 {
     Championship champ = new Championship();
     champ.Start_date = start;
     champ.End_date = end;
     champ.City = city;
     champ.Picture = imageUrl;
     db.Championships.InsertOnSubmit(champ);
     db.SubmitChanges();
     return champ.Id;
 }
Example #32
0
 private ChampionshipData getChampionshipData(Championship c)
 {
     ChampionshipData champ = new ChampionshipData();
     champ.Id = c.Id;
     champ.City = c.City;
     champ.StartDate = c.StartDate;
     if (c.EndDate.HasValue)
         champ.EndDate = c.EndDate;
     champ.Picture = c.Picture;
     return champ;
 }
 partial void DeleteChampionship(Championship instance);
Example #34
0
        private void WriteRoaster( HtmlTextWriter writer, Championship champ )
        {
            writer.WriteLine("<h2>Playoffs Preview</h2>");
            ArrayList list = champ.GetWinners();

            writer.WriteLine("<ul id='PlayoffsPreview'>");
            for( int i = 0; i < list.Count; i += 2 ) {
                Ruler one = (Ruler) list[i];
                Ruler two = (Ruler) list[i+1];

                writer.WriteLine("<li>{0} <span class='green'>vs</span> {1}</li>",
                        OrionGlobals.getLink(one),
                        OrionGlobals.getLink(two)
                );
            }
            writer.WriteLine("</ul>");
        }
 partial void InsertChampionship(Championship instance);
	private void detach_Championships(Championship entity)
	{
		this.SendPropertyChanging();
		entity.Player = null;
	}
 partial void UpdateChampionship(Championship instance);