protected override bool BeforeNewRecordInserting(SQLiteDataReader rpReader) { if (r_Type.Type == ResourceHistoryType.Detail) { return(true); } var rTime = rpReader.GetInt64("time"); if (rTime >= r_Type.Maximum) { r_Type.Update(); return(true); } LastInsertedRecord.ID = rTime; LastInsertedRecord.Fuel = rpReader.GetInt32("fuel"); LastInsertedRecord.Bullet = rpReader.GetInt32("bullet"); LastInsertedRecord.Steel = rpReader.GetInt32("steel"); LastInsertedRecord.Bauxite = rpReader.GetInt32("bauxite"); LastInsertedRecord.InstantConstruction = rpReader.GetInt32("instant_construction"); LastInsertedRecord.Bucket = rpReader.GetInt32("bucket"); LastInsertedRecord.DevelopmentMaterial = rpReader.GetInt32("development_material"); LastInsertedRecord.ImprovementMaterial = rpReader.GetInt32("improvement_material"); LastInsertedRecord.Update(); return(false); }
public ResourceHistoryViewModel() { Types = Enumerable.Range(0, 4).Select(r => new ResourceHistoryTypeKey((ResourceHistoryType)r)).ToArray(); r_Type = Types[1]; r_Type.Update(); }