예제 #1
0
  public boolean addNewCaptain() {
    boolean check = false;
    try {
      view.displayPrintMessages("enterfirstname");
      String n1 = view.getInput();
      view.displayPrintMessages("enterlastname");
      String n2 = view.getInput();

      memHandler.addMember(n1, n2);
      check = true;
    } catch (Exception e) {
    }
    return check;
  }
예제 #2
0
 public boolean deleteCaptain() {
   boolean b = false;
   try {
     view.displayPrintMessages("entercaptainid");
     String memID = view.getInput();
     Member mem = new Member();
     for (Member m : sql.getAllMembers()) {
       if (m.getMemberID().equals(memID)) {
         mem = m;
       } else {
         view.displayPrintMessages("nocushcaptain");
         return deleteCaptain();
       }
     }
     memHandler.deleteMember(mem);
     b = true;
   } catch (Exception e) {
   }
   return b;
 }
예제 #3
0
  public boolean changeCaptain() {
    boolean b = false;
    try {
      view.displayPrintMessages("entercaptainid");
      String memID = view.getInput();
      Member mem = new Member();
      for (Member m : sql.getAllMembers()) {
        if (m.getMemberID().equals(memID)) {
          mem = m;
        } else {
          view.displayPrintMessages("nosuchcaptain");
        }
      }
      view.displayPrintMessages("enternewfirstname");
      String n1 = view.getInput();
      view.displayPrintMessages("enternewlastname");
      String n2 = view.getInput();

      memHandler.changeMember(mem, n1, n2);
      b = true;
    } catch (Exception e) {
    }
    return b;
  }