+
+ public static Organisation[] getOrganisations(int offset, int count) {
+ GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT id FROM organisations LIMIT ?,?");
+ ps.setInt(1, offset);
+ ps.setInt(2, count);
+ GigiResultSet res = ps.executeQuery();
+ res.last();
+ Organisation[] resu = new Organisation[res.getRow()];
+ res.beforeFirst();
+ int i = 0;
+ while (res.next()) {
+ resu[i++] = getById(res.getInt(1));
+ }
+ return resu;
+ }
+
+ public void update(String o, String c, String st, String l) {
+ for (Certificate cert : getCertificates()) {
+ if (cert.getStatus() == CertificateStatus.ISSUED) {
+ cert.revoke();
+ }
+ }
+ GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("UPDATE organisations SET name=?, state=?, province=?, city=?");
+ ps.setString(1, o);
+ ps.setString(2, c);
+ ps.setString(3, st);
+ ps.setString(4, l);
+ ps.execute();
+ name = o;
+ state = c;
+ province = st;
+ city = l;
+ }