Пример #1
0
 /// <summary>
 /// 设置工序自定义属性。
 /// </summary>
 /// <param name="dtAttribute">包含工序自定义属性数据的数据表。</param>
 internal void SetOperationUDAs(DataTable dt)
 {
     try
     {
         if (dt != null)
         {
             foreach (DataRow dr in dt.Rows)
             {
                 string linkedToItemKey = dr[POR_ROUTE_OPERATION_ATTR_FIELDS.FIELD_OPERATION_VER_KEY].ToString();
                 string attributeKey    = dr[BASE_ATTRIBUTE_FIELDS.FIELDS_ATTRIBUTE_KEY].ToString();
                 string attributeName   = dr[BASE_ATTRIBUTE_FIELDS.FIELDS_ATTRIBUTE_NAME].ToString();
                 string attributeValue  = string.Empty;
                 if (attributeName == COMMON_NAMES.LINKED_ITEM_EDC)
                 {
                     attributeValue = ConvertEdcKeyOrName(dr[POR_ROUTE_OPERATION_ATTR_FIELDS.FIELD_ATTRIBUTE_VALUE].ToString(), "O");
                 }
                 else
                 {
                     attributeValue = dr[POR_ROUTE_OPERATION_ATTR_FIELDS.FIELD_ATTRIBUTE_VALUE].ToString();
                 }
                 UserDefinedAttr uda = new UserDefinedAttr(linkedToItemKey, attributeKey, attributeName, attributeValue, "");
                 uda.DataType        = dr[BASE_ATTRIBUTE_FIELDS.FIELDS_DATA_TYPE].ToString();
                 uda.OperationAction = OperationAction.Update;
                 _operationUDAs.UserDefinedAttrAdd(uda);
             }
         }
     }
     catch (Exception ex)
     {
         this.ErrorMsg = ex.Message;
         MessageService.ShowError(ex);
     }
 }
Пример #2
0
 /// <summary>
 /// 设置工步的自定义属性。
 /// </summary>
 /// <param name="dtAttribute">包含自定义属性数据的数据行。</param>
 internal void SetStepUDAs(DataRow dataRow)
 {
     try
     {
         string linkedToItemKey = dataRow[POR_ROUTE_STEP_ATTR_FIELDS.FIELD_ROUTE_STEP_KEY].ToString();
         string attributeKey    = dataRow[BASE_ATTRIBUTE_FIELDS.FIELDS_ATTRIBUTE_KEY].ToString();
         string attributeName   = dataRow[BASE_ATTRIBUTE_FIELDS.FIELDS_ATTRIBUTE_NAME].ToString();
         string attributeValue  = string.Empty;
         if (attributeName == COMMON_NAMES.LINKED_ITEM_EDC)
         {
             attributeValue = ConvertEdcKeyOrName(dataRow[POR_ROUTE_STEP_ATTR_FIELDS.FIELD_ATTRIBUTE_VALUE].ToString(), "O");
         }
         else
         {
             attributeValue = dataRow[POR_ROUTE_STEP_ATTR_FIELDS.FIELD_ATTRIBUTE_VALUE].ToString();
         }
         UserDefinedAttr uda = new UserDefinedAttr(linkedToItemKey, attributeKey, attributeName, attributeValue, "");
         uda.DataType        = dataRow[BASE_ATTRIBUTE_FIELDS.FIELDS_DATA_TYPE].ToString();
         uda.OperationAction = OperationAction.Update;
         _stepUDAs.UserDefinedAttrAdd(uda);
     }
     catch (Exception ex)
     {
         MessageService.ShowError(ex);
     }
 }
Пример #3
0
 private void SetObjUda(DataTable objUdaTable)
 {
     foreach (DataRow dataRow in objUdaTable.Rows)
     {
         string          linkedObjKey   = dataRow[objUdaTable.Columns[COMPUTER_ATTR_FIELDS.FIELDS_COMPUTER_KEY]].ToString();
         string          attributeKey   = dataRow[objUdaTable.Columns[COMPUTER_ATTR_FIELDS.FIELDS_ATTRIBUTE_KEY]].ToString();
         string          attributeName  = dataRow[objUdaTable.Columns[COMPUTER_ATTR_FIELDS.FIELDS_ATTRIBUTE_NAME]].ToString();
         string          attributeValue = dataRow[objUdaTable.Columns[COMPUTER_ATTR_FIELDS.FIELDS_ATTRIBUTE_VALUE]].ToString();
         UserDefinedAttr uda            = new UserDefinedAttr(linkedObjKey, attributeKey, attributeName, attributeValue, "");
         uda.DataType        = dataRow[objUdaTable.Columns["DATA_TYPE"]].ToString();
         uda.OperationAction = OperationAction.Update;
         _UDAs.UserDefinedAttrAdd(uda);
     }
 }