Skip to content

Commit

Permalink
Correção no cadastro de alunos que subiu com bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Jun 7, 2024
1 parent 22ab41d commit 0d7c341
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/main/java/biblivre/circulation/user/UserDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,16 +289,18 @@ public boolean save(UserDTO user) {

if (newUser) {
user.setId(this.getNextSerial("users_id_seq"));
sql.append("INSERT INTO users (id, name, type, photo_id, status, created_by, name_ascii) ");
sql.append("VALUES (?, ?, ?, ?, ?, ?);");
sql.append("INSERT INTO users (id,name, type, photo_id, status, created_by, name_ascii) ");
sql.append("VALUES (?, ?, ?, ?, ?, ?, ?);");
pst = con.prepareStatement(sql.toString());

pst.setString(1, user.getName());
pst.setInt(2, user.getType());
pst.setString(3, user.getPhotoId());
pst.setString(4, user.getStatus().toString());
pst.setInt(5, user.getCreatedBy());
pst.setString(6, TextUtils.removeDiacriticals(user.getName()));
pst.setInt(1, user.getId());
pst.setString(2, user.getName());
pst.setInt(3, user.getType());
pst.setString(4, user.getPhotoId());
pst.setString(5, user.getStatus().toString());
pst.setInt(6, user.getCreatedBy());
pst.setString(7, TextUtils.removeDiacriticals(user.getName()));

} else {
sql.append("UPDATE users SET modified = now(), ");
sql.append("type = ?, photo_id = ?, status = ?, name = ?, modified_by = ?, user_card_printed = ?, name_ascii = ? ");
Expand Down

0 comments on commit 0d7c341

Please sign in to comment.