예제 #1
0
        public SessionClassController(ISessionClassService SessionClassService, ISessionTopicService SessionTopicService, ISessionRoomService SessionRoomService)
        {
            _SessionClassService = SessionClassService;
            _SessionTopicService = SessionTopicService;
            _SessionRoomService  = SessionRoomService;

            var topics = _SessionTopicService.GetAll();

            foreach (var t in topics)
            {
                topicItems.Add(new SelectListItem()
                {
                    Text = t.Name, Value = t.Id.ToString()
                });
            }

            ViewBag.topicItems = topicItems;

            var rooms = _SessionRoomService.GetAll();

            foreach (var t in rooms)
            {
                roomItems.Add(new SelectListItem()
                {
                    Text = t.Name, Value = t.Id.ToString()
                });
            }

            ViewBag.roomItems = roomItems;
        }
예제 #2
0
 public void Initialize()
 {
     _mockRepository   = new Mock <ISessionTopicRepository>();
     _mockUnitWork     = new Mock <IUnitOfWork>();
     _service          = new SessionTopicService(_mockUnitWork.Object, _mockRepository.Object);
     listSessionTopics = new List <SessionTopic>()
     {
         new SessionTopic()
         {
             Name = "XML"
         },
         new SessionTopic()
         {
             Name = "HTML"
         },
         new SessionTopic()
         {
             Name = "JavaScript"
         }
     };
 }
예제 #3
0
 public SessionTopicController(ISessionTopicService SessionTopicService)
 {
     _SessionTopicService = SessionTopicService;
 }