Skip to content
This repository was archived by the owner on Jan 16, 2023. It is now read-only.

Commit 0d78437

Browse files
committed
Latest update 22/10/2017
1 parent 99370af commit 0d78437

File tree

11 files changed

+25
-400
lines changed

11 files changed

+25
-400
lines changed

Logging Store/Logging_2017-09-02.log

Whitespace-only changes.

Logging Store/Logging_2017-09-18.log

Lines changed: 0 additions & 4 deletions
This file was deleted.

Logging Store/Logging_2017-10-12.log

Lines changed: 0 additions & 6 deletions
This file was deleted.

Logging Store/Logging_2017-10-21.log

Lines changed: 0 additions & 350 deletions
This file was deleted.

Logging Store/Logging_2017-10-21.log.1

Lines changed: 0 additions & 28 deletions
This file was deleted.

Logging Store/Logging_2017-10-21.log.2

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
02:47:26 22/10/2017
2+
INFO:User is : coder acjhp
3+
02:47:27 22/10/2017
4+
INFO:MainFrame created successfully.

src/com/coder/hms/ui/external/SendEmailWindow.java

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import javax.swing.border.BevelBorder;
2828
import javax.swing.border.SoftBevelBorder;
2929

30+
import com.coder.hms.connection.DataSourceFactory;
3031
import com.coder.hms.daoImpl.UserDaoImpl;
3132
import com.coder.hms.entities.User;
3233
import com.coder.hms.utils.EmailValidator;
@@ -162,12 +163,23 @@ public void actionPerformed(ActionEvent e) {
162163
final User user = userDaoImpl.getUserByEmail(theEmail);
163164

164165
if(user.getId() > 0) {
165-
System.out.println(user.toString());
166-
final SendEmailToUser sendEmail = new SendEmailToUser();
167-
sendEmail.setReadyForEmail("[email protected]", "community");
168-
sendEmail.setFrom("[email protected]", user.getEmail());
169-
sendEmail.setEmailBody("Remind of password", "Your password is : " + user.getPassword());
170-
sendEmail.sendTheEmail();
166+
167+
try {
168+
169+
final SendEmailToUser sendEmail = new SendEmailToUser();
170+
sendEmail.setReadyForEmail("[email protected]", "community");
171+
sendEmail.setFrom("[email protected]", user.getEmail());
172+
sendEmail.setEmailBody("Remind of password", "Your password is : " + user.getPassword());
173+
sendEmail.sendTheEmail();
174+
175+
} catch (RuntimeException ex) {
176+
final InformationFrame dialog = new InformationFrame();
177+
dialog.setMessage("Email sending error!Please again later.");
178+
dialog.setVisible(true);
179+
new DataSourceFactory().getTransaction().rollback();
180+
}
181+
182+
cleanFields();
171183
infoLabel.setForeground(Color.GREEN);
172184
infoLabel.setText("Your password has been sent to your e-mail address, please check your mail box.");
173185
}
@@ -188,4 +200,7 @@ public void actionPerformed(ActionEvent e) {
188200
return listener;
189201
}
190202

203+
private void cleanFields() {
204+
textField.setText(" ");
205+
}
191206
}
0 Bytes
Binary file not shown.
490 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)