public void updatePerson(Personnel person) { string sql = "UPDATE personnel SET name = '" + person.getName() + "', start = '" + person.getStart() + "', work = " + person.getWork() + ", rest = " + person.getRest() + ", xp_id = " + person.getXpId() + " WHERE id = " + person.getId() + ";"; connection.Open(); SQLiteCommand command = new SQLiteCommand(sql, connection); command.ExecuteNonQuery(); connection.Close(); }
public void addPerson(Personnel person) { string sql = "INSERT INTO personnel (name, start, work, rest, xp_id) VALUES " + "('" + person.getName() + "', '" + person.getStart() + "', " + person.getWork() + ", " + person.getRest() + ", " + person.getXpId() + ");"; connection.Open(); SQLiteCommand command = new SQLiteCommand(sql, connection); command.ExecuteNonQuery(); connection.Close(); }