ItEr17S13CUConfiguracionDeOrganizacionsDeTraballoConUnidadesTraballoItEr15S11: Checking that there's at least one HoursGroup for every OrderLine.
This commit is contained in:
parent
5752c205fb
commit
5b7c3f45c2
2 changed files with 11 additions and 0 deletions
|
|
@ -136,4 +136,9 @@ public abstract class OrderElement {
|
|||
public boolean isScheduled() {
|
||||
return !taskElements.isEmpty();
|
||||
}
|
||||
|
||||
public boolean checkAtLeastOneHoursGroup() {
|
||||
return (getHoursGroups().size() > 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -236,6 +236,12 @@ public class OrderElementController extends GenericForwardComposer {
|
|||
* managed by "save-when" at .zul file.
|
||||
*/
|
||||
public void back() {
|
||||
if (!getOrderElement().checkAtLeastOneHoursGroup()) {
|
||||
throw new WrongValueException(window
|
||||
.getFellow("hoursGroupsListbox"),
|
||||
"At least one HoursGroup is needed");
|
||||
}
|
||||
|
||||
window.setVisible(false);
|
||||
Util.reloadBindings(window.getParent());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue