public PartialViewResult Header() { ViewBag.Logo = systemInfoDAO.GetLogo(); ViewBag.TopMenus = menuDAO.GetTopMenus(); ViewBag.Categories = productCategoryDAO.GetAll(); ViewBag.SocialLinks = systemInfoDAO.GetSocialLink(); return(PartialView("Header")); }
public ActionResult Create() { var productCategories = productCategoryDAO.GetAll(); //categories selectlist var categorySelectList = new MySelectList() { FormElementName = "CategoryId" }; foreach (var item in productCategories) { categorySelectList.Items.Add(new MySelectListItem() { Id = item.Id.ToString(), Name = item.Name }); } ViewBag.Categories = categorySelectList; return(View()); }
public void setViewBagForEdit(long?id = null) { var dao = new ProductCategoryDAO(); ViewBag.ListProductCategory = new SelectList(dao.GetAll(), "ID", "Name", id); }
/// <summary> /// 获取所有实例 /// </summary> /// <returns></returns> public ProductCategoryEntity[] GetAll() { return(_currentDAO.GetAll()); }
// GET: Admin/ProductCategory public ActionResult Index() { var categories = productCategoryDAO.GetAll(); return(View(categories)); }