Exemple #1
0
        private void ADD_ROW(AFCoreEx.AFIDENTID self, string strRecordName, AFMsg.DataTableAddRow xAddStruct)
        {
            AFIObject        go             = AFCKernel.Instance.GetObject(self);
            AFIRecordManager xRecordManager = go.GetRecordManager();


            Hashtable recordVecDesc = new Hashtable();
            Hashtable recordVecData = new Hashtable();

            AFCoreEx.AFCDataList RowList     = new AFCDataList();
            AFCoreEx.AFIDataList varListDesc = new AFCDataList();
            for (int k = 0; k < xAddStruct.CellList.Count; ++k)
            {
                AFMsg.PBCellData addStruct = (AFMsg.PBCellData)xAddStruct.CellList[k];
                if (addStruct.Col >= 0)
                {
                    int nRow = -1;
                    int nCol = -1;
                    AFCoreEx.AFIDataList.Var_Data xRowData = PBRecordToData(addStruct, ref nRow, ref nCol);
                    RowList.AddDataObject(ref xRowData);
                    varListDesc.AddDataObject(ref xRowData);
                }
            }

            AFIRecord xRecord = xRecordManager.GetRecord(strRecordName);

            if (null == xRecord)
            {
                xRecord = xRecordManager.AddRecord(strRecordName, 512, varListDesc);
            }

            xRecord.AddRow(xAddStruct.Row, RowList);
        }
Exemple #2
0
        private void EGMI_ACK_OBJECT_PROPERTY_ENTRY(MsgHead head, MemoryStream stream)
        {
            AFMsg.MultiEntityDataNodeList xMultiObjectPropertyList = MultiEntityDataNodeList.Parser.ParseFrom(stream);
            // ReceiveMsg(stream, ref xMultiObjectPropertyList);

            for (int i = 0; i < xMultiObjectPropertyList.MultiEntityDataNodeList_.Count; i++)
            {
                AFMsg.EntityDataNodeList xPropertyData = xMultiObjectPropertyList.MultiEntityDataNodeList_[i];
                AFIObject          go = AFCKernel.Instance.GetObject(PBToAF(xPropertyData.EntityId));
                AFIPropertyManager xPropertyManager = go.GetPropertyManager();

                for (int j = 0; j < xPropertyData.DataNodeList.Count; j++)
                {
                    string strPropertyName = xPropertyData.DataNodeList[j].NodeName;

                    AFCoreEx.AFIDataList.Var_Data xPropertyValue = PBPropertyToData(xPropertyData.DataNodeList[j]);
                    AFIProperty xProperty = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        AFIDataList varList = new AFCDataList();
                        varList.AddDataObject(ref xPropertyValue);

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetDataObject(ref xPropertyValue);
                }
            }
        }
Exemple #3
0
        /////////////////////////////////////////////////////////////////////
        private void EGMI_ACK_PROPERTY_DATA(MsgHead head, MemoryStream stream)
        {
            AFMsg.EntityDataNode propertyData = ReceiveMsg(stream, EntityDataNode.Parser) as EntityDataNode;


            AFIObject          go = AFCKernel.Instance.GetObject(PBToAF(propertyData.EntityId));
            AFIPropertyManager propertyManager = go.GetPropertyManager();

            for (int i = 0; i < propertyData.DataNodeList.Count; i++)
            {
                AFCoreEx.AFIDataList.Var_Data xData = PBPropertyToData(propertyData.DataNodeList[i]);
                AFIProperty property = propertyManager.GetProperty(propertyData.DataNodeList[i].NodeName);
                if (null == property)
                {
                    AFIDataList varList = new AFCDataList();
                    varList.AddDataObject(ref xData);

                    property = propertyManager.AddProperty(propertyData.DataNodeList[i].NodeName, varList);
                }

                property.SetDataObject(ref xData);
            }
        }