当前位置: 首页>>代码示例>>C#>>正文


C# Business.FindBasicTerm方法代码示例

本文整理汇总了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;
        }
开发者ID:dlnuckolls,项目名称:glorykidd-public,代码行数:70,代码来源:ManagedItemLoad.aspx.cs


注:本文中的Business.FindBasicTerm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。