public ActionResult Index() { CatDao dao = new CatDao(); var model = dao.GetList().ToList(); return(View(model)); }
public void setViewBag(int?catid = null) { CatDao dao = new CatDao(); ViewBag.CatID = new SelectList(dao.GetList(), "CatID", "CatName", catid); }