예제 #1
0
        // GET: Staff/CategoryCourse
        public ActionResult Index(int page = 1, int pageSize = 10)
        {
            var category = new CategoryCourseDao();
            var model    = category.ListAllPaging(page, pageSize);

            return(View(model));
        }
예제 #2
0
 public ActionResult Create(CourseCategory coursecategory)
 {
     if (ModelState.IsValid)
     {
         var  coursecategorydao = new CategoryCourseDao();
         long id = coursecategorydao.Insert(coursecategory);
         if (id > 0)
         {
             return(RedirectToAction("Index", "CategoryCourse"));
         }
         else
         {
             ModelState.AddModelError("", "Add CategoryCourse access");
         }
     }
     return(View("Index"));
 }
예제 #3
0
        public void SetViewBag(long?selectedId = null)
        {
            var dao = new CategoryCourseDao();

            ViewBag.IdCategoryCourse = new SelectList(dao.ListAll(), "ID", "Name", selectedId);
        }