Example #1
0
        public ActionResult AddClass(int userId)
        {
            SchoolhubDb      db    = new SchoolhubDb();
            TeacherHomeModel model = new TeacherHomeModel();
            User             user  = new User();

            user.Id       = userId;
            model.User    = user;
            model.Schools = db.GetAllSchools();

            return(View(model));
        }
Example #2
0
        // GET: TeacherHome
        // View(model) returns a user with an id, username, etc.
        public ActionResult TeacherHomeIndex(int userId)
        {
            SchoolhubDb db   = new SchoolhubDb();
            User        user = db.GetUserByUserId(userId);

            TeacherHomeModel model = new TeacherHomeModel
            {
                Classes = db.GetClassesByTeacherId(user.Id),
                Events  = new List <Event>(),
                Schools = new List <SelectItem>(),
                User    = user
            };

            return(View(model));
        }