zoukankan      html  css  js  c++  java
  • Example of Fixed Asset Service Operations

    using System;
    using System.Collections.Generic;
    using System.Text;
    
    namespace AssetFixedAssetTest
    {
        class Test
        {
            static void Main()
            {
                AssetFixedAssetServiceClient client = new AssetFixedAssetServiceClient();
                QueryCriteria queryCriteria = new QueryCriteria();
                AxdFixedAsset axdFA = new AxdFixedAsset();
                EntityKey[] entityKeyList = new EntityKey[1];
    
                //Set up query criteria for find.
                queryCriteria.CriteriaElement = new CriteriaElement[1];
                queryCriteria.CriteriaElement[0] = new CriteriaElement();
                queryCriteria.CriteriaElement[0].DataSourceName = "AssetTable";
                queryCriteria.CriteriaElement[0].FieldName = "AssetId";
                queryCriteria.CriteriaElement[0].Operator = Operator.Equal;
                queryCriteria.CriteriaElement[0].Value1 = "CNC-01";
    
                // Use the 'client' variable to call operations on the service.            
                axdFA = client.find(queryCriteria);
                
                axdFA.AssetTable[0].Name = "Copy of CNC-01";
                axdFA.AssetTable[0].AssetId = null;
    
                //Create a new asset.
                client.create(axdFA);
                
                //Set up entity key.
                entityKeyList[0] = new EntityKey();
                entityKeyList[0].KeyData = new KeyField[1];
                entityKeyList[0].KeyData[0] = new KeyField();
                entityKeyList[0].KeyData[0].Field = "AssetId";
                entityKeyList[0].KeyData[0].Value = "CNC-01";            
    
                //Update the Name field.            
                axdFA = client.find(queryCriteria);
                axdFA.AssetTable[0].Name = "Updated Name";
                client.update(entityKeyList, axdFA);                       
    
                // Always close the client.       
                client.Close();
                
            }
        }
    }
  • 相关阅读:
    四、git学习之——分支管理、解决冲突
    四、git学习之——远程仓库
    异常
    内部类
    接口
    Java三大特性之多态
    抽象类、抽象方法、final、Object类
    Java三大特性之继承
    Java三大特性之封装
    代码块、Package、Import
  • 原文地址:https://www.cnblogs.com/rumenren/p/5320105.html
Copyright © 2011-2022 走看看