DeleteSurvey() public method

Deletes the specified survey.
public DeleteSurvey ( int surveyId, int moduleId ) : void
surveyId int The ID of the survey to delete.
moduleId int The ID of the module in which to find the survey.
return void
        public void DeleteSurvey(int surveyId)
        {
            var surveyRepository = new SurveyRepository();
            var moduleId = surveyRepository.GetModuleIdForSurvey(surveyId);
            if (!this.CanEditModule(moduleId))
            {
                this.DenyAccess();
            }

            surveyRepository.DeleteSurvey(surveyId, moduleId);
        }