Java Code Examples for ims.core.vo.BedSpaceStateLiteVo.validate()

The following are Jave code examples for showing how to use validate() of the ims.core.vo.BedSpaceStateLiteVo class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
@Override
protected void onBtnCloseClick() throws PresentationLogicException
{
	BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();

	if (voBedSpaceState == null)
		throw new CodingRuntimeException("voBedSpaceState is null in method onBtnCloseClick");

	// move to previous
	if (voBedSpaceState.getCurrentBedStatusIsNotNull())
	{
		voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
		voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
		voBedSpaceState.getCurrentBedStatus().setStatusDateTime(form.lyrDetail().tabCloseBed().dtimClose().getValue());
		voBedSpaceState.getCurrentBedStatus().setBedStatus(BedStatus.CLOSED);
	}

	String[] arrErrors = voBedSpaceState.validate(getUIValidationForCloseBed());
	if (arrErrors != null)
	{
		engine.showErrors(arrErrors);
		return;
	}

	try
	{
		domain.saveCloseBed(voBedSpaceState, form.lyrDetail().tabCloseBed().cmbUser().getValue(), form.lyrDetail().tabCloseBed().cmbCloseReason().getValue(), form.lyrDetail().tabCloseBed().dtimEstReOpen().getValue());
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		initialise();
		engine.close(DialogResult.OK);
		return;
	}

	engine.close(DialogResult.OK);
}
 
Example 2
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
@Override
protected void onBtnCloseClick() throws PresentationLogicException
{
	BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();

	if (voBedSpaceState == null)
		throw new CodingRuntimeException("voBedSpaceState is null in method onBtnCloseClick");

	// move to previous
	if (voBedSpaceState.getCurrentBedStatusIsNotNull())
	{
		voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
		voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
		voBedSpaceState.getCurrentBedStatus().setStatusDateTime(form.lyrDetail().tabCloseBed().dtimClose().getValue());
		voBedSpaceState.getCurrentBedStatus().setBedStatus(BedStatus.CLOSED);
	}

	String[] arrErrors = voBedSpaceState.validate(getUIValidationForCloseBed());
	if (arrErrors != null)
	{
		engine.showErrors(arrErrors);
		return;
	}

	try
	{
		domain.saveCloseBed(voBedSpaceState, form.lyrDetail().tabCloseBed().cmbUser().getValue(), form.lyrDetail().tabCloseBed().cmbCloseReason().getValue(), form.lyrDetail().tabCloseBed().dtimEstReOpen().getValue());
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		initialise(false, false); //WDEV-17662
		engine.close(DialogResult.OK);
		return;
	}

	engine.close(DialogResult.OK);
}
 
Example 3
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
@Override
protected void onBtnCloseClick() throws PresentationLogicException
{
	BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();

	if (voBedSpaceState == null)
		throw new CodingRuntimeException("voBedSpaceState is null in method onBtnCloseClick");

	// move to previous
	if (voBedSpaceState.getCurrentBedStatusIsNotNull())
	{
		voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
		voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
		voBedSpaceState.getCurrentBedStatus().setStatusDateTime(form.lyrDetail().tabCloseBed().dtimClose().getValue());
		voBedSpaceState.getCurrentBedStatus().setBedStatus(BedStatus.CLOSED);
	}

	String[] arrErrors = voBedSpaceState.validate(getUIValidationForCloseBed());
	if (arrErrors != null)
	{
		engine.showErrors(arrErrors);
		return;
	}

	try
	{
		domain.saveCloseBed(voBedSpaceState, form.lyrDetail().tabCloseBed().cmbUser().getValue(), form.lyrDetail().tabCloseBed().cmbCloseReason().getValue(), form.lyrDetail().tabCloseBed().dtimEstReOpen().getValue());
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		initialise();
		engine.close(DialogResult.OK);
		return;
	}

	engine.close(DialogResult.OK);
}
 
