public SurveyInfo(Epi.Web.Enter.Interfaces.DataInterfaces.ISurveyInfoDao pSurveyInfoDao)
 {
     this.SurveyInfoDao = pSurveyInfoDao;
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="pRequest"></param>
        /// <returns></returns>
        public SurveyInfoResponse GetSurveyInfo(SurveyInfoRequest pRequest)
        {
            try
            {
                SurveyInfoResponse result = new SurveyInfoResponse(pRequest.RequestId);
                //Epi.Web.Enter.Interfaces.DataInterfaces.ISurveyInfoDao surveyInfoDao = new EF.EntitySurveyInfoDao();
                //Epi.Web.BLL.SurveyInfo implementation = new Epi.Web.BLL.SurveyInfo(surveyInfoDao);

                Epi.Web.Enter.Interfaces.DataInterfaces.IDaoFactory    entityDaoFactory = new EFwcf.EntityDaoFactory();
                Epi.Web.Enter.Interfaces.DataInterfaces.ISurveyInfoDao surveyInfoDao    = entityDaoFactory.SurveyInfoDao;
                Epi.Web.BLL.SurveyInfo implementation = new Epi.Web.BLL.SurveyInfo(surveyInfoDao);

                // Validate client tag, access token, and user credentials
                if (!ValidRequest(pRequest, result, Validate.All))
                {
                    return(result);
                }

                //Validate UserPublishKey exists
                if (pRequest.Criteria.UserPublishKey == null)
                {
                    return(result);
                }

                var           criteria     = pRequest.Criteria as SurveyInfoCriteria;
                string        sort         = criteria.SortExpression;
                List <string> SurveyIdList = new List <string>();
                foreach (string id in criteria.SurveyIdList)
                {
                    SurveyIdList.Add(id.ToUpper());
                }



                List <SurveyInfoBO> SurveyBOList = new List <SurveyInfoBO>();
                //  int ResponseMaxSize = 16384;
                int ResponseMaxSize      = Int32.Parse(ConfigurationManager.AppSettings["maxBytesPerRead"]);
                int BandwidthUsageFactor = Int32.Parse(ConfigurationManager.AppSettings["BandwidthUsageFactor"]);


                Epi.Web.Enter.Interfaces.DataInterfaces.IOrganizationDao entityDaoFactory1 = new EFwcf.EntityOrganizationDao();
                //Epi.Web.Enter.Interfaces.DataInterfaces.ISurveyInfoDao surveyInfoDao = entityDaoFactory.SurveyInfoDao;
                Epi.Web.Enter.Interfaces.DataInterfaces.IOrganizationDao surveyInfoDao1 = entityDaoFactory1;

                Epi.Web.BLL.Organization implementation1 = new Epi.Web.BLL.Organization(surveyInfoDao1);
                bool ISValidOrg = implementation1.ValidateOrganization(pRequest.Criteria.OrganizationKey.ToString());

                if (ISValidOrg)
                {
                    if (pRequest.Criteria.ReturnSizeInfoOnly == true)
                    {
                        // add BandwidthUsageFactor
                        PageInfoBO PageInfoBO = implementation.GetSurveySizeInfo(SurveyIdList, criteria.ClosingDate, criteria.OrganizationKey.ToString(), BandwidthUsageFactor, criteria.SurveyType, criteria.PageNumber, criteria.PageSize, ResponseMaxSize);
                        result.PageSize      = PageInfoBO.PageSize;
                        result.NumberOfPages = PageInfoBO.NumberOfPages;
                    }
                    else
                    {
                        SurveyBOList = implementation.GetSurveyInfo(SurveyIdList, criteria.ClosingDate, criteria.OrganizationKey.ToString(), criteria.SurveyType, criteria.PageNumber, criteria.PageSize);//Default
                        foreach (SurveyInfoBO surveyInfoBO in SurveyBOList)
                        {
                            result.SurveyInfoList.Add(Mapper.ToDataTransferObject(surveyInfoBO));
                        }
                    }
                }
                else
                {
                    result.Message = "Organization Key not found";
                }

                return(result);
            }
            catch (Exception ex)
            {
                CustomFaultException customFaultException = new CustomFaultException();
                customFaultException.CustomMessage = ex.Message;
                customFaultException.Source        = ex.Source;
                customFaultException.StackTrace    = ex.StackTrace;
                customFaultException.HelpLink      = ex.HelpLink;
                throw new FaultException <CustomFaultException>(customFaultException);
            }
        }
 /// <summary>
 ///  This class is used to process the object sent from the WCF service “SurveyManager”,
 ///  save survey info into SurvayMetaData Table
 ///  and then returns a URL, StatusText and IsPublished indicator.
 /// </summary>
 /// <param name="pRequestMessage"></param>
 /// <returns></returns>
 ///
 public Publisher(Epi.Web.Enter.Interfaces.DataInterfaces.ISurveyInfoDao pSurveyInfoDao, Epi.Web.Enter.Interfaces.DataInterfaces.IOrganizationDao pPrganizationDao)
 {
     this.SurveyInfoDao   = pSurveyInfoDao;
     this.OrganizationDao = pPrganizationDao;
 }