private void initializeCubiclesRoomsBedsCombo() { form.cmbCubicle().clear(); if( form.getLocalContext().getCurrentTrackingIsNotNull()) { TrackingAreaCubiclesVo tempVo = domain.getTrackingAreaCubicles(form.getLocalContext().getCurrentTracking().getCurrentArea()); if( tempVo != null && tempVo.getCubiclesRoomsBedsIsNotNull()) { //WDEV-20720 TrackingCubicleRoomBedVoCollection collCurrentlyAllocatedCubicle = domain.getCurrentlyAllocatedCubicles(form.getLocalContext().getCurrentTracking().getCurrentArea()); for(int i = 0;i < tempVo.getCubiclesRoomsBeds().size();i++) { if (collCurrentlyAllocatedCubicle!=null && collCurrentlyAllocatedCubicle.size()>0 && collCurrentlyAllocatedCubicle.contains(tempVo.getCubiclesRoomsBeds().get(i))) { form.cmbCubicle().newRow(tempVo.getCubiclesRoomsBeds().get(i), tempVo.getCubiclesRoomsBeds().get(i).getCubicleRoomBedName(), Color.Red); } else { form.cmbCubicle().newRow(tempVo.getCubiclesRoomsBeds().get(i), tempVo.getCubiclesRoomsBeds().get(i).getCubicleRoomBedName()); } } } } }
public Boolean removedCubicleAreUsed() { TrackingAreaCubiclesVo tempVo = domain.getTrackingAreaCubicle(form.cmbArea().getValue()); TrackingCubicleRoomBedVoCollection collRemovedCubicle=new TrackingCubicleRoomBedVoCollection(); if( tempVo != null && tempVo.getCubiclesRoomsBedsIsNotNull()&& tempVo.getCubiclesRoomsBeds().size() > 0 ) { TrackingCubicleRoomBedVoCollection collCubicleFromDB = tempVo.getCubiclesRoomsBeds(); TrackingCubicleRoomBedVoCollection collCubicleFromScreen = new TrackingCubicleRoomBedVoCollection(); if( form.grdCubiclesRoomsBeds().getRows().size() > 0) { for(int i = 0; i < form.grdCubiclesRoomsBeds().getRows().size();i++) { collCubicleFromScreen.add(form.grdCubiclesRoomsBeds().getRows().get(i).getValue()); } } else collCubicleFromScreen = null; for(int i = 0; i < collCubicleFromDB.size();i++) { if (collCubicleFromDB!=null && collCubicleFromScreen!=null && !collCubicleFromScreen.contains(collCubicleFromDB.get(i))) { collRemovedCubicle.add(collCubicleFromDB.get(i)); } } } if (collRemovedCubicle==null || collRemovedCubicle.size()==0) return false; for (int i=0;i<collRemovedCubicle.size();i++) { CubicleAllocationVoCollection tempColl = domain.getAllcotiobCubilce(collRemovedCubicle.get(i)); if( tempColl != null) { return true; } } return false; }
private void populateScreenFromData(CubicleAllocationVo cubic) { clearControlDetails(); if(cubic != null) { form.ccAllocatedBy().setValue(cubic.getAllocatedBy()); form.dtimAllocatedCubicle().setValue(cubic.getAllocatedCubicleDateTime()); form.cmbCubicle().setValue(cubic.getCubicleRoomBed()); //wdev-16011 form.lblNameOfTrackingArea().setValue(cubic.getTrackingAreaIsNotNull()? cubic.getTrackingArea().getAreaDisplayName():""); //wdev-16011 form.cmbCubicle().clear(); if( cubic.getTrackingAreaIsNotNull()) { TrackingAreaCubiclesVo tempVo = domain.getTrackingAreaCubicles(cubic.getTrackingArea()); if( tempVo != null && tempVo.getCubiclesRoomsBedsIsNotNull()) { //WDEV-20720 TrackingCubicleRoomBedVoCollection collCurrentlyAllocatedCubicle = domain.getCurrentlyAllocatedCubicles(form.getLocalContext().getCurrentTracking().getCurrentArea()); for(int i = 0;i < tempVo.getCubiclesRoomsBeds().size();i++) { if (collCurrentlyAllocatedCubicle!=null && collCurrentlyAllocatedCubicle.size()>0 && collCurrentlyAllocatedCubicle.contains(tempVo.getCubiclesRoomsBeds().get(i))) { form.cmbCubicle().newRow(tempVo.getCubiclesRoomsBeds().get(i), tempVo.getCubiclesRoomsBeds().get(i).getCubicleRoomBedName(), Color.Red); } else { form.cmbCubicle().newRow(tempVo.getCubiclesRoomsBeds().get(i), tempVo.getCubiclesRoomsBeds().get(i).getCubicleRoomBedName()); } } } form.cmbCubicle().setValue(cubic.getCubicleRoomBed()); } //--------- } }
public TrackingCubicleRoomBedVoCollection getCurrentlyAllocatedCubicles(TrackingAreaRefVo trackingAreaRef) { if( trackingAreaRef == null ) throw new CodingRuntimeException("Tracking Area not provided"); DomainFactory factory = getDomainFactory(); String hsql = "select cubicleRoomBed from Tracking as tracking left join tracking.currentArea as area left join tracking.currentCubicle as cubicle left join cubicle.cubicleRoomBed as cubicleRoomBed where (area.id = :id)) "; List cubicle = factory.find(hsql, new String[] {"id"}, new Object[] {trackingAreaRef.getID_TrackingArea()}); return TrackingCubicleRoomBedVoAssembler.createTrackingCubicleRoomBedVoCollectionFromTrackingCubicleRoomBed(cubicle); }