@WebMethod public Response setKondisiAset(int idAset, AssetCondition kondisi) throws SQLException { String query = "UPDATE " + ASSET_TABLE + " " + "SET kondisi='" + kondisi.getCondition() + "' " + "WHERE id=" + idAset; int numRowAffected = executeUpdateQueryAndGetRowCount(query); if (numRowAffected > 0) return new Response(true); else return new Response(false); }
@WebMethod public Response registerAset( String nama, String kategori, String jenis, AssetCondition kondisi, String pemilik, int idVendor, String harga, boolean isPublic) throws SQLException { String query = "INSERT INTO " + ASSET_TABLE + " (nama, kategori, jenis, tanggal_masuk, kondisi, pemilik, id_vendor, harga, is_public) " + "VALUES ('" + nama + "', '" + kategori + "', '" + jenis + "', now(), '" + kondisi.getCondition() + "', '" + pemilik + "', " + idVendor + ", '" + harga + "', " + (isPublic ? "TRUE" : "FALSE") + ")"; int numRowAffected = executeUpdateQueryAndGetId(query); if (numRowAffected > 0) return new Response(true); else return new Response(false); }