protected void Page_Init(object sender, EventArgs e)
 {
     _element = PageElement as PageElementReqDto;
     if (_element == null)
     {
         throw new BugException("Crm callback received an incompatible page element \"" + PageElement.GetType().Name + "\"");
     }
 }
예제 #2
0
 public void Setup()
 {
     CreateNewQuestionnaire();
     CreateNewFormPage();
     long responseKey = FormRegistry.ResponseDao.CreateSubmitResponse(Constants.UnknownCustomer, null, _currentQuestionnaire.QuestionnaireId, ViewType.CleanSheetOverlay).First;            
     PersonalResponseDto dto = new PersonalResponseDto(responseKey, "address1", "address2", "address3", "bus", "businessSiebel63", "company name", "UK", "county", Constants.UnknownCustomer, "email", "firstname", "flex1", "flex10", "flex11", "flex12", "flex13", "flex14", "flex15", "flex2", "flex3", "flex4", "flex5", "flex6", "flex7", "flex8", "flex9", "job", "jobsiebel", "jobtitle", "lastname", "persontit", "postcode", "pwd", "telephone", "telephone2", "telephone3", "telephone4", "fax", "fax2", "fax3", "fax4", "mobile", "mobile2", "town", "wor", "world6", "United Kingdom", null, "prefLang", "companyWebsite", "companyRevenue");
     FormRegistry.ResponseDao.Add(dto);
     SpecificCrmResponseDto dto2 = new SpecificCrmResponseDto(responseKey, false, true, SpecificCrmResponseDto.ElementTypeRequestOptInOut, _currentPage.PageId, null, _currentPage.QuestionnaireId, "respdesc");
     FormRegistry.ResponseDao.Add(dto2);
     dto3 = new PrivacyResponseDto(responseKey, true, true, true, EmailPreferences.Html, true);
     FormRegistry.ResponseDao.Add(dto3);
     PrivacyDataSectionDto dto4 = new PrivacyDataSectionDto("privacy header", true, _currentPage.PageId, true,
         "privacy text", "email", "email pref", "email pref html", "email pref text", "post", "phone",
         "general opt out", "yeys", "no", "crm offer code", true);
     PrivacyDataSectionDto pers = FormRegistry.PrivacyDao.Create(dto4);
     PageElementType type = PageElementType.RequestedMoreInfo;
     PageElementReqDto dto5 = new PageElementReqDto("element text", true, type, _currentPage.PageId, 0, Migration.GetMaxLength(type), true);
     PageElementReqDto pers2 = FormRegistry.PageElementDao.Create(dto5);
 }
예제 #3
0
        public void TestCheckIsNextElement()
        {
            List<PageElementReqDto> elementsOfQuestionnaire = new List<PageElementReqDto>();
            PageElementReqDto elemCC = new PageElementReqDto("1", true, PageElementType.Content, 1, 1, 0, false);
            PageElementReqDto elemBH = new PageElementReqDto("1", true, PageElementType.BandedHeader, 1, 1, 0, false);
            PageElementReqDto elemLF = new PageElementReqDto("1", true, PageElementType.ForgotPwdLink, 1, 1, 0, false);
            PageElementReqDto elemLN = new PageElementReqDto("1", true, PageElementType.NewUserLink, 1, 1, 0, false);
            PageElementReqDto elemLP = new PageElementReqDto("1", true, PageElementType.LoginPasswordField, 1, 1, 0, false);
            PageElementReqDto elemLS = new PageElementReqDto("1", true, PageElementType.LoginPasswordSentMessage, 1, 1, 0, false);
            //not ignore
            PageElementReqDto elemFU = new PageElementReqDto("1", true, PageElementType.FileUpload, 1, 1, 0, false);
            PageElementReqDto elemPW = new PageElementReqDto("1", true, PageElementType.PasswordFields, 1, 1, 0, false);
            PageElementReqDto elemMT = new PageElementReqDto("1", true, PageElementType.MultipleTextLines, 1, 1, 0, false);

            elementsOfQuestionnaire.Add(elemCC);
            elementsOfQuestionnaire.Add(elemBH);
            elementsOfQuestionnaire.Add(elemLF);
            elementsOfQuestionnaire.Add(elemLN);
            elementsOfQuestionnaire.Add(elemLP);
            elementsOfQuestionnaire.Add(elemLS);
            elementsOfQuestionnaire.Add(elemFU);

            elementsOfQuestionnaire.Add(elemPW);
            elementsOfQuestionnaire.Add(elemMT);

            int currentPosition = -1;
            PageElementType elementToLookFor = PageElementType.Content;
            Assert.IsTrue(MasterReport.IsNextEligibleElement(elementToLookFor, ref currentPosition, elementsOfQuestionnaire));
            Assert.AreEqual(-1, currentPosition);

            elementToLookFor = PageElementType.FileUpload;
            Assert.IsTrue(MasterReport.IsNextEligibleElement(elementToLookFor, ref currentPosition, elementsOfQuestionnaire));
            Assert.AreEqual(6, currentPosition);


        }
