Exemplo n.º 1
0
        // GET: Staff/Course
        public ActionResult Index(string searchString, int page = 1, int pageSize = 10)
        {
            var course = new ManagerCourse();
            var model  = course.ListAllPaging(searchString, page, pageSize);

            ViewBag.SearchString = searchString;
            return(View(model));
        }
Exemplo n.º 2
0
 public ActionResult Create(Course course)
 {
     if (ModelState.IsValid)
     {
         var  managercourse = new ManagerCourse();
         long id            = managercourse.Insert(course);
         if (id > 0)
         {
             return(RedirectToAction("Index", "Course"));
         }
         else
         {
             ModelState.AddModelError("", "Add user access");
         }
     }
     return(View("Index"));
 }
Exemplo n.º 3
0
        public void SetViewBag1(long?selectedId = null)
        {
            var dao = new ManagerCourse();

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