public static FormsHierarchyBO ToFormsHierarchyBO(this FormDigest formDigest, SurveyInfoBO surveyInfoBO)
        {
            var formsHierarchyBO = new FormsHierarchyBO {
                SurveyInfo = surveyInfoBO, IsSqlProject = true
            };

            return(formDigest.MergeIntoFormsHierarchyBO(formsHierarchyBO));
        }
Ejemplo n.º 2
0
        public void FormHierarchyBoExtension()
        {
            FormsHierarchyDTO objformsHierarchyDTO = new FormsHierarchyDTO();
            FormsHierarchyBO  objformsHierarchyBO  = new FormsHierarchyBO();

            int numberOfPublicPropertiesofFormHierarchyDTO = objformsHierarchyDTO.GetType().GetProperties().Count();
            int numberOfPublicPropertiesofFormHierarchyBO  = objformsHierarchyBO.GetType().GetProperties().Count();

            Assert.AreEqual(numberOfPublicPropertiesofFormHierarchyDTO, FormsHierarchyDTOPropertyCount, "FormHierarchyDTO properties has been changed");
            Assert.AreEqual(numberOfPublicPropertiesofFormHierarchyBO, FormsHierarchyBOPropertyCount, "FormHierarchyBO properties has been changed");
        }
 public static FormsHierarchyDTO ToFormsHierarchyDTO(this FormsHierarchyBO formsHierarchyBO)
 {
     return(new FormsHierarchyDTO
     {
         RootFormId = formsHierarchyBO.RootFormId,
         FormId = formsHierarchyBO.FormId,
         ViewId = formsHierarchyBO.ViewId,
         IsSqlProject = formsHierarchyBO.IsSqlProject,
         IsRoot = formsHierarchyBO.IsRoot,
         SurveyInfo = formsHierarchyBO.SurveyInfo.ToSurveyInfoDTO(),
         ResponseIds = formsHierarchyBO.ResponseIds != null?formsHierarchyBO.ResponseIds.ToSurveyAnswerDTOList() : null
     });
 }
Ejemplo n.º 4
0
        private List <FormsHierarchyBO> CombineLists(List <FormsHierarchyBO> RelatedFormIDsList, List <SurveyResponseBO> AllResponsesIDsList)
        {
            List <FormsHierarchyBO> List = new List <FormsHierarchyBO>();

            foreach (var Item in RelatedFormIDsList)
            {
                FormsHierarchyBO FormsHierarchyBO = new FormsHierarchyBO();
                FormsHierarchyBO.FormId       = Item.FormId;
                FormsHierarchyBO.ViewId       = Item.ViewId;
                FormsHierarchyBO.IsSqlProject = Item.IsSqlProject;
                FormsHierarchyBO.IsRoot       = Item.IsRoot;
                FormsHierarchyBO.SurveyInfo   = Item.SurveyInfo;
                if (AllResponsesIDsList != null)
                {
                    FormsHierarchyBO.ResponseIds = AllResponsesIDsList.Where(x => x.SurveyId == Item.FormId).ToList();
                }
                List.Add(FormsHierarchyBO);
            }
            return(List);
        }
Ejemplo n.º 5
0
        public static List <FormsHierarchyBO> MapToFormHierarchyBOs(string RootId, List <SurveyInfoBO> SurveyInfoBOList)
        {
            List <FormsHierarchyBO> result = new List <FormsHierarchyBO>();

            foreach (var item in SurveyInfoBOList)
            {
                FormsHierarchyBO FormsHierarchyBO = new FormsHierarchyBO();
                FormsHierarchyBO.ViewId       = item.ViewId;
                FormsHierarchyBO.FormId       = item.SurveyId;
                FormsHierarchyBO.SurveyInfo   = item;
                FormsHierarchyBO.IsSqlProject = item.IsSqlProject;

                if (item.SurveyId == RootId)
                {
                    FormsHierarchyBO.IsRoot = true;
                }
                result.Add(FormsHierarchyBO);
            }
            return(result);
        }
        public List <FormsHierarchyBO> GetFormsHierarchyIdsByRootId(string RootId)
        {
            List <SurveyInfoBO>     SurveyInfoBOList = new List <SurveyInfoBO>();
            List <FormsHierarchyBO> result           = new List <FormsHierarchyBO>();

            SurveyInfoBOList = this.SurveyInfoDao.GetFormsHierarchyIdsByRootId(RootId);
            foreach (var item in SurveyInfoBOList)
            {
                FormsHierarchyBO FormsHierarchyBO = new FormsHierarchyBO();
                FormsHierarchyBO.ViewId     = item.ViewId;
                FormsHierarchyBO.FormId     = item.SurveyId;
                FormsHierarchyBO.SurveyInfo = item;
                if (item.SurveyId == RootId)
                {
                    FormsHierarchyBO.IsRoot = true;
                }
                result.Add(FormsHierarchyBO);
            }

            return(result);
        }
Ejemplo n.º 7
0
        private List <FormsHierarchyBO> CombineLists(List <FormsHierarchyBO> relatedFormIDsList, List <SurveyResponseBO> allResponsesIDsList)
        {
            List <FormsHierarchyBO> List = new List <FormsHierarchyBO>();

            foreach (var item in relatedFormIDsList)
            {
                FormsHierarchyBO formsHierarchyBO = new FormsHierarchyBO();
                formsHierarchyBO.RootFormId   = item.RootFormId;
                formsHierarchyBO.FormId       = item.FormId;
                formsHierarchyBO.ViewId       = item.ViewId;
                formsHierarchyBO.IsSqlProject = item.IsSqlProject;
                formsHierarchyBO.IsRoot       = item.IsRoot;
                formsHierarchyBO.SurveyInfo   = item.SurveyInfo;
                if (allResponsesIDsList != null)
                {
                    formsHierarchyBO.ResponseIds = allResponsesIDsList.Where(x => x.FormId == item.FormId).ToList();
                }
                List.Add(formsHierarchyBO);
            }
            return(List);
        }
 public static FormsHierarchyBO MergeIntoFormsHierarchyBO(this FormDigest formDigest, FormsHierarchyBO formsHierarchyBO)
 {
     formsHierarchyBO.FormId     = formDigest.FormId;
     formsHierarchyBO.ViewId     = formDigest.ViewId;
     formsHierarchyBO.RootFormId = formDigest.RootFormId;
     formsHierarchyBO.IsRoot     = formDigest.IsRootForm;
     return(formsHierarchyBO);
 }