public async Task <IActionResult> register() { List <config_file_first_kindModel1> list = icftkb.SelectYiJiJG(); List <SelectListItem> list2 = new List <SelectListItem>(); foreach (var item in list) { list2.Add(new SelectListItem { Text = item.first_kind_name, Value = item.first_kind_id.ToString() + "," + item.first_kind_name }); } ViewBag.a = list2; List <config_file_second_kindModel1> list3 = icftkb.SelectErJiJG(); List <SelectListItem> list4 = new List <SelectListItem>(); foreach (var item in list3) { list4.Add(new SelectListItem { Text = item.second_kind_name, Value = item.second_kind_id.ToString() + "," + item.second_kind_name }); } ViewBag.b = list4; return(View()); }
//二级查询 public IActionResult ErJi(string id) { List <config_file_second_kindModel1> list = icftkb.SelectErJiJG().Where(e => e.first_kind_id == id).ToList(); return(Content(JsonConvert.SerializeObject(list))); }