public IActionResult CreateSurveyFile()
        {
            int fileIndex             = _surveyFileRepository.GetAllSurveyFile().Where(x => x.SurveyorID == 1).Count() > 0?_surveyFileRepository.GetAllSurveyFile().Where(x => x.SurveyorID == 1).OrderByDescending(x => x.Index).Select(x => x.Index).First():1;
            var statuses              = _statusRepository.GetAllStatuses();
            SurveyFileViewModel model = new SurveyFileViewModel
            {
                Index    = fileIndex + 1,
                Statuses = statuses.Select(s => new KeyValuePair <int, string>(s.ID, s.Description)).ToList(),
            };

            return(View(model));
        }
示例#2
0
 //show all statuses
 public ActionResult Index()
 {
     ViewBag.Statuses = StatusRepository.GetAllStatuses();
     return(View());
 }