// GET: Staff/Topic public ActionResult Index(int page = 1, int pageSize = 10) { var topic = new ManagerTopics(); var model = topic.ListAllPaging(page, pageSize); return(View(model)); }
public ActionResult Create(Topic topic) { if (ModelState.IsValid) { var managertopic = new ManagerTopics(); long id = managertopic.Insert(topic); if (id > 0) { return(RedirectToAction("Index", "Topic")); } else { ModelState.AddModelError("", "Add topic access"); } } return(View("Index")); }
public void SetViewBag(long?selectedId = null) { var dao = new ManagerTopics(); ViewBag.IdTopic = new SelectList(dao.ListAll(), "ID", "Name", selectedId); }