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)); }
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)); }