public void WriteBitWise(string dbName, Int64 CTID, int value, AgentType agentType) { DataTable table; DataRow row; if (agentType.Equals(AgentType.Slave)) { //find the table table = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)]; //find the row row = table.Select("CTID = " + Convert.ToString(CTID) + " AND slaveIdentifier = '" + Config.Slave + "'")[0]; } else { //find the table table = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)]; //find the row row = table.Select("CTID = " + Convert.ToString(CTID))[0]; } //update the row if it doesn't contain the specified bit if ((row.Field <int>("syncBitWise") & value) == 0) { row["syncBitWise"] = row.Field <int>("syncBitWise") + value; //commit the changes //table.AcceptChanges(); } }
// Update is called once per frame void FixedUpdate() { if (i < locations.Count) { if (alive[i]) { Coordinate currentPos = locations[i]; transform.position = new Vector2(currentPos.x, currentPos.y); } else if (!dead) { renderer.color = Color.blue; dead = true; } i++; } else { if (type.Equals(AgentType.APID)) { renderer.color = Color.white; } else { renderer.color = Color.red; } i = 0; dead = false; } }
public DataRow GetLastCTBatch(string dbName, AgentType agentType, string slaveIdentifier = "") { //for slave we have to pass the slave identifier in and use tblCTSlaveVersion if (agentType.Equals(AgentType.Slave)) { DataTable tblCTSlaveVersion = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)]; return(tblCTSlaveVersion.Select("slaveIdentifier = '" + slaveIdentifier + "'", "CTID DESC")[0]); } else { DataTable tblCTVersion = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)]; return(tblCTVersion.Select(null, "CTID DESC")[0]); } }
public int ReadBitWise(string dbName, Int64 CTID, AgentType agentType) { DataTable table; DataRow row; if (agentType.Equals(AgentType.Slave)) { //find the table table = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)]; //find the row row = table.Select("CTID = " + Convert.ToString(CTID) + " AND slaveIdentifier = '" + Config.Slave + "'")[0]; } else { //find the table table = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)]; //find the row row = table.Select("CTID = " + Convert.ToString(CTID))[0]; } return(row.Field <int>("syncBitWise")); }
public void WriteBitWise(string dbName, Int64 CTID, int value, AgentType agentType) { DataTable table; DataRow row; if (agentType.Equals(AgentType.Slave)) { //find the table table = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)]; //find the row row = table.Select("CTID = " + Convert.ToString(CTID) + " AND slaveIdentifier = '" + Config.Slave + "'")[0]; } else { //find the table table = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)]; //find the row row = table.Select("CTID = " + Convert.ToString(CTID))[0]; } //update the row if it doesn't contain the specified bit if ((row.Field<int>("syncBitWise") & value) == 0) { row["syncBitWise"] = row.Field<int>("syncBitWise") + value; //commit the changes //table.AcceptChanges(); } }
public int ReadBitWise(string dbName, Int64 CTID, AgentType agentType) { DataTable table; DataRow row; if (agentType.Equals(AgentType.Slave)) { //find the table table = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)]; //find the row row = table.Select("CTID = " + Convert.ToString(CTID) + " AND slaveIdentifier = '" + Config.Slave + "'")[0]; } else { //find the table table = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)]; //find the row row = table.Select("CTID = " + Convert.ToString(CTID))[0]; } return row.Field<int>("syncBitWise"); }
public DataRow GetLastCTBatch(string dbName, AgentType agentType, string slaveIdentifier = "") { //for slave we have to pass the slave identifier in and use tblCTSlaveVersion if (agentType.Equals(AgentType.Slave)) { DataTable tblCTSlaveVersion = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)]; return tblCTSlaveVersion.Select("slaveIdentifier = '" + slaveIdentifier + "'", "CTID DESC")[0]; } else { DataTable tblCTVersion = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)]; return tblCTVersion.Select(null, "CTID DESC")[0]; } }