Пример #1
0
 public void GetMediaTree(LinkItemTree item, int pid)
 {
     if (MediaCateService.GetALL().Any(x => x.PID == pid))
     {
         var query = MediaCateService.GetALL().Where(x => x.PID == pid);
         item.Children = query.Select(x => new LinkItemTree()
         {
             Text = x.CateName,
             Value = x.ID,
             Code = x.Code
         }).ToList();
         foreach (var citem in item.Children)
         {
             GetMediaTree(citem, citem.Value);
         }
     }
 }
Пример #2
0
 public void GetCityTree(LinkItemTree item, int pid)
 {
     //if (CityCateService.GetALL().Any(x => x.PID == pid))
     //{
     var query = CityCateService.GetALL().Where(x => x.PID == pid);
     item.Children = query.Select(x => new LinkItemTree()
     {
         Text = x.CateName,
         Value = x.ID,
         Code = x.Code
     }).ToList();
     //    foreach (var citem in item.Children)
     //    {
     //        GetCityTree(citem, citem.Value);
     //    }
     //}
 }