private async Task FillViewDataAsync(UserViewModelBase viewModel = null)
        {
            var data = await HandlerDispatcher.ExecuteQueryAsync(new GetDataForUserDetailsQuery());

            ViewData["StudyPlaces"] = data.StudyPlaces;
            ViewData["CityId"]      = new SelectList(data.Cities, "Id", "Name", viewModel?.CityId);
        }
        public async Task <IActionResult> ExportParticipants(int id)
        {
            var package = await HandlerDispatcher.ExecuteQueryAsync(new GetExportedTeamContestParticipantsQuery { ContestId = id });

            var ms = new MemoryStream();

            package.SaveAs(ms);
            ms.Position = 0;
            return(File(ms, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Participants.xlsx"));
        }
        public async Task <IActionResult> ExportTeams(int id)
        {
            var result = await HandlerDispatcher.ExecuteQueryAsync(new GetExportedTeamsForContestQuery { ContestId = id });

            var ms = new MemoryStream();

            result.ExcelPackage.SaveAs(ms);
            ms.Position = 0;
            return(File(ms, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $"{result.ContestName}.xlsx"));
        }
        public async Task <FileResult> Export()
        {
            var excel = await HandlerDispatcher.ExecuteQueryAsync(new GetExportedUsersQuery());

            var ms = new MemoryStream();

            excel.SaveAs(ms);
            ms.Position = 0;
            return(File(ms, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Users.xlsx"));
        }
        public async Task <IActionResult> ImportBaylorRegistration(int id)
        {
            var vm = await HandlerDispatcher.ExecuteQueryAsync(new GetImportBaylorRegistrationDataQuery { ContestId = id });

            return(View(vm));
        }
Exemple #6
0
        private async Task FillViewDataDetailFormAsync(School item)
        {
            var cities = await HandlerDispatcher.ExecuteQueryAsync(new GetCitiesForSchoolQuery());

            ViewData["CityId"] = new SelectList(cities, "Id", "Name", item?.CityId);
        }
        private async Task FillViewDataDetailFormAsync(CompClass item = null)
        {
            var areas = await HandlerDispatcher.ExecuteQueryAsync(new GetAreasForCompClassQuery());

            ViewData["Area"] = new SelectList(areas, "Id", "Name", item?.AreaId);
        }
        // GET: Admins
        public async Task <IActionResult> Admins()
        {
            var admins = await HandlerDispatcher.ExecuteQueryAsync(new GetAdminsQuery());

            return(View(admins));
        }
Exemple #9
0
        private async Task FillViewDataDetailFormAsync(City item = null)
        {
            var regions = await HandlerDispatcher.ExecuteQueryAsync(new GetRegionsForCityQuery());

            ViewData["RegionId"] = new SelectList(regions, "Id", "Name", item?.RegionId);
        }
        private async Task FillViewDataDetailFormAsync(ContestDetailsViewModel viewModel = null)
        {
            var areas = await HandlerDispatcher.ExecuteQueryAsync(new GetAreasForContestQuery());

            ViewData["Areas"] = new MultiSelectList(areas, "Id", "Name", viewModel?.ContestAreas.Select(c => c.AreaId));
        }