Esempio n. 1
0
        public ApplicationListModel GetAllApplications()
        {
            ApplicationListModel model = new ApplicationListModel();

            using (var db = new ApplicationsEntities())
            {
                var query = db.Applications.Select(x => x);

                var applicationList = query.ToList();
                applicationList.ForEach(application =>
                {
                    ApplicationModel a = new ApplicationModel();
                    a.ApplicationID    = application.ApplicationID;
                    a.Name             = application.Name;
                    a.Email            = application.Email;
                    a.ProjectTitle     = application.ProjectTitle;
                    a.Description      = application.Description;
                    a.Audience         = application.Audience;
                    a.Roadblocks       = application.Roadblocks;
                    a.Requirements     = application.Requirements;
                    a.Reviewed         = application.Reviewed;
                    a.Saved            = application.Saved;
                    a.Archived         = application.Archived;

                    model.Applications.Add(a);
                });
            }
            return(model);
        }
Esempio n. 2
0
        public ApplicationListModel GetNonReviewedApplications()
        {
            ApplicationListModel model = new ApplicationListModel();

            using (var db = new ApplicationsEntities())
            {
                var query = db.Applications.Where(x => x.Reviewed == false);

                var applicationList = query.ToList();

                applicationList.ForEach(application =>
                {
                    ApplicationModel a = new ApplicationModel();
                    a.ApplicationID    = application.ApplicationID;
                    a.Name             = application.Name;
                    a.Email            = application.Email;
                    a.Description      = application.Description;
                    a.Audience         = application.Audience;
                    a.Roadblocks       = application.Roadblocks;
                    a.Requirements     = application.Requirements;
                    a.Reviewed         = application.Reviewed;

                    model.Applications.Add(a);
                });
            }
            return(model);
        }
 public ActionResult Details(int id)
 {
     ApplicationListModel model = new ApplicationListModel()
     {
         Application  = RespositoryFactory.ApplicationRepository.Get(id),
         Banks        = RespositoryFactory.BankRepository.GetAll(),
         AccountTypes = RespositoryFactory.AccountTypeRepository.GetAll()
     }
     return(View(model));
 }
Esempio n. 4
0
        public int GetNextApplicationID(ApplicationListModel list)
        {
            int count = 0;

            if (list.Applications.Count > 0)
            {
                count = list.Applications.Last().ApplicationID + 1;
            }
            return(count);
        }
Esempio n. 5
0
        public async Task <ActionResult> ApplicationList(Guid jobOfferId)
        {
            var filter = new ApplicationFilterDto {
                JobOfferId = jobOfferId
            };
            var result = await ApplicationFacade.GetApplicationsAsync(filter);

            var model = new ApplicationListModel {
                Filter = filter, Applications = new List <ApplicationDto>(result.Items), JobOfferId = jobOfferId
            };

            return(View(model));
        }
        public async Task <ActionResult> ApplicationList()
        {
            var applicant = await ApplicantFacade.GetApplicantAccordingToUsernameAsync(User.Identity.Name);

            var filter = new ApplicationFilterDto {
                ApplicantId = applicant.Id
            };
            var result = await ApplicationFacade.GetApplicationsAsync(filter);

            var model = new ApplicationListModel {
                Filter = filter, Applications = new List <ApplicationDto>(result.Items), ApplicantId = applicant.Id
            };

            return(View(model));
        }
        public async Task <ActionResult> ApplicationList(ApplicationListModel model)
        {
            var filter = new ApplicationFilterDto {
                ApplicantId = model.ApplicantId
            };

            if (model.State != null)
            {
                filter.StateNumber = (int)model.State;
            }

            var result = await ApplicationFacade.GetApplicationsAsync(filter);

            model.Applications = new List <ApplicationDto>(result.Items);

            return(View(model));
        }
Esempio n. 8
0
        public ApplicationListModel GetAll(ApplicationModel model, long pageIndex, long pageSize)
        {
            var list = new ApplicationListModel();

            try
            {
                var mapper = Mapper.Map <ApplicationModel, ApplicationEntity>(model);
                var data   = _applicationRepository.GetAll(mapper, pageIndex, pageSize);
                list = Mapper.Map <ApplicationListEntity, ApplicationListModel>(data);
            }
            catch (Exception ex)
            {
                Logger.ErrorLog(ConstantsHandler.ForderLogName.ServiceBranch, "GetAll : ", ex.ToString());
            }

            return(list);
        }
Esempio n. 9
0
        public async Task <IActionResult> List(CancellationToken cancellationToken)
        {
            var model = new ApplicationListModel(_timeZoneConverter)
            {
                Tournament = await _appDb.TournamentRepository.GetTournamentAsync(
                    new PredicateExpression(TournamentFields.Id == _tenantContext.TournamentContext.ApplicationTournamentId),
                    cancellationToken),
                TournamentRoundTeams = await _appDb.TeamRepository.GetLatestTeamTournamentAsync(new PredicateExpression(LatestTeamTournamentFields.TournamentId == _tenantContext.TournamentContext.ApplicationTournamentId), cancellationToken)
            };
            var tir = await _appDb.TeamInRoundRepository.GetTeamInRoundAsync(
                new PredicateExpression(RoundFields.Id.In(model.TournamentRoundTeams.Select(rt => rt.RoundId).Distinct())),
                cancellationToken);

            tir.ToList().ForEach(t => model.TeamRegisteredOn.Add(t.TeamId, t.ModifiedOn));

            if (model.Tournament == null)
            {
                _logger.LogCritical($"{nameof(_tenantContext.TournamentContext.ApplicationTournamentId)} '{_tenantContext.TournamentContext.ApplicationTournamentId}' does not exist");
                return(NotFound());
            }

            return(View(ViewNames.TeamApplication.List, model));
        }
Esempio n. 10
0
 public int GetNextApplicationID(ApplicationListModel list)
 {
     return(list.Applications.Last().ApplicationID + 1);
 }