Example 4
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 5 votes
@Override
protected void onBtnCloseClick() throws PresentationLogicException
{
	BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();

	if (voBedSpaceState == null)
		throw new CodingRuntimeException("voBedSpaceState is null in method onBtnCloseClick");

	// move to previous
	if (voBedSpaceState.getCurrentBedStatusIsNotNull())
	{
		voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
		voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
		voBedSpaceState.getCurrentBedStatus().setStatusDateTime(form.lyrDetail().tabCloseBed().dtimClose().getValue());
		voBedSpaceState.getCurrentBedStatus().setBedStatus(BedStatus.CLOSED);
	}

	String[] arrErrors = voBedSpaceState.validate(getUIValidationForCloseBed());
	if (arrErrors != null)
	{
		engine.showErrors(arrErrors);
		return;
	}

	try
	{
		domain.saveCloseBed(voBedSpaceState, form.lyrDetail().tabCloseBed().cmbUser().getValue(), form.lyrDetail().tabCloseBed().cmbCloseReason().getValue(), form.lyrDetail().tabCloseBed().dtimEstReOpen().getValue());
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		initialise();
		engine.close(DialogResult.OK);
		return;
	}

	engine.close(DialogResult.OK);
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
private void saveReOpenOrAssign(BedStatus status)
{
	////WDEV-17935
	if (BedStatus.FOR_CLEANING.equals(status))
	{
		String[] errCleaningBed = getUIValidationForCloseBed();
		if (errCleaningBed != null)
		{
			engine.showErrors(errCleaningBed);
			return;
		}
	}
	
	BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();

	if (voBedSpaceState == null)
		throw new CodingRuntimeException("voBedSpaceState is null in method saveReOpenOrAssign");

	// move to previous
	if (voBedSpaceState.getCurrentBedStatusIsNotNull())
	{
		voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
		voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
		voBedSpaceState.getCurrentBedStatus().setStatusDateTime(new DateTime());
		voBedSpaceState.getCurrentBedStatus().setBedStatus(status);
		
		//WDEV-17935
		if (BedStatus.FOR_CLEANING.equals(status))
		{
			voBedSpaceState.getCurrentBedStatus().setReasonForClosure(form.lyrDetail().tabCloseBed().cmbCloseReason().getValue());
			voBedSpaceState.getCurrentBedStatus().setEstReopeningDateTime(form.lyrDetail().tabCloseBed().dtimEstReOpen().getValue());
		}
	}

	String[] arrErrors = voBedSpaceState.validate();
	if (arrErrors != null)
	{
		engine.showErrors(arrErrors);
		return;
	}

	try
	{
		domain.saveReOpenOrAssignBed(voBedSpaceState);
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		initialise();
		return;
	}

	engine.close(DialogResult.OK);
}
 
Example 6
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 4 votes
private void saveReOpenOrAssign(BedStatus status)
{
	////WDEV-17935
	if (BedStatus.FOR_CLEANING.equals(status))
	{
		String[] errCleaningBed = getUIValidationForCloseBed();
		if (errCleaningBed != null)
		{
			engine.showErrors(errCleaningBed);
			return;
		}
	}
	
	BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();

	if (voBedSpaceState == null)
		throw new CodingRuntimeException("voBedSpaceState is null in method saveReOpenOrAssign");

	// move to previous
	if (voBedSpaceState.getCurrentBedStatusIsNotNull())
	{
		voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
		voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
		voBedSpaceState.getCurrentBedStatus().setStatusDateTime(form.lyrDetail().tabCloseBed().dtimClose().getValue()); // WDEV-22423 - take date from screen
		voBedSpaceState.getCurrentBedStatus().setBedStatus(status);
		
		//WDEV-17935
		if (BedStatus.FOR_CLEANING.equals(status))
		{
			voBedSpaceState.getCurrentBedStatus().setReasonForClosure(form.lyrDetail().tabCloseBed().cmbCloseReason().getValue());
			voBedSpaceState.getCurrentBedStatus().setEstReopeningDateTime(form.lyrDetail().tabCloseBed().dtimEstReOpen().getValue());
		}
	}

	String[] arrErrors = voBedSpaceState.validate();
	if (arrErrors != null)
	{
		engine.showErrors(arrErrors);
		return;
	}

	try
	{
		domain.saveReOpenOrAssignBed(voBedSpaceState);
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		initialise(false, false); //WDEV-17662
		return;
	}

	engine.close(DialogResult.OK);
}
 
Example 7
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 4 votes
private void saveReOpenOrAssign(BedStatus status)
{
	////WDEV-17935
	if (BedStatus.FOR_CLEANING.equals(status))
	{
		String[] errCleaningBed = getUIValidationForCloseBed();
		if (errCleaningBed != null)
		{
			engine.showErrors(errCleaningBed);
			return;
		}
	}
	
	BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();

	if (voBedSpaceState == null)
		throw new CodingRuntimeException("voBedSpaceState is null in method saveReOpenOrAssign");

	// move to previous
	if (voBedSpaceState.getCurrentBedStatusIsNotNull())
	{
		voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
		voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
		voBedSpaceState.getCurrentBedStatus().setStatusDateTime(new DateTime());
		voBedSpaceState.getCurrentBedStatus().setBedStatus(status);
		
		//WDEV-17935
		if (BedStatus.FOR_CLEANING.equals(status))
		{
			voBedSpaceState.getCurrentBedStatus().setReasonForClosure(form.lyrDetail().tabCloseBed().cmbCloseReason().getValue());
			voBedSpaceState.getCurrentBedStatus().setEstReopeningDateTime(form.lyrDetail().tabCloseBed().dtimEstReOpen().getValue());
		}
	}

	String[] arrErrors = voBedSpaceState.validate();
	if (arrErrors != null)
	{
		engine.showErrors(arrErrors);
		return;
	}

	try
	{
		domain.saveReOpenOrAssignBed(voBedSpaceState);
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		initialise();
		return;
	}

	engine.close(DialogResult.OK);
}
 
Example 8
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 4 votes
private void saveReOpenOrAssign(BedStatus status)
{
	////WDEV-17935
	if (BedStatus.FOR_CLEANING.equals(status))
	{
		String[] errCleaningBed = getUIValidationForCloseBed();
		if (errCleaningBed != null)
		{
			engine.showErrors(errCleaningBed);
			return;
		}
	}
	
	BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();

	if (voBedSpaceState == null)
		throw new CodingRuntimeException("voBedSpaceState is null in method saveReOpenOrAssign");

	// move to previous
	if (voBedSpaceState.getCurrentBedStatusIsNotNull())
	{
		voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
		voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
		voBedSpaceState.getCurrentBedStatus().setStatusDateTime(new DateTime());
		voBedSpaceState.getCurrentBedStatus().setBedStatus(status);
		
		//WDEV-17935
		if (BedStatus.FOR_CLEANING.equals(status))
		{
			voBedSpaceState.getCurrentBedStatus().setReasonForClosure(form.lyrDetail().tabCloseBed().cmbCloseReason().getValue());
			voBedSpaceState.getCurrentBedStatus().setEstReopeningDateTime(form.lyrDetail().tabCloseBed().dtimEstReOpen().getValue());
		}
	}

	String[] arrErrors = voBedSpaceState.validate();
	if (arrErrors != null)
	{
		engine.showErrors(arrErrors);
		return;
	}

	try
	{
		domain.saveReOpenOrAssignBed(voBedSpaceState);
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		initialise();
		return;
	}

	engine.close(DialogResult.OK);
}