Esempio n. 1
0
        // GET api/<controller>
        public IEnumerable <Session> Get()
        {
            //Get Session Manager
            ScheduleManager sessMgr = new ScheduleManager();

            //Get All Sessions
            var allSessions = sessMgr.GetAllSessions();

            //Return all Sessions
            return(allSessions);
        }
Esempio n. 2
0
        // GET: Schedule
        public ActionResult Index()
        {
            //Build ScheduleManager
            ScheduleManager schMgr = new ScheduleManager();

            //Get Sessions from Manager
            IQueryable <Session> allSessions;

            allSessions = schMgr.GetAllSessions();

            //Build ViewModels of Sessions
            List <SessionViewModel> sessionVM = new List <SessionViewModel>();

            foreach (Session p in allSessions)
            {
                sessionVM.Add(new SessionViewModel(p));
            }

            //Send Session View Models to View
            return(View(sessionVM));
        }