package com.reallinkbilling.jspRedirect;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class AddNewCustomerJsp extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 135536528403146102L;
	private HttpSession session;
	private List<String> customerTypeList = new ArrayList<String>();
	
	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.getCustomerTypeList().add("REGULER");
	        	this.getCustomerTypeList().add("RETAILER");
	        	this.getCustomerTypeList().add("DEALER");
	        	   
	        	result = "success";
	        }

	        return result;
	}

	public HttpSession getSession() {
		return session;
	}

	public void setSession(HttpSession session) {
		this.session = session;
	}

	public List<String> getCustomerTypeList() {
		return customerTypeList;
	}

	public void setCustomerTypeList(List<String> customerTypeList) {
		this.customerTypeList = customerTypeList;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	

}
