java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/Uvod.java
author František Kučera <franta-hg@frantovo.cz>
Sat Jan 15 00:57:45 2011 +0100 (2011-01-15)
changeset 170 56deca862adc
parent 145 0efefbf5f8b6
child 171 e619057bad66
permissions -rw-r--r--
Filtrování podniků podle kategorie.
     1 package cz.frantovo.nekurak.web;
     2 
     3 import cz.frantovo.nekurak.dto.Kategorie;
     4 import cz.frantovo.nekurak.dto.Podnik;
     5 import java.util.Collection;
     6 
     7 /**
     8  *
     9  * @author fiki
    10  */
    11 public class Uvod {
    12 
    13 	private HledacSluzby hledac = new HledacSluzby();
    14 	Integer kategorie = null;
    15 
    16 	public void setKategorie(Integer kategorie) {
    17 		this.kategorie = kategorie;
    18 	}
    19 
    20 	public Integer getKategorie() {
    21 		return kategorie;
    22 	}
    23 
    24 	public Collection<Podnik> getPodniky() {
    25 		if (kategorie == null) {
    26 			return hledac.getPodnikEJB().getPodniky();
    27 		} else {
    28 			return hledac.getPodnikEJB().getPodniky(new Kategorie(kategorie));
    29 		}
    30 	}
    31 }