parent
							
								
									3c42c1be35
								
							
						
					
					
						commit
						b71f3a9bef
					
				@ -0,0 +1,67 @@
 | 
			
		||||
package info.bukova.isspst.data;
 | 
			
		||||
 | 
			
		||||
import javax.persistence.Column;
 | 
			
		||||
import javax.persistence.Embeddable;
 | 
			
		||||
 | 
			
		||||
@Embeddable
 | 
			
		||||
public class Vehicle {
 | 
			
		||||
	
 | 
			
		||||
	@Column(name = "VEHICLE_CODE")
 | 
			
		||||
	private String code;
 | 
			
		||||
	@Column(name = "VEHICLE_DESCRIPTION")
 | 
			
		||||
	private String description;
 | 
			
		||||
 | 
			
		||||
	public String getCode() {
 | 
			
		||||
		return code;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void setCode(String code) {
 | 
			
		||||
		this.code = code;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public String getDescription() {
 | 
			
		||||
		return description;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void setDescription(String description) {
 | 
			
		||||
		this.description = description;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public int hashCode() {
 | 
			
		||||
		final int prime = 31;
 | 
			
		||||
		int result = 1;
 | 
			
		||||
		result = prime * result + ((code == null) ? 0 : code.hashCode());
 | 
			
		||||
		result = prime * result
 | 
			
		||||
				+ ((description == null) ? 0 : description.hashCode());
 | 
			
		||||
		return result;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public boolean equals(Object obj) {
 | 
			
		||||
		if (this == obj)
 | 
			
		||||
			return true;
 | 
			
		||||
		if (obj == null)
 | 
			
		||||
			return false;
 | 
			
		||||
		if (getClass() != obj.getClass())
 | 
			
		||||
			return false;
 | 
			
		||||
		Vehicle other = (Vehicle) obj;
 | 
			
		||||
		if (code == null) {
 | 
			
		||||
			if (other.code != null)
 | 
			
		||||
				return false;
 | 
			
		||||
		} else if (!code.equals(other.code))
 | 
			
		||||
			return false;
 | 
			
		||||
		if (description == null) {
 | 
			
		||||
			if (other.description != null)
 | 
			
		||||
				return false;
 | 
			
		||||
		} else if (!description.equals(other.description))
 | 
			
		||||
			return false;
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public String toString() {
 | 
			
		||||
		return code + (description != null ? " - " + description : "");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,23 @@
 | 
			
		||||
<?page title="travel orders" contentType="text/html;charset=UTF-8"?>
 | 
			
		||||
<zk>
 | 
			
		||||
<vbox>
 | 
			
		||||
	<label value="Dopravní prostředky:"/>
 | 
			
		||||
	<button label="${labels.AddItem}" onClick="@command('addVehicle')"/>
 | 
			
		||||
	<grid model="@load(vm.settings.vehicles)">
 | 
			
		||||
		<columns>
 | 
			
		||||
			<column label="${labels.code}"/>
 | 
			
		||||
			<column label="${labels.name}"/>
 | 
			
		||||
			<column/>
 | 
			
		||||
		</columns>
 | 
			
		||||
		<rows>
 | 
			
		||||
			<template name="model">
 | 
			
		||||
				<row>
 | 
			
		||||
					<textbox inplace="true" value="@bind(each.code)"/>
 | 
			
		||||
					<textbox inplace="true" value="@bind(each.description)"/>
 | 
			
		||||
					<button label="${labels.RemoveItem}" onClick="@command('removeVehicle', vehicle=each)"/>
 | 
			
		||||
				</row>
 | 
			
		||||
			</template>
 | 
			
		||||
		</rows>
 | 
			
		||||
	</grid>
 | 
			
		||||
</vbox>
 | 
			
		||||
</zk>
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue