Пример #1
0
 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());
 }
Пример #2
0
        public ActionResult GetLevels()
        {
            var levels = new Model.Def.DefBuyLevel().GetBuyLevels();

            return(SuccessResult(levels));
        }