public ActionResult BuyNew() { using (EFContext db = new EFContext()) { db.Configuration.LazyLoadingEnabled = false;//禁用懒加载 var buyTypes = db.DefBuyType.ToList(); var buyLevels = new Model.Def.DefBuyLevel().GetBuyLevels(); ViewData["buyTypes"] = new SelectList(buyTypes.AsEnumerable(), "TypeName", "TypeName"); ViewData["buyLevels"] = new SelectList(buyLevels.AsEnumerable(), "BuyLevel", "BuyLevel"); } return(View()); }
public ActionResult GetLevels() { var levels = new Model.Def.DefBuyLevel().GetBuyLevels(); return(SuccessResult(levels)); }