Пример #1
0
 private void MapSurvey(Repository.survey surveyRec, SurveyModel surveyModel, bool mapQuestions)
 {
     surveyModel.Id = surveyRec.survey_id;
     surveyModel.Name = surveyRec.survey_name;
     surveyModel.Description = surveyRec.survey_desc;
     surveyModel.Questions = mapQuestions
             ? surveyRec.SurveyQuestions.Select(MapSurveyQuestion).OrderBy(x => x.Order).ToList()
             : null ;
 }
Пример #2
0
        public ActionResult Create(SurveyModel survey)
        {
            if (ModelState.IsValid)
            {
                _repo.SaveSurvey(survey);
                return RedirectToAction("Index");
            }

            return View(survey);
        }
 public void StoreSurveyResult(SubmitSurveyModel submit, SurveyModel survey)
 {
     // Yes yes, jolly good wot
 }
Пример #4
0
 public void MapSurveyAndQuestions(Repository.survey surveyRec, SurveyModel surveyModel)
 {
     MapSurvey(surveyRec, surveyModel, true);
 }
Пример #5
0
 public SurveyModel MapSurvey(Repository.survey surveyRec)
 {
     var surveyModel = new SurveyModel();
     MapSurvey(surveyRec, surveyModel, false);
     return surveyModel;
 }