package info.bukova.isspst.validators;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zkoss.bind.ValidationContext;

public class TripRequirementFormValidator extends BaseValidator {
	
	private final static Logger log = LoggerFactory.getLogger(TripRequirementFormValidator.class);

	@Override
	protected Logger getLogger()
	{
		return log;
	}

	@Override
	public void validate(ValidationContext ctx) {
		if (!this.validateIsNotNull(ctx, "centre", "RequirementCenterIsEmpty", null))
		{
			return;
		}
		
		if (!this.validateIsNotNull(ctx, "tripDate", "TripDateIsEmpty", null))
		{
			return;
		}
		
		if (!this.validateIsNotNull(ctx, "endDate", "EndDateIsEmpty", null))
		{
			return;
		}
		
		if (!this.validateIsNotNullOrNotEmpty(ctx, "from", "FromIsEmpty", null))
		{
			return;
		}
		
		if (!this.validateIsNotNullOrNotEmpty(ctx, "to", "ToIsEmpty", null))
		{
			return;
		}
		
		if (!this.validateIsNotNull(ctx, "vehicle", "VehicleIsEmpty", null))
		{
			return;
		}
	}
	
	

}
