public SurveyAnswerResponse GetAncestorResponseIdsByChildId(SurveyAnswerRequest pRequest) { Epi.Web.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EF.EntityDaoFactory(); SurveyAnswerResponse SurveyAnswerResponse = new SurveyAnswerResponse(); Epi.Web.Interfaces.DataInterfaces.ISurveyResponseDao SurveyResponseDao = entityDaoFactory.SurveyResponseDao; Epi.Web.Interfaces.DataInterfaces.ISurveyInfoDao ISurveyInfoDao = entityDaoFactory.SurveyInfoDao; Epi.Web.BLL.SurveyResponse Implementation = new Epi.Web.BLL.SurveyResponse(SurveyResponseDao, ISurveyInfoDao); List <SurveyResponseBO> SurveyResponseBOList = Implementation.GetAncestorResponseIdsByChildId(pRequest.Criteria.SurveyAnswerIdList[0]); SurveyAnswerResponse.SurveyResponseList = Mapper.ToDataTransferObject(SurveyResponseBOList); return(SurveyAnswerResponse); }
public SurveyAnswerResponse GetSurveyAnswerHierarchy(SurveyAnswerRequest pRequest) { Epi.Web.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EF.EntityDaoFactory(); SurveyAnswerResponse SurveyAnswerResponse = new SurveyAnswerResponse(); Epi.Web.Interfaces.DataInterfaces.ISurveyResponseDao SurveyResponseDao = entityDaoFactory.SurveyResponseDao; Epi.Web.Interfaces.DataInterfaces.ISurveyInfoDao ISurveyInfoDao = entityDaoFactory.SurveyInfoDao; Epi.Web.BLL.SurveyResponse Implementation = new Epi.Web.BLL.SurveyResponse(SurveyResponseDao, ISurveyInfoDao); List <SurveyResponseBO> SurveyResponseBOList = Implementation.GetResponsesHierarchyIdsByRootId(pRequest.SurveyAnswerList[0].ResponseId); SurveyAnswerResponse.SurveyResponseList = Mapper.ToDataTransferObject(SurveyResponseBOList); return(SurveyAnswerResponse); }
public UserAuthenticationResponse SetPassCode(UserAuthenticationRequest request) { var response = new UserAuthenticationResponse(); Epi.Web.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EF.EntityDaoFactory(); Epi.Web.Interfaces.DataInterfaces.ISurveyResponseDao ISurveyResponseDao = entityDaoFactory.SurveyResponseDao; Epi.Web.Interfaces.DataInterfaces.ISurveyInfoDao ISurveyInfoDao = entityDaoFactory.SurveyInfoDao; Epi.Web.BLL.SurveyResponse Implementation = new Epi.Web.BLL.SurveyResponse(ISurveyResponseDao, ISurveyInfoDao); Epi.Web.Common.BusinessObject.UserAuthenticationRequestBO PassCodeBO = Mapper.ToPassCodeBO(request); Implementation.SavePassCode(PassCodeBO); return(response); }
/// <summary> /// /// </summary> /// <param name="pRequest"></param> /// <returns></returns> public SurveyInfoResponse GetSurveyInfo(SurveyInfoRequest surveyInfoRequest) { try { SurveyInfoResponse response = new SurveyInfoResponse(surveyInfoRequest.RequestId); Epi.Web.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EF.EntityDaoFactory(); Epi.Web.Interfaces.DataInterfaces.ISurveyInfoDao surveyInfoDao = entityDaoFactory.SurveyInfoDao; Epi.Web.BLL.SurveyInfo surveyInfo = new Epi.Web.BLL.SurveyInfo(surveyInfoDao); if (!ValidRequest(surveyInfoRequest, response, Validate.All)) { return(response); } var criteria = surveyInfoRequest.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> bo = surveyInfo.GetSurveyInfoById(SurveyIdList); response.SurveyInfoList = Mapper.ToDataTransferObject(bo); return(response); } 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); } }
public SurveyAnswerResponse GetResponsesByRelatedFormId(SurveyAnswerRequest pRequest) { Epi.Web.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EF.EntityDaoFactory(); SurveyAnswerResponse SurveyAnswerResponse = new SurveyAnswerResponse(); Epi.Web.Interfaces.DataInterfaces.ISurveyResponseDao SurveyResponseDao = entityDaoFactory.SurveyResponseDao; Epi.Web.Interfaces.DataInterfaces.ISurveyInfoDao ISurveyInfoDao = entityDaoFactory.SurveyInfoDao; Epi.Web.BLL.SurveyResponse Implementation = new Epi.Web.BLL.SurveyResponse(SurveyResponseDao, ISurveyInfoDao); //List<SurveyResponseBO> SurveyResponseBOList = Implementation.GetResponsesByRelatedFormId(pRequest.Criteria.SurveyAnswerIdList[0], pRequest.Criteria.SurveyId); List <SurveyResponseBO> SurveyResponseBOList = Implementation.GetResponsesByRelatedFormId(pRequest.Criteria.SurveyAnswerIdList[0], pRequest.Criteria); SurveyAnswerResponse.SurveyResponseList = Mapper.ToDataTransferObject(SurveyResponseBOList); //Query The number of records //SurveyAnswerResponse.NumberOfPages = Implementation.GetNumberOfPages(pRequest.Criteria.SurveyId, pRequest.Criteria.IsMobile); //SurveyAnswerResponse.NumberOfResponses = Implementation.GetNumberOfResponses(pRequest.Criteria); //SurveyAnswerResponse.NumberOfPages = Implementation.GetNumberOfPages(pRequest.Criteria); //SurveyAnswerResponse.NumberOfResponses = Implementation.GetNumberOfResponses(pRequest.Criteria); return(SurveyAnswerResponse); }
public SurveyInfo(Epi.Web.Interfaces.DataInterfaces.ISurveyInfoDao pSurveyInfoDao) { this.SurveyInfoDao = pSurveyInfoDao; }
/// <summary> /// /// </summary> /// <param name="pRequest"></param> /// <returns></returns> public SurveyAnswerResponse GetFormResponseList(SurveyAnswerRequest pRequest) { try { SurveyAnswerResponse result = new SurveyAnswerResponse(pRequest.RequestId); Epi.Web.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EF.EntityDaoFactory(); Epi.Web.Interfaces.DataInterfaces.ISurveyResponseDao ISurveyResponseDao = entityDaoFactory.SurveyResponseDao; Epi.Web.Interfaces.DataInterfaces.ISurveyInfoDao ISurveyInfoDao = entityDaoFactory.SurveyInfoDao; Epi.Web.BLL.SurveyResponse Implementation = new Epi.Web.BLL.SurveyResponse(ISurveyResponseDao, ISurveyInfoDao); SurveyAnswerCriteria criteria = pRequest.Criteria; //result.SurveyResponseList = Mapper.ToDataTransferObject(Implementation.GetFormResponseListById(pRequest.Criteria.SurveyId, pRequest.Criteria.PageNumber, pRequest.Criteria.IsMobile)); result.SurveyResponseList = Mapper.ToDataTransferObject(Implementation.GetFormResponseListById(criteria));//Pain point //Query The number of records //result.NumberOfPages = Implementation.GetNumberOfPages(pRequest.Criteria.SurveyId, pRequest.Criteria.IsMobile); //result.NumberOfResponses = Implementation.GetNumberOfResponses(pRequest.Criteria.SurveyId); result.NumberOfPages = Implementation.GetNumberOfPages(pRequest.Criteria); result.NumberOfResponses = Implementation.GetNumberOfResponses(pRequest.Criteria); //Get form info //Interfaces.DataInterface.IFormInfoDao surveyInfoDao = new EF.EntityFormInfoDao(); //Epi.Web.BLL.FormInfo ImplementationFormInfo = new Epi.Web.BLL.FormInfo(surveyInfoDao); //result.FormInfo = Mapper.ToFormInfoDTO(ImplementationFormInfo.GetFormInfoByFormId(pRequest.Criteria.SurveyId, false, pRequest.Criteria.UserId)); SurveyInfoResponse response = new SurveyInfoResponse(pRequest.RequestId); Epi.Web.Interfaces.DataInterfaces.ISurveyInfoDao surveyInfoDao = entityDaoFactory.SurveyInfoDao; Epi.Web.BLL.SurveyInfo surveyInfo = new Epi.Web.BLL.SurveyInfo(surveyInfoDao); if (!ValidRequest(pRequest, response, Validate.All)) { return(result); } List <string> SurveyIdList = new List <string>(); SurveyIdList.Add(pRequest.Criteria.SurveyId.ToUpper()); List <SurveyInfoBO> bo = surveyInfo.GetSurveyInfoById(SurveyIdList); result.SurveyInfo = Mapper.ToDataTransferObject(bo)[0]; 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.Interfaces.DataInterfaces.ISurveyInfoDao pSurveyInfoDao, Epi.Web.Interfaces.DataInterfaces.IOrganizationDao pPrganizationDao) { this.SurveyInfoDao = pSurveyInfoDao; this.OrganizationDao = pPrganizationDao; }
/// <summary> /// /// </summary> /// <param name="pRequest"></param> /// <returns></returns> public SurveyInfoResponse GetSurveyInfo(SurveyInfoRequest pRequest) { try { SurveyInfoResponse result = new SurveyInfoResponse(pRequest.RequestId); //Epi.Web.Interfaces.DataInterfaces.ISurveyInfoDao surveyInfoDao = new EF.EntitySurveyInfoDao(); //Epi.Web.BLL.SurveyInfo implementation = new Epi.Web.BLL.SurveyInfo(surveyInfoDao); Epi.Web.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EF.EntityDaoFactory(); Epi.Web.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.Interfaces.DataInterfaces.IOrganizationDao entityDaoFactory1 = new EF.EntityOrganizationDao(); //Epi.Web.Interfaces.DataInterfaces.ISurveyInfoDao surveyInfoDao = entityDaoFactory.SurveyInfoDao; Epi.Web.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); } }