public virtual void SetBooleanResponse(FormCollection formCollection, QuestionViewModel questionViewModel)
        {
            var formItem = formCollection["YesNo_" + questionViewModel.Id.ToString()];

            if (formItem != null)
            {
                questionViewModel.Answer.BooleanResponse = (formItem.ToLower() == "yes" ? true : false);
            }
            else
            {
                questionViewModel.Answer.BooleanResponse = null;
            }
        }
        public EmployeeChecklistViewModel GetViewModel()
        {
            var employeeChecklistViewModel = new EmployeeChecklistViewModel();
            var employeeChecklist = _employeeChecklistService.GetById(_employeeChecklistId);
            
            employeeChecklistViewModel.EmployeeChecklistId = _employeeChecklistId;
            employeeChecklistViewModel.CompletedOnEmployeesBehalf = _completedOnEmployeesBehalf;
            employeeChecklistViewModel.ChecklistTitle = employeeChecklist.Checklist.Title;
            employeeChecklistViewModel.ChecklistDescription = new HtmlString(employeeChecklist.Checklist.Description);
            employeeChecklistViewModel.FriendlyReference = employeeChecklist.FriendlyReference;
            employeeChecklistViewModel.IsCompleted = employeeChecklist.CompletedDate.HasValue;
            employeeChecklistViewModel.Sections = new List<SectionViewModel>();

            foreach (var section in employeeChecklist.Checklist.Sections.OrderBy(s => s.ListOrder))
            {
                var sectionViewModel = new SectionViewModel();
                sectionViewModel.Title = section.Title;
                sectionViewModel.Questions = new List<QuestionViewModel>();

                foreach(var question in section.Questions.OrderBy(q => q.ListOrder))
                {
                    var questionViewModel = new QuestionViewModel();
                    questionViewModel.Id = question.Id;
                    questionViewModel.ListOrder = question.ListOrder;
                    questionViewModel.Text = question.Text;
                    questionViewModel.QuestionType = question.QuestionType;
                    questionViewModel.ListOrder = question.ListOrder;
                    questionViewModel.Answer = GetAnswerForQuestion(question.Id, employeeChecklist.Answers);
                    sectionViewModel.Questions.Add(questionViewModel);

                }

                employeeChecklistViewModel.Sections.Add(sectionViewModel);
            }

            employeeChecklistViewModel.IsCompleted = employeeChecklist.CompletedDate != null;

            return employeeChecklistViewModel;
        }
 public virtual void SetAdditionalInfo(FormCollection formCollection, QuestionViewModel questionViewModel)
 {
     var formItem = formCollection["AdditionalInfo_" + questionViewModel.Id.ToString()];
     questionViewModel.Answer.AdditionalInfo = (formItem);
 }