public override void Add(DataTable data) { if ((data != null) && (data.Rows.Count > 0)) { GpsDataTable table = new GpsDataTable(UpdataStruct.ColNameList); try { int num = 1; for (int i = 0; i <= (data.Rows.Count - 1); i++) { table.InsertRows(data.Rows[i].ItemArray); if ((num >= base._Size) || (i == (data.Rows.Count - 1))) { lock (base._PosList.SyncRoot) { base._PosList.Add(CompressHelper.CompressToSelf(table)); } table.Rows.Clear(); num = 0; } num++; } } catch (Exception exception) { ErrorMsg msg = new ErrorMsg("RemotingDataBS", "Add", exception.Message + exception.StackTrace); new LogHelper().WriteError(msg); base._PosList = new ArrayList(100); } } }
public GpsDataTable ConvertToBSDataTable(DataTable data) { if ((data == null) || (data.Rows.Count <= 0)) { return null; } GpsDataTable table = new GpsDataTable(UpdataStruct.ColNameList); for (int i = 0; i <= (data.Rows.Count - 1); i++) { table.InsertRows(data.Rows[i].ItemArray); } return table; }
public byte[] Area_getAllTreeInfoComPress() { try { DataSet allTreeInfo = new Area(this._OnlineUserInfo.UserId).GetAllTreeInfo(this._OnlineUserInfo.WorkId.ToString()); DataTable table = null; DataTable table2 = null; DataTable table3 = null; if ((allTreeInfo != null) && (allTreeInfo.Tables.Count > 0)) { table = allTreeInfo.Tables[0]; if (allTreeInfo.Tables.Count > 1) { table2 = allTreeInfo.Tables[1]; } if (allTreeInfo.Tables.Count > 2) { table3 = allTreeInfo.Tables[2]; } } List<GpsDataTable> list = new List<GpsDataTable>(); if (table != null) { Dictionary<string, int> columns = new Dictionary<string, int>(); for (int i = 0; i < table.Columns.Count; i++) { columns.Add(table.Columns[i].ColumnName, i); } GpsDataTable item = new GpsDataTable(columns); foreach (DataRow row in table.Rows) { item.InsertRows(row.ItemArray); } list.Add(item); } if (table2 != null) { Dictionary<string, int> dictionary2 = new Dictionary<string, int>(); for (int j = 0; j < table2.Columns.Count; j++) { dictionary2.Add(table2.Columns[j].ColumnName, j); } GpsDataTable table5 = new GpsDataTable(dictionary2); foreach (DataRow row2 in table2.Rows) { table5.InsertRows(row2.ItemArray); } list.Add(table5); } if (table3 != null) { Dictionary<string, int> dictionary3 = new Dictionary<string, int>(); for (int k = 0; k < table3.Columns.Count; k++) { dictionary3.Add(table3.Columns[k].ColumnName, k); } GpsDataTable table6 = new GpsDataTable(dictionary3); foreach (DataRow row3 in table3.Rows) { table6.InsertRows(row3.ItemArray); } list.Add(table6); } return CompressHelper.CompressToSelf(list); } catch (Exception exception) { ErrorMsg msg = new ErrorMsg("Alarm", "Area_getAllTreeInfo", exception.Message); this.m_LogHelper.WriteError(msg); return null; } }
public byte[] Updata_GetCarCurrentPosNotSelBSByCompress() { GpsDataTable table = new GpsDataTable(UpdataStruct.ColNameList); try { Bussiness.CarInfo dataCarInfoByCarId = null; foreach (int num in this._OnlineUserInfo.UserCarId.Keys) { dataCarInfoByCarId = CarDataInfoBuffer.GetDataCarInfoByCarId(num.ToString()); if (((dataCarInfoByCarId != null) && !this._OnlineUserInfo.CarFilter.CarFilterList.ContainsKey(dataCarInfoByCarId.SimNum)) && (dataCarInfoByCarId.CarPosData != null)) { table.InsertRows(dataCarInfoByCarId.CarPosData); } } if (table.Rows.Count <= 0) { return null; } } catch (Exception exception) { ErrorMsg msg = new ErrorMsg("RemotingServer", "Updata_GetCarCurrentPosNotSelBSByCompress", exception.Message + exception.StackTrace); new LogHelper().WriteError(msg); return null; } return CompressHelper.CompressToSelf(table); }