Exemplo n.º 1
0
 public PartialViewResult Header()
 {
     ViewBag.Logo        = systemInfoDAO.GetLogo();
     ViewBag.TopMenus    = menuDAO.GetTopMenus();
     ViewBag.Categories  = productCategoryDAO.GetAll();
     ViewBag.SocialLinks = systemInfoDAO.GetSocialLink();
     return(PartialView("Header"));
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 获取所有实例
 /// </summary>
 /// <returns></returns>
 public ProductCategoryEntity[] GetAll()
 {
     return(_currentDAO.GetAll());
 }
Exemplo n.º 5
0
        // GET: Admin/ProductCategory
        public ActionResult Index()
        {
            var categories = productCategoryDAO.GetAll();

            return(View(categories));
        }