示例#1
0
        public ExamInstructionViewModel GetExamInstruction(string userId, string timeLookUp)
        {
            try
            {
                var timeObject      = _storedProcedure.GetTimeObject(timeLookUp);
                var instruction     = _storedProcedure.GetExamInstruction();
                var examInstruction = Mapper.Map <ExamInstruction, InstructionViewModel>(instruction);
                var examtimeObject  = Mapper.Map <ExamScheduleTime, TimeViewModel>(timeObject);

                var examTimeInstruction = new ExamInstructionViewModel()
                {
                    InstructionViewModel = examInstruction,
                    TimeViewModel        = examtimeObject
                };
                return(examTimeInstruction);
            }
            catch (Exception ex)
            {
                string errorMessage = "GetExamInstruction(): " + ex.Message;
                _unitOfWork.AuditTrail(errorMessage, userId);
                return(new ExamInstructionViewModel());
            }
        }