Пример #1
0
        public ActionResult studentclasses()
        {
            var currentUserId = (TheLearningCenter.WebSite.Models.UserModel)Session["User"];

            if (Session["User"] != null)
            {
                var classes = enrollmentManager.GetAll(currentUserId.UserId)
                              .Select(t =>
                                      new TheLearningCenter.WebSite.Models.ClassModel
                                      (
                                          t.ClassID,
                                          t.ClassName,
                                          t.ClassDescription,
                                          t.ClassPrice
                                      )).ToArray();

                var model = new TheLearningCenter.WebSite.Models.ClassPageModel {
                    Classes = classes
                };

                return(View(model));
            }

            return(RedirectToAction("Login"));
        }
Пример #2
0
        public ActionResult classlist()
        {
            var classes = classManager.Classes
                          .Select(t =>
                                  new TheLearningCenter.WebSite.Models.ClassModel
                                      (t.ClassID,
                                      t.ClassName,
                                      t.ClassDescription,
                                      t.ClassPrice
                                      )).ToArray();

            var model = new TheLearningCenter.WebSite.Models.ClassPageModel {
                Classes = classes
            };

            return(View(model));
        }