예제 #1
0
        public List <FeedbackQuestionDTO> GetAllQuestions()
        {
            try
            {
                FeedBackQuestionRepository feedBackQuestionRepository = new FeedBackQuestionRepository();
                List <FeedbackQuestion>    questions = feedBackQuestionRepository.GetQuestions();

                var config = new MapperConfiguration(cfg =>
                {
                    cfg.CreateMap <FeedbackQuestionDTO, FeedbackQuestion>();
                });
                IMapper iMapper = config.CreateMapper();
                return(iMapper.Map <List <FeedbackQuestion>, List <FeedbackQuestionDTO> >(questions));
            }
            catch (Exception ex)
            {
                ExceptionLogger logger = new ExceptionLogger()
                {
                    ControllerName      = "Question",
                    ActionrName         = "GetAllQuestions()",
                    ExceptionMessage    = ex.Message,
                    ExceptionStackTrace = ex.StackTrace,
                    LogDateTime         = DateTime.Now
                };
                ExceptionRepository exceptionRepository = new ExceptionRepository();
                exceptionRepository.AddException(logger);
                throw ex;
            }
        }
예제 #2
0
 public ExcelReport()
 {
     eventRepository = new EventRepository();
     RegisteredVolunteerFeedbackRepository   = new RegisteredVolunteerFeedbackRepository();
     notAttendedVolunteerFeedbackRepository  = new NotAttendedVolunteerFeedbackRepository();
     unRegisteredVolunteerFeedbackRepository = new UnRegisteredVolunteerFeedbackRepository();
     feedBackQuestionRepository = new FeedBackQuestionRepository();
 }