public void RespondToSurvey(int permissionId, SurveyResponseDTO surveyResponse) { SurveyPermission surveyPermission = Permissions.FirstOrDefault(p => p.Id == permissionId); if (surveyPermission is null) { throw new ActionNotPermittedException("Permission id is not valid."); } Permissions.Remove(surveyPermission); Responses.Add(new SurveyResponse(surveyPermission, surveyResponse)); }
public SurveyResponse(SurveyPermission permission, SurveyResponseDTO response) { UsedPermission = permission; MedicalStaffSurveyResponse = new MedicalStaffSurveyResponse(response.BehaviorOfMedicalStaff, response.MedicalStaffProfessionalism, response.GettingAdviceByMedicalStaff, response.EaseInObtainingFollowUpInformation); DoctorSurveyResponse = new DoctorSurveyResponse(response.BehaviorOfDoctor, response.DoctorProfessionalism, response.GettingAdviceByDoctor, response.AvailabilityOfDoctor); HospitalSurveyResponse = new HospitalSurveyResponse(response.Nursing, response.Cleanliness, response.OverallRating, response.SatisfiedWithDrugAndInstrument); }