public SurveyFacade(IDataEntryService dataEntryService, ISurveyInfoService surveyInfoService, IFormSettingsService formSettingsService, ISecurityFacade securityFacade, SurveyResponseBuilder surveyResponseBuilder, IProjectMetadataProvider projectMetadataProvider, Epi.Cloud.Common.Message.SurveyInfoRequest surveyInfoRequest, Epi.Cloud.Common.Message.SurveyAnswerRequest surveyResponseRequest, Epi.Cloud.Common.Message.UserAuthenticationRequest surveyAuthenticationRequest, SurveyAnswerDTO surveyAnswerDTO, FormInfoDTO formInfoDTO) { _dataEntryService = dataEntryService; _surveyInfoService = surveyInfoService; _formSettingsService = formSettingsService; _securityFacade = securityFacade; _surveyResponseBuilder = surveyResponseBuilder; _projectMetadataProvider = projectMetadataProvider; _surveyInfoRequest = surveyInfoRequest; _surveyAnswerRequest = surveyResponseRequest; _surveyAnswerDTO = surveyAnswerDTO; _formInfoDTO = formInfoDTO; }
public static SurveyInfoDTO ToSurveyInfoDTO(this FormInfoDTO formInfoDTO, FormDigest formDigest) { return(new SurveyInfoDTO { DataAccessRuleId = formInfoDTO.DataAccessRuleId, HasDraftModeData = formInfoDTO.HasDraftModeData, IsDraftMode = formInfoDTO.IsDraftMode, IsShareable = formInfoDTO.IsShareable, IsShared = formInfoDTO.IsShared, OrganizationName = formInfoDTO.OrganizationName, OwnerId = formInfoDTO.OwnerId, SurveyId = formInfoDTO.FormId, SurveyName = formInfoDTO.FormName, SurveyNumber = formInfoDTO.FormName, ViewId = formDigest.ViewId, StartDate = DateTime.MinValue, ClosingDate = DateTime.MinValue, SurveyType = SurveyTypes.MultipleResponse, OrganizationKey = Guid.Empty, UserPublishKey = Guid.Empty, DepartmentName = string.Empty, IntroductionText = string.Empty, ExitText = string.Empty, IsSqlProject = formInfoDTO.IsSQLProject, DBConnectionString = null, ParentFormId = null }); }
/// <summary> /// Injectinting ISurveyInfoRepository through Constructor /// </summary> /// <param name="iSurveyInfoRepository"></param> public SurveyFacade(ISurveyInfoRepository iSurveyInfoRepository, ISurveyAnswerRepository iSurveyResponseRepository, Epi.Web.Enter.Common.Message.SurveyInfoRequest surveyInfoRequest, Epi.Web.Enter.Common.Message.SurveyAnswerRequest surveyResponseRequest, Enter.Common.DTO.SurveyAnswerDTO surveyAnswerDTO, SurveyResponseXML surveyResponseXML, UserAuthenticationRequest surveyAuthenticationRequest, Epi.Web.Enter.Common.DTO.PassCodeDTO PassCodeDTO, FormInfoDTO FormInfoDTO) { _iSurveyInfoRepository = iSurveyInfoRepository; _iSurveyAnswerRepository = iSurveyResponseRepository; _surveyInfoRequest = surveyInfoRequest; _surveyAnswerRequest = surveyResponseRequest; _surveyAnswerDTO = surveyAnswerDTO; _surveyResponseXML = surveyResponseXML; _surveyAuthenticationRequest = surveyAuthenticationRequest; _PassCodeDTO = PassCodeDTO; _FormInfoDTO = FormInfoDTO; }
/// <summary> /// Maps FormInfo DTO to FormInfo Model /// </summary> /// <param name="FormInfoDTO"></param> /// <returns></returns> public static FormInfoModel ToFormInfoModel(this FormInfoDTO FormInfoDTO) { return(new FormInfoModel { IsSQLProject = FormInfoDTO.IsSQLProject, FormId = FormInfoDTO.FormId, FormName = FormInfoDTO.FormName, FormNumber = FormInfoDTO.FormNumber, IsDraftMode = FormInfoDTO.IsDraftMode, OrganizationId = FormInfoDTO.OrganizationId, OrganizationName = FormInfoDTO.OrganizationName, UserId = FormInfoDTO.UserId, IsOwner = FormInfoDTO.IsOwner, OwnerFName = FormInfoDTO.OwnerFName, OwnerLName = FormInfoDTO.OwnerLName, IsShareable = FormInfoDTO.IsShareable, IsShared = FormInfoDTO.IsShared, DataAccessRuleId = FormInfoDTO.DataAccessRuleId, }); }
public void TestFormInfoBODTO() { //var BO = new FormInfoBO(); ////{ //FormId = "2e1d01d4-f50d-4f23-888b-cd4b7fc9884b", FormName = "Zika", UserId = 1014 } //var Forminfo = BO.ToFormInfoDTO(); //int numberOfPublicProperties = typeof(FormInfoBO).GetProperties(System.Reflection.BindingFlags.Public).Count(); //int numberOfPublicPropertiesforDTO = typeof(FormInfoDTO).GetProperties(System.Reflection.BindingFlags.Public).Count(); ////Assert.AreEqual(BO.UserId, Forminfo.UserId); ////Assert.AreEqual(BO.FormId, Forminfo.FormId); //Assert.AreEqual(numberOfPublicProperties, numberOfPublicPropertiesforDTO); var BO = new FormInfoBO(); var Forminfo = BO.ToFormInfoDTO(); FormInfoBO objFormInfoBO = new FormInfoBO(); //Class Instance FormInfoDTO objFormInfoDTO = new FormInfoDTO(); // From Extension Method // var objFormInfoBOExtensions = FormInfoBOExtensions.ToFormInfoDTO(BO); int numberOfPublicPropertiesofDTO = objFormInfoDTO.GetType().GetProperties().Count(); int numberOfPublicPropertiesofBO = objFormInfoBO.GetType().GetProperties().Count(); Assert.AreEqual(numberOfPublicPropertiesofDTO, FormInfoDTOPropertyCount, "FormInfoDTO properties has been changed"); Assert.AreEqual(numberOfPublicPropertiesofBO, FormInfoBOPropertyCount, "FormInfoBO properties has been changed"); //Assert.AreEqual(numberOfPublicPropertiesofDTO, numberOfPublicPropertiesofBO); }