コード例 #1
0
        public ActionResult Index(long CategoryId = 0)
        {
            var model = new SurveyIndexViewModel(_surveyRepository, _categoryRepository);

            model.Load(CategoryId);

            return(View("~/Views/Survey/Index.cshtml", model));
        }
コード例 #2
0
        public ActionResult Index()
        {
            var surveys   = _context.Surveys.ToList();
            var viewModel = new SurveyIndexViewModel()
            {
                Surveys = surveys,
                User    = user
            };

            return(View(viewModel));
        }
コード例 #3
0
        // GET: /<controller>/
        public IActionResult Index()
        {
            string UserID    = _userManager.GetUserId(User);
            User   this_User = _userService.GetById(UserID);

            SurveyIndexViewModel surveys = new SurveyIndexViewModel();

            IEnumerable <Survey> allSurveys = _surveyService.GetAllSurveys();

            surveys.surveys = allSurveys.Where(s => s.CreatorId == this_User.Id);

            return(View(surveys));
        }
コード例 #4
0
 public IActionResult Index(SurveyIndexViewModel model)
 {
     return(View(model));
 }