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; }
public PageElementChoiceDto(int elementKey, string choiceLabel, int pageId, int sortSequence, int maxLength, int choiceId, bool hasExtraTextField/*, bool prefilled*/, string mailtToRecipient, string lovKey, LovInfo[] lovKeys) : base(elementKey, choiceLabel, pageId, sortSequence, maxLength) { _choiceId = choiceId; //_choiceLabel = choiceLabel; _hasExtraTextField = hasExtraTextField; //_prefilled = prefilled; _mailToRecipient = mailtToRecipient; _lovKey = lovKey; _choices = new List<LovInfo>(); LovInfos = lovKeys; }