private static void AddBda(ServerModel.NodeDA listDa, string fcDa) { foreach (var listTempDa in ServerModel.ListTempDA) { if (listDa.TypeDA == listTempDa.NameTypeDA) { foreach (var tempDa in listTempDa.ListDA) { ServerModel.NodeDA da = new ServerModel.NodeDA(tempDa.NameDA, tempDa.FCDA ?? fcDa, tempDa.BTypeDA, tempDa.TypeDA, tempDa.TrgOpsDA, tempDa.CountDA); listDa.ListDA.Add(da); if (listDa.ListDA.Last().TypeDA != null) { AddBda(listDa.ListDA.Last(), da.FCDA); } } } } }
private static void AddDa(List <ServerModel.NodeDO> DO) { foreach (var tempDo in ServerModel.ListTempDO) { var tDo = DO.Last(); if (tDo.TypeDO == tempDo.NameDO) { tDo.SetTypeDO(tempDo.TypeDO); foreach (var tempDa in tempDo.ListDA) { ServerModel.NodeDA da = new ServerModel.NodeDA(tempDa.NameDA, tempDa.FCDA, tempDa.BTypeDA, tempDa.TypeDA, tempDa.TrgOpsDA, tempDa.CountDA) { Value = tempDa.Value }; DO.Last().ListDA.Add(da); if (DO.Last().ListDA.Last().TypeDA != null && DO.Last().ListDA.Last().BTypeDA != "Enum") { AddBda(DO.Last().ListDA.Last(), da.FCDA); } } foreach (var tempDoo in tempDo.ListDO) { ServerModel.NodeDO doo = new ServerModel.NodeDO(tempDoo.NameDO, tempDoo.TypeDO, tempDoo.DescDO) { }; DO.Last().ListDO.Add(doo); AddDa(DO.Last().ListDO); } break; } } }