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_ADD_ROW(MsgHead head, MemoryStream stream) { AFMsg.EntityDataTableAddRow recordData = ReceiveMsg(stream, EntityDataTableAddRow.Parser) as EntityDataTableAddRow; AFIObject go = AFCKernel.Instance.GetObject(PBToAF(recordData.EntityId)); AFIRecordManager recordManager = go.GetRecordManager(); for (int i = 0; i < recordData.RowData.Count; i++) { ADD_ROW(PBToAF(recordData.EntityId), recordData.TableName, recordData.RowData[i]); } }
private void EGMI_ACK_SWAP_ROW(MsgHead head, MemoryStream stream) { AFMsg.EntityDataTableSwap recordData = ReceiveMsg(stream, EntityDataTableSwap.Parser) as EntityDataTableSwap; AFIObject go = AFCKernel.Instance.GetObject(PBToAF(recordData.EntityId)); AFIRecordManager recordManager = go.GetRecordManager(); AFIRecord record = recordManager.GetRecord(recordData.OriginTableName); //目前认为在同一张表中交换吧 record.SwapRow(recordData.RowOrigin, recordData.RowTarget); }
private void EGMI_ACK_REMOVE_ROW(MsgHead head, MemoryStream stream) { AFMsg.EntityDataTableRemove recordData = EntityDataTableRemove.Parser.ParseFrom(stream); //new AFMsg.ObjectRecordRemove(); // ReceiveMsg(stream, ref recordData); AFIObject go = AFCKernel.Instance.GetObject(PBToAF(recordData.EntityId)); AFIRecordManager recordManager = go.GetRecordManager(); AFIRecord record = recordManager.GetRecord(recordData.TableName); for (int i = 0; i < recordData.RemoveRow.Count; i++) { record.Remove(recordData.RemoveRow[i]); } }
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); } }