@ -224,14 +224,12 @@ public class Main {
|
|||||||
// menu options
|
// menu options
|
||||||
final int NEW_AGENT = 0;
|
final int NEW_AGENT = 0;
|
||||||
final int LIST_AGENTS = 1;
|
final int LIST_AGENTS = 1;
|
||||||
final int CHANGE_AGENT = 2;
|
final int BACK = 2;
|
||||||
final int BACK = 3;
|
|
||||||
|
|
||||||
// estate management menu
|
// estate management menu
|
||||||
Menu estateAgentMenu = new Menu("EstateAgent management");
|
Menu estateAgentMenu = new Menu("EstateAgent management");
|
||||||
estateAgentMenu.addEntry("Create EstateAgent", NEW_AGENT);
|
estateAgentMenu.addEntry("Create EstateAgent", NEW_AGENT);
|
||||||
estateAgentMenu.addEntry("List EstateAgents", LIST_AGENTS);
|
estateAgentMenu.addEntry("List EstateAgents", LIST_AGENTS);
|
||||||
estateAgentMenu.addEntry("Change EstateAgent", CHANGE_AGENT);
|
|
||||||
estateAgentMenu.addEntry("Back to the main menu", BACK);
|
estateAgentMenu.addEntry("Back to the main menu", BACK);
|
||||||
|
|
||||||
// process input
|
// process input
|
||||||
@ -242,9 +240,6 @@ public class Main {
|
|||||||
case NEW_AGENT:
|
case NEW_AGENT:
|
||||||
newEstateAgent();
|
newEstateAgent();
|
||||||
break;
|
break;
|
||||||
case CHANGE_AGENT:
|
|
||||||
changeEstateAgent();
|
|
||||||
break;
|
|
||||||
case LIST_AGENTS:
|
case LIST_AGENTS:
|
||||||
listEstateAgents();
|
listEstateAgents();
|
||||||
break;
|
break;
|
||||||
@ -270,22 +265,6 @@ public class Main {
|
|||||||
System.out.println("EstateAgent with the ID " + agent.getId() + " was created.");
|
System.out.println("EstateAgent with the ID " + agent.getId() + " was created.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO Change an estate agent after the usesr has entered the necessary data.
|
|
||||||
*/
|
|
||||||
private static void changeEstateAgent() {
|
|
||||||
EstateAgent agent = new EstateAgent();//logged in Agent
|
|
||||||
|
|
||||||
agent.setName(FormUtil.readString("Name"));
|
|
||||||
agent.setAddress(FormUtil.readString("Address"));
|
|
||||||
agent.setLogin(FormUtil.readString("Login"));
|
|
||||||
agent.setPassword(FormUtil.readString("Password"));
|
|
||||||
|
|
||||||
//_orm.persist(agent);
|
|
||||||
|
|
||||||
System.out.println("EstateAgent with the ID " + agent.getId() + " was updated.");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List estate agents.
|
* List estate agents.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user