using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Weee.DAL { public abstract class ParameterBuilder { protected List CunstructMultiNames(List TwNames, List CNNames, List ENNames) { var result = new List() { }; if (TwNames == null && CNNames == null && ENNames == null) return result; if (TwNames == null) TwNames = new List(); if (CNNames == null) CNNames = new List(); if (ENNames == null) ENNames = new List(); var max = TwNames.Count() > CNNames.Count() ? TwNames.Count() : CNNames.Count(); max = max > ENNames.Count() ? max : ENNames.Count(); for (int i = 0; i < max; i++) { var defaultname = TwNames.Count() > i ? TwNames[i] : null; defaultname = defaultname ?? (CNNames.Count() > i ? CNNames[i] : null); defaultname = defaultname ?? (ENNames.Count() > i ? ENNames[i] : null); result.Add(new MultiName() { TWName = TwNames.Count() > i ? TwNames[i] : defaultname, CNName = CNNames.Count() > i ? CNNames[i] : defaultname, ENName = ENNames.Count() > i ? ENNames[i] : defaultname }); } return result; } protected struct MultiName { public string TWName; public string CNName; public string ENName; } } }