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); }
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); } } }
static public AFCoreEx.AFIDataList.Var_Data PBPropertyToData(AFMsg.PBNodeData xDataNode) { AFCoreEx.AFIDataList.Var_Data xData = new AFCoreEx.AFIDataList.Var_Data(); xData.nType = (AFIDataList.VARIANT_TYPE)xDataNode.DataType; switch (xData.nType) { case AFIDataList.VARIANT_TYPE.VTYPE_BOOLEAN: { xData.mData = xDataNode.VariantData.BoolValue; } break; case AFIDataList.VARIANT_TYPE.VTYPE_INT: { xData.mData = xDataNode.VariantData.IntValue; } break; case AFIDataList.VARIANT_TYPE.VTYPE_INT64: { xData.mData = xDataNode.VariantData.Int64Value; } break; case AFIDataList.VARIANT_TYPE.VTYPE_FLOAT: { xData.mData = xDataNode.VariantData.FloatValue; } break; case AFIDataList.VARIANT_TYPE.VTYPE_DOUBLE: { xData.mData = xDataNode.VariantData.DoubleValue; } break; case AFIDataList.VARIANT_TYPE.VTYPE_STRING: { xData.mData = xDataNode.VariantData.StrValue; } break; case AFIDataList.VARIANT_TYPE.VTYPE_OBJECT: { xData.mData = PBToAF(xDataNode.VariantData.GuidValue); } break; default: break; } return(xData); }
static public AFCoreEx.AFIDataList.Var_Data PBRecordToData(AFMsg.PBCellData xTableCellData, ref int nRow, ref int col) { AFCoreEx.AFIDataList.Var_Data xData = new AFCoreEx.AFIDataList.Var_Data(); nRow = xTableCellData.Row; col = xTableCellData.Col; switch ((AFIDataList.VARIANT_TYPE)xTableCellData.DataType) { case AFIDataList.VARIANT_TYPE.VTYPE_BOOLEAN: { xData.mData = xTableCellData.VariantData.BoolValue; } break; case AFIDataList.VARIANT_TYPE.VTYPE_INT: { xData.mData = xTableCellData.VariantData.IntValue; } break; case AFIDataList.VARIANT_TYPE.VTYPE_INT64: { xData.mData = xTableCellData.VariantData.Int64Value; } break; case AFIDataList.VARIANT_TYPE.VTYPE_FLOAT: { xData.mData = xTableCellData.VariantData.FloatValue; } break; case AFIDataList.VARIANT_TYPE.VTYPE_DOUBLE: { xData.mData = xTableCellData.VariantData.DoubleValue; } break; case AFIDataList.VARIANT_TYPE.VTYPE_STRING: { xData.mData = xTableCellData.VariantData.StrValue; } break; case AFIDataList.VARIANT_TYPE.VTYPE_OBJECT: { xData.mData = PBToAF(xTableCellData.VariantData.GuidValue); } break; } return(xData); }
private void EGMI_ACK_RECORD_DATA(MsgHead head, MemoryStream stream) { AFMsg.EntityDataTable recordData = ReceiveMsg(stream, EntityDataTable.Parser) as EntityDataTable; AFIObject go = AFCKernel.Instance.GetObject(PBToAF(recordData.EntityId)); AFIRecordManager recordManager = go.GetRecordManager(); AFIRecord record = recordManager.GetRecord(recordData.TableName); for (int i = 0; i < recordData.TableCellList.Count; i++) { int nRow = -1; int nCol = -1; AFCoreEx.AFIDataList.Var_Data xRowData = PBRecordToData(recordData.TableCellList[i], ref nRow, ref nCol); record.SetDataObject(nRow, nCol, xRowData); } }
public override bool SetDataObject(int nRow, int nCol, AFCoreEx.AFIDataList.Var_Data value) { if (nRow >= 0 && nRow < mnRow) { if (!mhtRecordVec.ContainsKey(nRow)) { AddRow(nRow); } AFIDataList valueList = (AFIDataList)mhtRecordVec[nRow]; if (valueList.GetType(nCol) == value.nType) { if (valueList.VarVal(nCol) != value) { AFCDataList oldValue = new AFCDataList(); AFCoreEx.AFIDataList.Var_Data xOld = valueList.VarVal(nCol); oldValue.AddDataObject(ref xOld); valueList.SetDataObject(nCol, value); AFCDataList newValue = new AFCDataList(); AFCoreEx.AFIDataList.Var_Data xNew = valueList.VarVal(nCol); newValue.AddDataObject(ref xNew); if (null != doHandleDel) { doHandleDel(mSelf, mstrRecordName, eRecordOptype.Updata, nRow, nCol, oldValue, newValue); } } else { return(false); } } return(true); } return(false); }
///////////////////////////////////////////////////////////////////// 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); } }
public abstract bool SetDataObject(int nRow, int nCol, AFCoreEx.AFIDataList.Var_Data value);