public ActionResult GetLevelJson(int enCode) { var data = CommConfigLogic.GetConfigListByCate(enCode); List <object> list = new List <object>(); foreach (var item in data) { list.Add(new { id = item.c_key, text = item.c_value }); } return(Content(list.ToJson())); }
public ActionResult Index() { var list = CommConfigLogic.GetConfigListByCate((int)ConfigCategory.HPConfig).ToList(); foreach (var item in list) { item.c_value = ConfigurationManager.AppSettings["ProductImagePath"] + item.c_value; } int[] spanKeys = new int[4] { 1, 2, 3, 4 }; ViewBag.spanList = list.Where(f => spanKeys.Contains((int)f.c_key)).ToList(); ViewBag.IntroImage = list.Where(f => f.c_key == 5).First().c_value; return(View()); }