예제 #4
0
 public static PageElementReqDto CreateReqElement(PageDto page, string elementText, PageElementType pageElementType, int sortSequence)
 {
     PageElementReqDto retval = new PageElementReqDto(elementText, true, pageElementType, page.PageId, sortSequence, 100, true);
     Assert.Contains(pageElementType, Constants.PageElementReqTypes);
     retval = FormRegistry.PageElementDao.Create(retval);
     Assert.IsNotNull(retval);
     return retval;
 }
예제 #5
0
        public static PageElementChoiceDto TestPageElementChoiceCreateList(PageDto _currentPage, out PageElementReqDto pers)
        {
            PageElementType type = PageElementType.RequestedMoreInfo;
            PageElementReqDto dto = new PageElementReqDto("element text", true, type, _currentPage.PageId, 0, Migration.GetMaxLength(type), true);
            pers = FormRegistry.PageElementDao.Create(dto);
            Assert.IsNotNull(pers);
            Assert.AreEqual(dto.GetType(), pers.GetType());
            Assert.Greater(pers.ElementId, 0);
            LovInfo[] lovKeys = new LovInfo[4];
            /*
                        h_params["comment"] = constants.COL_RESP_EMAIL;
						h_params["col_name_1"] = constants.COL_RESP_EMAIL;
						h_params["col_value_1"] = constants.VAL_CHOICE_TEXT;
						h_params["col_name_2"] = constants.COL_SHIP_METHOD;
						h_params["lov_FK_2"] = 0;
						h_params["col_name_3"] = constants.COL_SUBJECT;
						h_params["col_value_3"] = tb_subject;
						h_params["col_name_4"] = constants.COL_SUMMARY;
						h_params["col_value_4"] = tb_summary;
             * */
            lovKeys[0] = new LovInfo(constants.COL_RESP_EMAIL, constants.VAL_CHOICE_TEXT, null);
            lovKeys[1] = new LovInfo(constants.COL_SHIP_METHOD, null, null);
            lovKeys[2] = new LovInfo(constants.COL_SUBJECT, "subject 1", null);
            lovKeys[3] = new LovInfo(constants.COL_SUMMARY, "summary 1", null);
            PageElementChoiceDto choice1 = new PageElementChoiceDto(pers.ElementId, "choice label", pers.PageId, 0, Migration.GetMaxLength(pers.PageElementType), true, "*****@*****.**", constants.COL_RESP_EMAIL, lovKeys);

            PageElementChoiceDto pers1 = FormRegistry.PageElementDao.Create(choice1);
            return pers1;
        }
예제 #6
0
 public void Initialize(QuestionnaireDto quesitonnaire, PageDto page, PageElementAssemblyDto pageElementAssembly)
 {
     _pageElementType = pageElementAssembly.Pageelement.PageElementType;
     _questionnaire = quesitonnaire;
     _page = page;
     _pageElement = pageElementAssembly.Pageelement;
     _choices = pageElementAssembly.Elementchoices;
     _isValid = true;
     Load += new EventHandler(WucPageElementBase_Load);
 }