package com.reallinkbilling.jspRedirect;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class SearchEmployeeForUpdateJsp extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1985701117825420942L;
	private HttpSession session;
	private Map<String,String> employeeSearchOptionList = new HashMap<String,String>();
	private String employeeSearchOption;
	private String defaultValue;
	
	public String execute(){
		
		String result = "login";
		session=ServletActionContext.getRequest().getSession(false); 
		 
	        if(session==null || session.getAttribute("login")==null){ 
	        	addActionMessage("Please Login First !!!");
	        	result = "login";
	        }  
	        else{
	        	
	        	this.getEmployeeSearchOptionList().put("BYNAME", "BY NAME");
	        	this.getEmployeeSearchOptionList().put("BYMOBILENUMBER", "BY MOBILE NUMBER");
	        	this.getEmployeeSearchOptionList().put("BYDESIGNATION", "BY DESIGNATION");
	        	
	        	this.setEmployeeSearchOption("BYNAME");
	        	
	        	result = SUCCESS;
	        }
	      return result;
}
public HttpSession getSession() {
	return session;
}
public void setSession(HttpSession session) {
	this.session = session;
}
public Map<String, String> getEmployeeSearchOptionList() {
	return employeeSearchOptionList;
}
public void setEmployeeSearchOptionList(Map<String, String> employeeSearchOptionList) {
	this.employeeSearchOptionList = employeeSearchOptionList;
}
public String getEmployeeSearchOption() {
	return employeeSearchOption;
}
public void setEmployeeSearchOption(String employeeSearchOption) {
	this.employeeSearchOption = employeeSearchOption;
}
public static long getSerialversionuid() {
	return serialVersionUID;
}
public String getDefaultValue() {
	return defaultValue;
}
public void setDefaultValue(String defaultValue) {
	this.defaultValue = defaultValue;
}


}
