/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beans;

import javax.faces.event.ActionEvent;



/**
 *
 * @author Glavni Administrator
 */
public class ZipBean {
    
    public ZipBean(){}
 private String zip;
 private String city;
 private String state;

    public String getZip() {
        return zip;
    }

    public void setZip(String zip) {
        this.zip = zip;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }
    
    public void clearCityAndState(ActionEvent e) {
        setCity("");
        setState("");
    }

    public void setCityAndStateForZip(ActionEvent e) {
        if (zip.equals("11000")) {
            setCity("Beograd");
            setState("Srbija");
        }
        else if(zip.equals("21000")) {
            setCity("Novi Sad");
            setState("Srbija");
        }
        else {
            setCity("Nema podataka");
            setState("Nema podataka");
        }
    }

  
 
}
