本文整理汇总了C#中Business.FindComplexList方法的典型用法代码示例。如果您正苦于以下问题:C# Business.FindComplexList方法的具体用法?C# Business.FindComplexList怎么用?C# Business.FindComplexList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Business
的用法示例。
在下文中一共展示了Business.FindComplexList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetComplexListValues
private List<string> SetComplexListValues(Business.ManagedItem managedItem, string complexListName, DataTable dtExcelData, DataRow row, bool firstRow)
{
List<string> errors = new List<string>();
Business.ComplexList complexList = managedItem.FindComplexList(complexListName) as Business.ComplexList;
if (complexList != null)
{
try
{
if (firstRow)
complexList.Clear();
Dictionary<string /*FieldName*/, string /*FieldValue*/> fieldValues = new Dictionary<string, string>();
foreach (DataColumn col in dtExcelData.Columns)
{
if (SkipColumn(col.ColumnName))
continue;
if (fieldValues.ContainsKey(col.ColumnName))
throw new Exception(string.Format("Field {0} is repeated", col.ColumnName));
fieldValues.Add(col.ColumnName, row[col.ColumnName].ToString());
}
complexList.Load(fieldValues);
}
catch (Exception ex)
{
errors.Add(string.Format("Load of complex list {0} threw exception: {1}.", complexList.Name, ex.Message));
}
}
else
{
errors.Add(string.Format("Unable to find complex list {0}.", complexListName));
}
if (errors.Count == 0)
managedItem.Update(false, Business.Retro.AuditType.Saved);
return errors;
}
示例2: NullOutTerm
private static void NullOutTerm(Business.ManagedItem managedItem, List<string> undefinedColumns, DataColumn col, Business.Term term)
{
if (term != null)
{
term.Clear();
}
else
{
Business.Term complexList = managedItem.FindComplexList(col.ColumnName);
if (complexList != null)
{
complexList.Clear();
}
else
{
undefinedColumns.Add(string.Format("'{0}'", col.ColumnName));
}
}
}