本文整理汇总了C#中Business.FindBasicTerm方法的典型用法代码示例。如果您正苦于以下问题:C# Business.FindBasicTerm方法的具体用法?C# Business.FindBasicTerm怎么用?C# Business.FindBasicTerm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Business
的用法示例。
在下文中一共展示了Business.FindBasicTerm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetValues
private List<string> SetValues(Business.ManagedItem managedItem, DataTable dtExcelData, DataRow row)
{
DataRow rowPattern = dtExcelData.Rows[_ROW_SECONDARY_COLUMN_HEADINGS];
List<string> errors = new List<string>();
string activeWorkflow = row[_COL_ACTIVE_WF].ToString();
string activeWorkflowState = row[_COL_ACTIVE_WF_STATE].ToString();
if (!(string.IsNullOrEmpty(activeWorkflow) && string.IsNullOrEmpty(activeWorkflowState)))
{
if (string.IsNullOrEmpty(activeWorkflow) || string.IsNullOrEmpty(activeWorkflowState))
errors.Add("Both the ActiveWorkflow and the ActiveWorkflowState must be provided. ");
else
{
Business.Workflow workflow = managedItem.FindWorkflow(activeWorkflow);
if (workflow == null)
errors.Add(string.Format("The provided workflow '{0}' is not defined. ", activeWorkflow));
else
{
Business.State state = workflow.FindState(activeWorkflowState);
if (state == null)
errors.Add(string.Format("The provided ActiveWorkflowState '{0}' is not defined. ", activeWorkflowState));
else
{
managedItem.ActiveWorkflowID = workflow.ID;
managedItem.State = state;
}
}
}
}
List<string> undefinedColumns = new List<string>();
foreach (DataColumn col in dtExcelData.Columns)
{
if (SkipColumn(col.ColumnName))
continue;
string rowColumnValue = row[col.ColumnName].ToString();
if (rowColumnValue.Trim().Equals(_ROW_COL_NO_CHANGE))
continue;
if (IsEventColumn(col.ColumnName))
{
SetEvent(managedItem, rowPattern, errors, col, rowColumnValue);
}
else
{
Business.Term term = managedItem.FindBasicTerm(col.ColumnName);
if (term != null)
{
if (rowColumnValue.Trim().Equals(_ROW_TERM_NULLED_OUT))
{
NullOutTerm(managedItem, undefinedColumns, col, term);
}
else
SetTermValue(rowPattern, errors, col, term, rowColumnValue, row);
}
else
{
errors.Add(string.Format("Term {0} not found", col.ColumnName));
}
}
}
if (undefinedColumns.Count > 0)
errors.Add(string.Format("The following columns are not defined: {0}. ", string.Join(",", undefinedColumns.ToArray()).TrimEnd(',')));
return errors;
}