コード例 #1
0
 public PartialViewResult Header()
 {
     ViewBag.Logo        = systemInfoDAO.GetLogo();
     ViewBag.TopMenus    = menuDAO.GetTopMenus();
     ViewBag.Categories  = productCategoryDAO.GetAll();
     ViewBag.SocialLinks = systemInfoDAO.GetSocialLink();
     return(PartialView("Header"));
 }
コード例 #2
0
ファイル: ProductController.cs プロジェクト: quantrandev/app
        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());
        }
コード例 #3
0
        public void setViewBagForEdit(long?id = null)
        {
            var dao = new ProductCategoryDAO();

            ViewBag.ListProductCategory = new SelectList(dao.GetAll(), "ID", "Name", id);
        }
コード例 #4
0
 /// <summary>
 /// 获取所有实例
 /// </summary>
 /// <returns></returns>
 public ProductCategoryEntity[] GetAll()
 {
     return(_currentDAO.GetAll());
 }
コード例 #5
0
        // GET: Admin/ProductCategory
        public ActionResult Index()
        {
            var categories = productCategoryDAO.GetAll();

            return(View(categories));
        }