Пример #1
0
        //
        // GET: /SysSub/Create

        public ActionResult Create()
        {
            SysProductLogic productLogic = new SysProductLogic();
            var             productList  = productLogic.GetProductList().ToList <SysProductEntity>();

            this.ViewBag.ProductId = new SelectList(productList, "ProductId", "ProductName");

            return(View());
        }
Пример #2
0
        //
        // GET: /SysSub/Edit/5

        public ActionResult Edit(int id)
        {
            var             model        = logic.GetSubSystemInfo(id);
            SysProductLogic productLogic = new SysProductLogic();
            var             productList  = productLogic.GetProductList().ToList <SysProductEntity>();

            this.ViewBag.ProductId = new SelectList(productList, "ProductId", "ProductName", model.ProductId);
            return(View(model));
        }
Пример #3
0
        //
        // GET: /SysSub/

        public ActionResult Index(string productName = "", int productId = -1, int pageIndex = 1)
        {
            PageItem pageItem = new PageItem {
                PageIndex = pageIndex, PageSize = 15
            };

            List <SysProductEntity> productList = new SysProductLogic().GetProductList().ToList <SysProductEntity>();

            ViewBag.DictionaryProduct = productList.ToDictionary(k => k.ProductId, v => v);

            productList.Insert(0, new SysProductEntity {
                ProductId = -1, ProductName = "全部"
            });
            ViewBag.ProductId = new SelectList(productList, "ProductId", "ProductName");

            List <SysSubEntity> subSystemList = logic.GetSubSystemList(productId, productName, pageItem).ToList <SysSubEntity>();

            ViewBag.SubSystemList = new PagedList <SysSubEntity>(subSystemList, pageItem.PageIndex, pageItem.PageSize, pageItem.TotalCount);
            return(View());
        }