final project q11
This commit is contained in:
27
finalproject/Question11/ControllerMoreBook.java
Normal file
27
finalproject/Question11/ControllerMoreBook.java
Normal file
@@ -0,0 +1,27 @@
|
||||
public class ControllerMoreBook extends Controller {
|
||||
// constr
|
||||
public ControllerMoreBook(Library m) {
|
||||
super(m);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name the username
|
||||
* @param number the book number
|
||||
*/
|
||||
public String moreBook(String name, String number) {
|
||||
try {
|
||||
int num = Integer.parseInt(number);
|
||||
m.moreBook(name, num);
|
||||
return "";
|
||||
|
||||
} catch (UnknownUserException e) {
|
||||
return e.getMessage();
|
||||
|
||||
} catch (NotALenderException e) {
|
||||
return e.getMessage();
|
||||
|
||||
} catch (NumberFormatException e) {
|
||||
return e.getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user