package ibase.dashboard.umpl.bean;

import java.rmi.RemoteException;

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

import javax.naming.InitialContext;

/**
 * Session Bean implementation class MSRTerritoryWisePBPRBean
 */

public class MSRTerritoryWisePBPRBean {

    /**
     * Default constructor. 
     */
	MSRTWisePBPRReportRemote msrTerritoryWisePBPRRemote=null;
	
    public MSRTerritoryWisePBPRBean() 
    {
        // TODO Auto-generated constructor stub
    	AppConnectParm appConnectParm=new AppConnectParm();
		try
        {
	        InitialContext context=new InitialContext(appConnectParm.getProperty());
	        msrTerritoryWisePBPRRemote=(MSRTWisePBPRReportRemote)context.lookup("ibase/MSRTerritoryWisePBPR/remote");
        }
		catch (Exception e)
        {
			System.out.println(" ibase.dashboard.umpl.bean :MSRTerritoryWisePBPRBean "+e);
	        e.printStackTrace();
        }
    }
    
    public String getMSRWisePBPRDetail(String frmDate,String toDate,String territoryLoc,String specialtyCode) throws RemoteException, ITMException
    {
		String xmlString="";
		try
		{
			xmlString= msrTerritoryWisePBPRRemote.getMSRWisePBPRDetail(frmDate,toDate,territoryLoc,specialtyCode);
		}
		catch (Exception e)
		{
			System.out.println("ibase.dashboard.umpl.bean :MSRTerritoryWisePBPRBean "+e);
	        e.printStackTrace();
		}
		return xmlString;
    }
    public String getTerritoryLocXmlData() throws RemoteException, ITMException
    {
		String xmlDataString="";
		try
		{
			xmlDataString= msrTerritoryWisePBPRRemote.getTerritoryLocXmlData();
		}
		catch (Exception e)
		{
			System.out.println("ibase.dashboard.umpl.bean :MSRTerritoryWisePBPRBean "+e.getMessage());
	        e.printStackTrace();
		}
		
		return xmlDataString;
    }

}
