Exemple #1
0
 private void SetObjUda(DataTable objUdaTable)
 {
     foreach (DataRow dataRow in objUdaTable.Rows)
     {
         string            linkedObjKey   = dataRow[objUdaTable.Columns[BASE_ATTRIBUTE_VALUE_FIELDS.FIELD_OBJECT_KEY]].ToString();
         string            attributeKey   = dataRow[objUdaTable.Columns[BASE_ATTRIBUTE_VALUE_FIELDS.FIELD_ATTRIBUTE_KEY]].ToString();
         string            attributeName  = dataRow[objUdaTable.Columns[BASE_ATTRIBUTE_VALUE_FIELDS.FIELD_ATTRIBUTE_NAME]].ToString();
         string            attributeValue = dataRow[objUdaTable.Columns[BASE_ATTRIBUTE_VALUE_FIELDS.FIELD_ATTRIBUTE_VALUE]].ToString();
         UserDefinedAttrEx uda            = new UserDefinedAttrEx(linkedObjKey, attributeKey, attributeName, attributeValue, "");
         uda.DataType        = dataRow[objUdaTable.Columns["DATA_TYPE"]].ToString();
         uda.OperationAction = OperationAction.Update;
         _UDAs.UserDefinedAttrAdd(uda);
     }
 }
Exemple #2
0
 public UserDefinedAttrsEx(DataTable table)
 {
     if (null == table || table.Columns.Count != 8)
     {
         throw (new Exception("UserDefinedAttrsEx::UserDefinedAttrsEx(DataTable)"));
     }
     foreach (DataRow dataRow in table.Rows)
     {
         string            linkedItemKey   = dataRow[table.Columns[COLUMN_OBJECT_KEY]].ToString();
         string            udaObjectType   = dataRow[table.Columns[COLUMN_OBJECT_TYPE]].ToString();
         string            udaKey          = dataRow[table.Columns[COLUMN_ATTRIBUTE_KEY]].ToString();
         string            udaName         = dataRow[table.Columns[COLUMN_ATTRIBUTE_NAME]].ToString();
         string            udaValue        = dataRow[table.Columns[COLUMN_ATTRIBUTE_VALUE]].ToString();
         string            udaEditor       = dataRow[table.Columns[COLUMN_EDITOR]].ToString();
         string            udaEditTime     = dataRow[table.Columns[COLUMN_EDIT_TIME]].ToString();
         string            udaEditTimeZone = dataRow[table.Columns[COLUMN_EDIT_TIMEZONE]].ToString();
         UserDefinedAttrEx uda             = new UserDefinedAttrEx(linkedItemKey, udaKey, udaName, udaValue, "");
         uda.OperationAction = OperationAction.Update;
         _udaList.Add(uda);
     }
 }
Exemple #3
0
        public bool UserDefinedAttrAdd(UserDefinedAttrEx uda)
        {
            foreach (UserDefinedAttrEx itemUDA in _udaList)
            {
                if (itemUDA.Key == uda.Key)
                {
                    if (OperationAction.Delete == itemUDA.OperationAction)
                    {
                        itemUDA.OperationAction = OperationAction.Modified;
                        itemUDA.Value           = "";
                        return(true);
                    }
                    return(false);
                }
            }

            if (OperationAction.None == uda.OperationAction)
            {
                uda.OperationAction = OperationAction.New;
            }
            _udaList.Add(uda);
            AddToInitDictionary(uda.Key, uda.Value);
            return(true);
        }
Exemple #4
0
 public bool UserDefinedAttrDelete(UserDefinedAttrEx uda)
 {
     return(UserDefinedAttrDelete(uda.Key));
 }