コード例 #1
0
        public ActionResult Update(int id)
        {
            GoodsManager bll  = new GoodsManager();
            var          info = bll.GetByPK(id);


            Goods_TypeManager bll_Type = new Goods_TypeManager();
            var list = bll_Type.GetAll();

            ViewBag.GoodsTypes = new SelectList(list, "TypeId", "TypeName", info.TypeId);
            ViewBag.TypeId     = new SelectList(list, "TypeId", "TypeName", info.TypeId);

            return(PartialView(info));
        }
コード例 #2
0
        public IHttpActionResult GetByPK(int id)
        {
            GoodsManager bll   = new GoodsManager();
            var          info  = bll.GetByPK(id);
            var          info1 = new
            {
                info.GoodsId,
                info.GoodsName,
                info.Num,
                info.Price,
                info.TypeId,
                info.Goods_Type.TypeName
            };

            return(Json(info1));
        }