Esempio n. 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));
        }
Esempio n. 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"));
 }
Esempio n. 3
0
        public void SetViewBag(long?selectedId = null)
        {
            var dao = new CategoryCourseDao();

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