8,7 → 8,6 |
import org.apache.struts2.StrutsStatics; |
|
import ch.ffhs.webE.dao.RelationshipTypeDAO; |
import ch.ffhs.webE.dao.RelationshipTypeDAOImpl; |
import ch.ffhs.webE.domain.RelationshipType; |
|
import com.opensymphony.xwork2.Action; |
24,8 → 23,12 |
|
private RelationshipType relType = new RelationshipType(); |
private List<RelationshipType> relTypeList = new ArrayList<RelationshipType>(); |
private final RelationshipTypeDAO relTypeDAO = new RelationshipTypeDAOImpl(); |
private final RelationshipTypeDAO relTypeDAO = new RelationshipTypeDAO(); |
|
public boolean edit = false; |
public boolean added = false; |
public RelationshipType savedRelType; |
|
@Override |
public RelationshipType getModel() |
{ |
34,13 → 37,13 |
|
public String addOrUpdate() |
{ |
this.relTypeDAO.saveOrUpdateRelType(this.relType); |
this.relTypeDAO.saveOrUpdate(this.relType); |
return Action.SUCCESS; |
} |
|
public String list() |
{ |
this.relTypeList = this.relTypeDAO.getRelTypes(); |
this.relTypeList = this.relTypeDAO.getList(); |
return Action.SUCCESS; |
} |
|
48,15 → 51,17 |
{ |
int id = this.getIdParameter(); |
|
String result = Action.ERROR; |
if (id > 0) |
{ |
this.relType = this.relTypeDAO.getRelTypeById(id); |
return Action.SUCCESS; |
this.relType = this.relTypeDAO.getById(id); |
this.edit = true; |
result = Action.SUCCESS; |
} |
else |
{ |
return Action.ERROR; |
} |
|
this.list(); |
|
return result; |
} |
|
/** |
95,7 → 100,7 |
// Check for malicious ID values |
if (id > 0) |
{ |
this.relTypeDAO.deleteRelationshipType(id); |
this.relTypeDAO.delete(id); |
return Action.SUCCESS; |
} |
else |