private async Task <IActionResult> BuildCreateOrEditDisplayAsync(CreateOrEditDailyStatisticViewModel model)
        {
            if (model == null)
            {
                model = new CreateOrEditDailyStatisticViewModel();
            }
            var jobs = await _jobQuerier.GetJobsAsync();

            if (jobs != null)
            {
                model.Jobs = jobs.Select(s => new SelectListItem()
                {
                    Value = s.Id.ToString(),
                    Text  = s.Title
                }).ToList();
            }
            var dictionaries = await _dictionaryQuerier.GetDictionaryAsync(ResumeDefaults.PlatformType);

            if (dictionaries != null)
            {
                model.Platforms = dictionaries.Select(s => new SelectListItem()
                {
                    Text  = s.Name,
                    Value = s.Name
                }).ToList();
            }
            return(View(model));
        }
Beispiel #2
0
        private async Task <IActionResult> BuildListDisplayAsync(QueryResumeViewModel model)
        {
            var jobs = await _jobQuerier.GetJobsAsync();

            if (jobs != null)
            {
                model.Jobs = jobs.Select(s => new SelectListItem()
                {
                    Value = s.Id.ToString(),
                    Text  = s.Title
                }).ToList();
            }
            var users = await _userQuerier.GetUsersAsync();

            if (users != null)
            {
                model.Users = users.Select(s => new SelectListItem()
                {
                    Value = s.Id.ToString(),
                    Text  = s.FullName
                }).ToList();
            }
            var tags = await _dictionaryQuerier.GetDictionaryAsync(ResumeDefaults.TagType);

            if (tags != null)
            {
                model.Tags = tags.Select(s => new SelectListItem()
                {
                    Value = s.Name,
                    Text  = s.Name
                }).ToList();
            }
            var educations = await _dictionaryQuerier.GetDictionaryAsync(ResumeDefaults.EducationType);

            if (educations != null)
            {
                model.Educations = educations.Select(s => new SelectListItem()
                {
                    Value = s.Name,
                    Text  = s.Name
                }).ToList();
            }
            var platforms = await _dictionaryQuerier.GetDictionaryAsync(ResumeDefaults.PlatformType);

            if (platforms != null)
            {
                model.Platforms = platforms.Select(s => new SelectListItem()
                {
                    Value = s.Name,
                    Text  = s.Name
                }).ToList();
            }
            return(View(model));
        }