package ibase.dashboard.umpl.bean;

import java.rmi.RemoteException;

import ibase.dashboard.umpl.ejb.MSRTWiseCallAverageReportRemote;
import ibase.system.config.AppConnectParm;
import ibase.webitm.utility.ITMException;

import javax.naming.InitialContext;
/**
 * Session Bean implementation class MSRTerritoryWiseCallAvgBean
 */

public class MSRTerritoryWiseCallAvgBean 
{
    /**
     * Default constructor. 
     */
	MSRTWiseCallAverageReportRemote msrTerritoryWiseCallAvgRemote=null;
	
    public MSRTerritoryWiseCallAvgBean() 
    {
    	AppConnectParm appConnectParm=new AppConnectParm();
		try
        {
	        InitialContext context=new InitialContext(appConnectParm.getProperty());
	        msrTerritoryWiseCallAvgRemote=(MSRTWiseCallAverageReportRemote)context.lookup("ibase/MSRTerritoryWiseCallAvg/remote");
        }
		catch (Exception e)
        {
			System.out.println(" ibase.dashboard.umpl.bean :MSRTerritoryWiseCallAvgBean "+e);
	        e.printStackTrace();
        }
    	
    }
    
    public String getMSRWiseCallAvgDetail(String frmDate,String toDate,String territoryLoc) throws RemoteException, ITMException
    {
		String xmlString="";
		try
		{
			xmlString= msrTerritoryWiseCallAvgRemote.getMSRWiseCallAvgDetail(frmDate,toDate,territoryLoc);
		}
		catch (Exception e)
		{
			System.out.println("ibase.dashboard.umpl.bean :MSRTerritoryWiseCallAvgBean "+e);
	        e.printStackTrace();
		}
		
		return xmlString;
    }
	
	public String getTerritoryLocXmlData() throws RemoteException, ITMException
    {
		String xmlDataString="";
		try
		{
			xmlDataString= msrTerritoryWiseCallAvgRemote.getTerritoryLocXmlData();
		}
		catch (Exception e)
		{
			System.out.println("ibase.dashboard.umpl.bean :MSRTerritoryWiseCallAvgBean "+e.getMessage());
	        e.printStackTrace();
		}
		
		return xmlDataString;
    }

}
