public void LoadGatherTable(GatherInfo info, GatherTimer time, IGatherItem IItem, IGatherDB db, IThreadAction _action) { this._action = _action; this._db = db; this._info = info; this.tb = db.GetDataTable(); this.临时缓存 = this.tb.Clone(); this.临时缓存.TableName = info.reportName; this.time = time; GatherItem item = null; row = new GatherRow(); int count = this.tb.Columns.Count; GatherField field = null; for (int i = 0; i < count; i++) { field = info.GetFiled(this.tb.Columns[i].ColumnName); if (field == null) { continue; } if (field._SourceType != 数据来源类型.未知) { item = new GatherItem(field, IItem.GetComputerItem(field.DataNo)); } else { item = new GatherItem(field, IItem.GetIValue(field.DataNo)); } this.row.AddItem(item); } storeType = DataStoreType.SynDB; // 默认采集模式是同步进行 }
public void RemoveRecord(decimal id, string reportName) { DataRow row = null; DataRow[] rows = this.tb.Select("id=" + id); if (rows.Length > 0) { row = rows[0]; this.Cache.Rows.Remove(row); this._db.DeleteRecord(id, reportName); } }
public void AddArrToDB() { DataRow row = null; object[] d = this.row.GetFloats(); row = this.tb.Rows.Add(d); string sql = this._info.GetSql(d, _db); _db.InsertSql(sql); if (this._GahterRowEvent != null) { this._GahterRowEvent.RowEvent(row); } }
public void LoadGatherTable(GatherInfo info, GatherTimer time, IGatherItem IItem,IGatherDB db,IThreadAction _action) { this._action = _action; this._db = db; this._info = info; this.tb = db.GetDataTable(); this.临时缓存 = this.tb.Clone(); this.临时缓存.TableName = info.reportName; this.time = time; GatherItem item = null; row = new GatherRow(); int count = this.tb.Columns.Count; GatherField field = null; for (int i = 0; i < count; i++) { field = info.GetFiled(this.tb.Columns[i].ColumnName); if (field == null) { continue; } if (field._SourceType != 数据来源类型.未知) item = new GatherItem(field, IItem.GetComputerItem(field.DataNo)); else item = new GatherItem(field, IItem.GetIValue(field.DataNo)); this.row.AddItem(item); } storeType = DataStoreType.SynDB; // 默认采集模式是同步进行 }
public void RemoveRecord(decimal id,string reportName) { DataRow row = null; DataRow[] rows = this.tb.Select("id=" + id); if (rows.Length > 0) { row = rows[0]; this.Cache.Rows.Remove(row); this._db.DeleteRecord(id, reportName); } }