public async Task <IActionResult> List(DataTableAjaxPostModel model, int?page)
        {
            ViewBag.Name = "Grounds";
            var result = await _grounds.GetAllGround(model.Init(), page);

            return(Json(result));
        }
        public async Task <IActionResult> List(DataTableAjaxPostModel model, int?page)
        {
            ViewBag.Name = "Tournaments";
            var result = await _tournaments.GetAllTournaments(model.Init(), page);

            return(Json(result));
        }
Exemple #3
0
        public async Task <IActionResult> Index(DataTableAjaxPostModel model, string zone, string location, string name, int?page, bool isApi)
        {
            var users = await _userManager.GetUserAsync(HttpContext.User);

            if (users != null)
            {
                ViewBag.Name = "Team";
            }
            var result = await _teams.GetAllTeamsList(model.Init(), zone, location, name, page);

            if (isApi == true)
            {
                return(Json(new
                {
                    data = result,
                    draw = model.Draw,
                    recordsTotal = result.TotalCount,
                    recordsFiltered = result.TotalCount,
                }));
            }
            else
            {
                return(View(result));
            }
        }
Exemple #4
0
        public async Task <IActionResult> List(DataTableAjaxPostModel model, int?teamId, int?matchTypeId,
                                               int?tournamentId, int?matchSeriesId,
                                               int?season, int?matchOvers, int?userId, int?page, bool isApi)
        {
            var users = await _userManager.GetUserAsync(HttpContext.User);

            ViewBag.Name = "Match";
            if (users != null)
            {
                userId = users.Id;
            }

            ViewBag.Overs = new SelectList(_context.Matches
                                           .Select(i => i.MatchOvers)
                                           .ToList().Distinct(), "MatchOvers");

            ViewBag.Season = new SelectList(_context.Matches
                                            .Select(i => i.Season)
                                            .ToList().Distinct(), "Season");

            ViewBag.MatchType = new SelectList(_context.MatchType, "MatchTypeId", "MatchTypeName");

            ViewBag.Tournament = new SelectList(_context.Tournaments
                                                .Select(i => new { i.TournamentId, i.TournamentName })
                                                , "TournamentId", "TournamentName");

            ViewBag.MatchSeries = new SelectList(_context.MatchSeries
                                                 .Select(i => new { i.MatchSeriesId, i.Name })
                                                 , "MatchSeriesId", "Name");

            ViewBag.TeamId = new SelectList(_context.Teams
                                            .Select(i => new { i.TeamId, i.Team_Name })
                                            , "TeamId", "Team_Name");

            var result = await _matches.GetAllMatchesList(model.Init(), teamId, matchTypeId, tournamentId, matchSeriesId, season, matchOvers);

            if (isApi == true)
            {
                return(Json(new
                {
                    data = result,
                    draw = model.Draw,
                    recordsTotal = result.TotalCount,
                    recordsFiltered = result.TotalCount,
                }));
            }
            else
            {
                return(View(result));
            }
        }
        // [HttpGet("Players/Index/teamId/{teamId}/playerRoleId/{playerRoleId}/battingStyleId/{battingStyleId}/bowlingStyleId/{bowlingStyleId}/name/{name}/isApi/{isApi}")]
        public async Task <IActionResult> Index(DataTableAjaxPostModel model, int?teamId, int?playerRoleId, int?battingStyleId, int?bowlingStyleId, string name, bool isApi)
        {
            var users = await _userManager.GetUserAsync(HttpContext.User);

            ViewBag.Name   = "Players";
            ViewBag.Season = new SelectList(_context.Matches
                                            .Select(i => i.Season)
                                            .ToList().Distinct(), "Season");

            ViewBag.MatchType    = new SelectList(_context.MatchType, "MatchTypeId", "MatchTypeName");
            ViewBag.PlayerRoleId = new SelectList(_context.PlayerRole
                                                  .AsNoTracking()
                                                  .Select(i => new { i.Name, i.PlayerRoleId }), "PlayerRoleId", "Name");

            ViewBag.BattingStyleId = new SelectList(_context.BattingStyle
                                                    .AsNoTracking()
                                                    .Select(i => new { i.Name, i.BattingStyleId }), "BattingStyleId", "Name");

            ViewBag.BowlingStyleId = new SelectList(_context.BowlingStyle
                                                    .AsNoTracking()
                                                    .Select(i => new { i.Name, i.BowlingStyleId }), "BowlingStyleId", "Name");



            ViewBag.TeamId = new SelectList(_context.Teams
                                            .AsNoTracking()
                                            .Select(i => new { i.TeamId, i.Team_Name })
                                            , "TeamId", "Team_Name");
            var result = await _players.GetAllPlayersList(model.Init(), teamId, playerRoleId, battingStyleId, bowlingStyleId, name);

            if (isApi == true)
            {
                return(Json(new
                {
                    data = result,
                    draw = model.Draw,
                    recordsTotal = result.TotalCount,
                    recordsFiltered = result.TotalCount,
                }));
            }
            else
            {
                return(View(result));
            }
        }
        public async Task <IActionResult> Index(DataTableAjaxPostModel model, int?page, bool isApi)
        {
            ViewBag.Name = "Series";
            var result = await _series.GetAllSeries(model.Init(), page);

            if (isApi == true)
            {
                return(Json(new
                {
                    data = result,
                    draw = model.Draw,
                    recordsTotal = result.TotalCount,
                    recordsFiltered = result.TotalCount,
                }));
            }
            else
            {
                return(View(result));
            }
        }