Ejemplo n.º 1
0
        // 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));
        }
Ejemplo n.º 2
0
 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"));
 }
Ejemplo n.º 3
0
        public void SetViewBag(long?selectedId = null)
        {
            var dao = new ManagerTopics();

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