for (int i = 0; i < list.Count; i++)
{
foreach (JhoutpatCpNodeVsParent l in list)
{
if (list[i].ParentId == "" || list[i].ParentId == null)
{
list[i].ParentId = "0";
newlist.Add(list[i]);
break;
}
if (i > 0)
{
string a = (i - 1).ToString();
JhoutpatCpNodeVsParent model = newlist.Where(q => q.ParentId == a).FirstOrDefault();
if (model == null)
{
break;
}
var s = list.Where(x => x.ParentId == model.NodeId).FirstOrDefault();
if (s != null)
{
s.ParentId = i.ToString();
newlist.Add(s);
break;
}
}
}
DataRow[] ret = patientNodeIds.Select("NODEID='" + newlist[i].NodeId + "'");
}
list 排序 不规则model字段排序
最新推荐文章于 2023-01-13 15:30:54 发布