Ejemplo n.º 1
0
 public void Initialize(OmnitureDto omniture, QuestionnaireDto quesitonnaire, PageDto page)
 {
     _omniture = omniture;
     _questionnaire = quesitonnaire;
     _page = page;
     Load += new EventHandler(WucMetaBase_Load);
 }
Ejemplo n.º 2
0
 public static SpecificCrmResponseDto TestAddSpecificCrmResponseDto(PageDto _currentPage)
 {
     long responseKey = FormRegistry.ResponseDao.CreateSubmitResponse(Constants.UnknownCustomer, null, _currentPage.QuestionnaireId, ViewType.CleanSheetOverlay).First;
     Assert.Greater(responseKey, 0);
     SpecificCrmResponseDto dto = new SpecificCrmResponseDto(responseKey, false, true, SpecificCrmResponseDto.ElementTypeRequestOptInOut, _currentPage.PageId, null, _currentPage.QuestionnaireId, "respdesc");
     Assert.IsTrue(FormRegistry.ResponseDao.Add(dto));
     return dto;
 }
Ejemplo n.º 3
0
        //private List<KeyValuePair<PageElementDto, List<PageElementChoiceDto>>> _elements;
        //public List<KeyValuePair<PageElementDto, List<PageElementChoiceDto>>> Elements
        //{
        //    get { return _elements; }
        //    set { _elements = value; }
        //}

        public PageAssemblyDto(QuestionnaireDto questionnaire, PageDto page, OmnitureDto omniture, List<PageElementAssemblyDto> elements, List<PagePredefinedQuestionAssemblyDto> predefinedQuestions)
        {
            if (questionnaire == null || page == null || omniture == null || elements == null)
            {
                throw new ArgumentNullException("PageAssemblyDto requires all parameters to be not null");
            }
            _questionnaire = questionnaire;
            _page = page;
            _omniture = omniture;
            _elements = elements;
            _predeinedQuestions = predefinedQuestions;
        }
Ejemplo n.º 4
0
 public void CreateNewQuestionnairePage()
 {
     _validCampaign = CreateNewCampaign();
     _validQuestionnaire = CreateNewQuestionnaire();
     _validPage = CreateNewFormPage();
     CreateNewPage(PageType.ClosurePage);
     _inValidQuestionnaire = CreateNewQuestionnaire(false);
     _inValidPage = CreateNewFormPage();
     CreateNewPage(PageType.ClosurePage);
     //if(setup)CreateNewQuestionairePage(out _validCampaign, out _validQuestionnaire, out _validPage, false);
     //if (setup) CreateNewQuestionairePage(out _inValidCampaign, out _inValidQuestionnaire, out _inValidPage, true);
 }
Ejemplo n.º 5
0
 public static PageElementReqDto CreateElement(PageDto page, string elementText, PageElementType pageElementType, int sortSequence, string errorText)
 {
     PageElementReqDto retval = null;
     if (Array.Exists<PageElementType>(Constants.PageElementErrorTypes, delegate(PageElementType cur) { return cur == pageElementType; }))
     {
         retval = CreateErrorElement(page, elementText, pageElementType, sortSequence, errorText);
     }
     else
     {
         retval = CreateReqElement(page, elementText, pageElementType, sortSequence);
     }
     return retval;
 }
Ejemplo n.º 6
0
        public PageDto Create(PageDto dto)
        {
            PageDto retval = null;
            DbCommand sp = null;
            DbConnection connection = null;
            IDataReader reader = null;
            try
            {
                connection = _dbLayer.GetConnection();
                sp = connection.CreateCommand();

                sp.CommandText = "rfg_Page_Create";
                sp.CommandType = CommandType.StoredProcedure;
                Write(sp, dto, false);
                _dbLayer.AddReturnParameter(sp);
                sp.ExecuteNonQuery();
                int id = _dbLayer.GetReturnValue(sp);
                if (id > 0)
                {
                    retval = Fill(dto, id);
                }
                else
                {
                    Trace.WriteLine("PageDao.Create(" + dto + "): returned " + id);
                }
            }
            catch (DbException e)
            {
                Trace.WriteLine("PageDao.Create(" + dto + "): " + e.Message);
                retval = null;
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
                if (sp != null)
                    sp.Dispose();
                if (connection != null)
                {
                    _dbLayer.ReturnConnection(connection);
                }
                else
                {
                    _dbLayer.ReturnConnection(connection, true);
                }
            }
            return retval;
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            page_utilities.Set_titles(this, "Edit Navigation Tabs");
			permss = check_permissions(this.Page, true);

            if (Session["page_id"] == null || Session["questionnaire_id"] == null)
            {                
                Response.Redirect("edit_page_overview.aspx?content=edit", true);
            }
            else
            {
                pageIdFromSession = Session["page_id"].ToString();
                questionnaireIdFromSession = Session["questionnaire_id"].ToString();                
            }            
                        
            try
            {
                PageAssemblyDto retval = QuestionnaireFacade.GetPageByPageId(Int64.Parse(questionnaireIdFromSession), int.Parse(pageIdFromSession), ViewType.Undefined, false);
                if (retval == null)
                {
                    Response.Redirect("edit_page_overview.aspx?content=edit", true);
                }
                formType = Migration.ConvertPageTypeToDisplayedString(retval.Page.PageType);
                page = retval.Page;
            }
            catch (UserCausedException)
            { }                        

            if (!IsPostBack)
            {
                int initialFormOrder = 1;
                listOfNavigationElements = new List<NavigationElementDto>();
                if (page.PageType != PageType.FormPage)
                {
                    initialFormOrder = PagePrefill();
                    addElementPanel.Visible = false;


                    delete_element.Enabled = false;
                    delete_element.Style.Add("readonly", "true");
                    delete_element.ToolTip = "In order to remove tab navigation, you need to delete that from formpage"; 
                }
                LoadListOfNavigationElements(page.PageType, initialFormOrder);
                InitializePanels();
            }
            
        }
Ejemplo n.º 8
0
 private void Write(DbCommand sp, PageDto dto, bool includeId)
 {
     if (includeId)
         _dbLayer.AddInParameter(sp, "@pageId", DbType.Int32, dto.PageId);
     _dbLayer.AddInParameter(sp, "@pageType", DbType.String, Constants.Convert(dto.PageType));
     _dbLayer.AddInParameter(sp, "@questionnaireId", DbType.Int32, dto.QuestionnaireId);
     _dbLayer.AddInParameter(sp, "@pageTitle", DbType.String, dto.PageTitle);
     _dbLayer.AddInParameter(sp, "@pageTagline", DbType.String, dto.PageTagline);
     if (dto.MdaId.HasValue)
         _dbLayer.AddInParameter(sp, "@mdaId", DbType.Int32, dto.MdaId);
     else
         _dbLayer.AddInParameter(sp, "@mdaId", DbType.Int32, DBNull.Value);
     _dbLayer.AddInParameter(sp, "@introduction", DbType.String, dto.Introduction);
     _dbLayer.AddInParameter(sp, "@requiredSentence", DbType.String, dto.RequiredSentence);
     _dbLayer.AddInParameter(sp, "@buttonText", DbType.String, dto.ButtonText);
     _dbLayer.AddInParameter(sp, "@leftNavHtml", DbType.String, dto.LeftNavHtml);            
 }
Ejemplo n.º 9
0
 public void TestCreateListDelete()
 {
     PageType pageType = PageType.FormPage;
     int questionnaireId = _currentQuestionnaire.QuestionnaireId;
     string pageTitle = "test page";
     int? mdaId = null;
     string mdaFileName = null;
     string introduction = "intro";
     string requiredSentence = "required sentence";
     string buttonText = "save button";
     string leftNavHtml = "left nav html";
     string pageTagline = "page tagline";
     string privacySentence = "privacy sentence";
     PageDto dto = new PageDto(pageType, questionnaireId, pageTitle, mdaId, mdaFileName, introduction, requiredSentence, buttonText, leftNavHtml, pageTagline, privacySentence);
     PageDto pers = FormRegistry.PageDao.Create(dto);
     Assert.IsNotNull(pers);
     PageDto sel = FormRegistry.PageDao.Get(questionnaireId, pageType);
     Assert.IsNotNull(sel);
     Assert.AreEqual(pers, sel);
 }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            page_utilities.Set_titles(this, "Edit Additional Navigation");
            permss = check_permissions(this.Page, true);

            if (Session["page_id"] == null || Session["questionnaire_id"] == null)
            {                
                Response.Redirect("edit_page_overview.aspx?content=edit", true);
            }
            else
            {
                pageIdFromSession = Session["page_id"].ToString();
                questionnaireIdFromSession = Session["questionnaire_id"].ToString();
            }

            try
            {
                PageAssemblyDto retval = QuestionnaireFacade.GetPageByPageId(Int64.Parse(questionnaireIdFromSession), int.Parse(pageIdFromSession), ViewType.Undefined, false);
                if (retval == null)
                {
                    Response.Redirect("edit_page_overview.aspx?content=edit", true);
                }
                formType = Migration.ConvertPageTypeToDisplayedString(retval.Page.PageType);
                page = retval.Page;
            }
            catch (UserCausedException)
            { }    

            if (!IsPostBack)
            {
                useFormpage = false;
                List<string> list = new List<string>(){ "Select element type", "Non - clickable headline", /*"Clickable headline",*/ "Link"/*, "Divider"*/ };                 
                elementTypeList.DataSource = list;
                elementTypeList.DataBind();
                ResetAddElement();
                listOfNavigationElements = new List<NavigationElementDto>();
                LoadListOfNavigationElements();
                InitializePanels();
                AdjustDeleteButtonVisibility();
            }            
        }
Ejemplo n.º 11
0
        private PageDto Read(IDataReader reader, ref bool alreadyRead)
        {
            PageDto retval = null;

            int pageId = reader.GetInt32(0);

            string pageTypeS = reader.GetString(1);
            PageType pageType = Constants.Convert(pageTypeS);

            int questionnaireId = reader.GetInt32(2);

            string pageTitle = null;
            if (!reader.IsDBNull(3))
            {
                pageTitle = reader.GetString(3);
            }

            string pageTagline = null;
            if (!reader.IsDBNull(4))
            {
                pageTagline = reader.GetString(4);
            }

            int? mdaId = null;
            if (!reader.IsDBNull(5))
            {
                mdaId = reader.GetInt32(5);
            }

            string mdaFileName = GetString(reader, 6);

            string introduction = null;
            if (!reader.IsDBNull(7))
            {
                introduction = reader.GetString(7);
            }

            string requiredSentence = null;
            if (!reader.IsDBNull(8))
            {
                requiredSentence = reader.GetString(8);
            }

            string buttonText = null;
            if (!reader.IsDBNull(9))
            {
                buttonText = reader.GetString(9);
            }

            string leftNavHtml = null;
            if (!reader.IsDBNull(10))
            {
                leftNavHtml = reader.GetString(10);
            }

            //RFG 2.14 | Raju
            string privacySentence = null;
            if (!reader.IsDBNull(11))
            {
                privacySentence = reader.GetString(11);
            }
            

            retval = new PageDto(pageId, pageType, questionnaireId, pageTitle, mdaId, mdaFileName, introduction, requiredSentence, buttonText, leftNavHtml, pageTagline,privacySentence);
            return retval;
        }
Ejemplo n.º 12
0
        public void CreateNewQuestionnairePage(out CampaignDto currentCampaign, out QuestionnaireDto currentQuestionnaire, out PageDto currentPage, bool registeredPersonalized)
        {

            List<PageTagDto> listOfPageTags = FormRegistry.QuestionnaireDao.GetPageTags();
            PageTagDto metaUserProfile = listOfPageTags.Find(pt => !String.IsNullOrEmpty(pt.TagGroup) && pt.TagGroup.Equals("user_profile") &&
                    pt.TagValue.Equals("Non-targeted"));
            _campaignCode = GetNewCampaignName();
            _creatorEmailAddress = TestUser;

            currentCampaign = FormRegistry.CampaignDao.Create(new CampaignDto(_campaignCode, _creatorEmailAddress));
            
            QuestionnaireType type = QuestionnaireType.Questionnaire;
            string creatorEmailAddress = TestUser;
            string campaignCode = currentCampaign.CampaignCode;
            string countryCode = "UK";
            string languageCode = "EN";
            string qidTitle = "qidt" + GetNewStamp();
            bool isActive = true;
            DateTime expireDate = DateTime.Today.AddDays(10);
            string expireRedirect = "expire redirect";
            bool sendToCrm = true;
            string crmMrmCode = "crm mrm code";
            string crmWaveCode = "crm wave code";
            string treatmentCode = "treatment code";
            bool anyAsset = false;
            bool hppEnabled = false;
            bool personalized = false;
            //bool registeredPersonalized = false;
            bool hasClosurePage = true;
            string externalClosurePage = "external closure page";
            bool hasThankYouEmail = true;
            bool hasNotificationEmail = true;
            string themeColor = "#000000";
            string mainImage = "main image";
            string leftNavHtml = "left nav";
            string comments = "comments";
            int metaPageContent = 1;
            int metaSegment = 1;
            DateTime creationDate = DateTime.Today;
            string businessOwner = currentCampaign.CreatorEmailAddress;
            string urlLayoutForm = "url layout form";
            bool hasNotificationEmailAstro2 = true;
            DateTime? offlineStart = DateTime.Today.AddDays(7);
            DateTime? offlineEnd = DateTime.Today.AddDays(8);
            int? offlineMode = 1;
            DateTime? offlineRecurEnd = DateTime.Today.AddDays(9);
            string offlineRedirect = "offline redirect";
            string region = "EMEA";
            DateTime? datePublished = DateTime.Today.AddDays(10);
            DateTime? dateModified = DateTime.Today.AddDays(11);
            string metaPageContentValue = "meta content value";
            string metaSegmentValue = "meta segment value";
            string htmlLang = "html lang";
            int userProfile = metaUserProfile.TagId;
            string userProfileValue = metaUserProfile.TagValue;
            bool isGofaForm = false;
            DateTime? publishDate = DateTime.Today.AddDays(12);
            QuestionnaireDto dto = new QuestionnaireDto(type, creatorEmailAddress, campaignCode, countryCode, languageCode, qidTitle, isActive, expireDate, expireRedirect, sendToCrm, crmMrmCode, personalized, registeredPersonalized, hasClosurePage, externalClosurePage, hasThankYouEmail, hasNotificationEmail, themeColor, mainImage, leftNavHtml, comments, metaPageContent, metaSegment, creationDate, businessOwner, urlLayoutForm, hasNotificationEmailAstro2, offlineStart, offlineEnd, offlineMode, offlineRecurEnd, offlineRedirect, region, datePublished, dateModified, metaPageContentValue, metaSegmentValue, htmlLang, publishDate, crmWaveCode, hppEnabled, anyAsset, treatmentCode, userProfile, userProfileValue,isGofaForm,0,0,false,-1,0,null,0,0,0,1);
            currentQuestionnaire = FormRegistry.QuestionnaireDao.Create(dto, "insert");

            PageType pageType = PageType.FormPage;
            int questionnaireId = currentQuestionnaire.QuestionnaireId;
            string pageTitle = "test page";
            int? mdaId = null;
            string mdaFileName = null;
            string introduction = "intro";
            string requiredSentence = "required sentence";
            string buttonText = "save button";
            string leftNavHtml2 = "left nav html2";
            string pageTagline = "page tagline";
            string privacySentence = "privacy sentence";
            currentPage = FormRegistry.PageDao.Create(new PageDto(pageType, questionnaireId, pageTitle, mdaId, mdaFileName, introduction, requiredSentence, buttonText, leftNavHtml2, pageTagline, privacySentence));

        }
Ejemplo n.º 13
0
 protected virtual void TearDown()
 {
     bool failed = false;
     foreach (int id in _createdMasterReports)
     {
         try
         {
             FormRegistry.MasterReportDao.DeleteMasterReport(id);
         }
         catch (Exception e)
         {
             Trace.WriteLine("Exception during master report deletion: " + e);
             failed = true;
         }
     }
     _createdMasterReports.Clear();
     foreach (int pagePredefinedQuestionChoiceId in _createdPagePredefinedQuestionChoices)
     {
         try
         {
             FormRegistry.PredefinedQuestionDao.DeletePagePredefinedChoice(pagePredefinedQuestionChoiceId);
         }
         catch
         {
             failed = true;
         }
     }
     _createdPagePredefinedQuestionChoices.Clear();
     foreach (int pagePredefinedQuestionId in _createdPagePredefinedQuestions)
     {
         try
         {
             FormRegistry.PredefinedQuestionDao.DeletePagePredefinedQuestion(pagePredefinedQuestionId);
         }
         catch
         {
             failed = true;
         }
     }
     _createdPagePredefinedQuestions.Clear();
     foreach (int predefinedChoiceId in _createdPredefinedQuestionChoices)
     {
         try
         {
             FormRegistry.PredefinedQuestionDao.DeleteChoice(predefinedChoiceId);
         }
         catch
         {
             failed = true;
         }
     }
     _createdPredefinedQuestionChoices.Clear();
     foreach (int predefinedQuestionId in _createdPredefinedQuestions)
     {
         try
         {
             FormRegistry.PredefinedQuestionDao.DeletePredefinedQuestion(predefinedQuestionId);
         }
         catch
         {
             failed = true;
         }
     }
     _createdPredefinedQuestions.Clear();
     foreach (int questionnaireId in _createdQuestionnaires)
     {
         if (!FormRegistry.QuestionnaireDao.Delete(questionnaireId, TestUser))
         {
             failed = true;
         }
     }
     _createdQuestionnaires.Clear();
     foreach (string campaignCode in _createdCampaigns)
     {
         if (!FormRegistry.CampaignDao.Delete(campaignCode, _currentCampaign.CreatorEmailAddress))
         {
             failed = true;
         }
     }
     _createdCampaigns.Clear();
     
     
     _currentCampaign = null;
     _currentQuestionnaire = null;
     _currentPage = null;
     _currentPredefinedQuestion = null;
     _currentPredefinedChoices = null;
     _currentPagePredefinedQuestion = null;
     _currentPagePredefinedChoices = null;
     Assert.IsFalse(failed, "errors during deletion");
 }
Ejemplo n.º 14
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);
 }
Ejemplo n.º 15
0
 public PageDto CreateNewPage(PageType pageType)
 {
     int questionnaireId = _currentQuestionnaire.QuestionnaireId;
     string pageTitle = "test page";
     int? mdaId = null;
     string mdaFileName = null;
     string introduction = "intro";
     string requiredSentence = "required sentence";
     string buttonText = "save button";
     string leftNavHtml2 = "left nav html2";
     string pageTagline = "page tagline";
     string privacySentence = "privacy sentence";
     
     _currentPage = FormRegistry.PageDao.Create(new PageDto(pageType, questionnaireId, pageTitle, mdaId, mdaFileName, introduction, requiredSentence, buttonText, leftNavHtml2, pageTagline, privacySentence));
     Assert.IsNotNull(_currentPage);
     _createdPages.Add(_currentPage.PageId);
     return _currentPage;
 }
Ejemplo n.º 16
0
 private PageDto Fill(PageDto dto, int id)
 {
     PageDto retval = new PageDto(id, dto.PageType, dto.QuestionnaireId, dto.PageTitle, dto.MdaId, dto.MdaFileName, dto.Introduction, dto.RequiredSentence, dto.ButtonText, dto.LeftNavHtml, dto.PageTagline,dto.PrivacySentence);
     return retval;
 }
Ejemplo n.º 17
0
        public void Initialize(QuestionnaireDto quesitonnaire, PageDto page, PagePredefinedQuestionAssemblyDto pagePredefinedQuestionAssembly)
        {

            _pageElementType = pagePredefinedQuestionAssembly.Question.ElementType;
            _questionnaire = quesitonnaire;
            _page = page;
            _pageQuestion = pagePredefinedQuestionAssembly.Question;
            _pageQuestionChoices = pagePredefinedQuestionAssembly.Choices; 
            _isValid = true;
            Load += new EventHandler(WucPageElementBase_Load);
        }
Ejemplo n.º 18
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;
        }
Ejemplo n.º 19
0
 public static PageElementWithErrorDto CreateErrorElement(PageDto page, string elementText, PageElementType pageElementType, int sortSequence, string errorText)
 {
     PageElementWithErrorDto retval = new PageElementWithErrorDto(elementText, true, pageElementType, page.PageId, sortSequence, 100, errorText, true, false,string.Empty);
     Assert.Contains(pageElementType, Constants.PageElementErrorTypes);
     retval = FormRegistry.PageElementDao.Create(retval);
     Assert.IsNotNull(retval);
     return retval;
 }
Ejemplo n.º 20
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;
 }
Ejemplo n.º 21
0
            public IResponseServiceClass(QuestionnaireDto Questionnaire, PageDto PageDto, string CountryCode, string LanguageCode, bool RequestIsvalid)
            {
                _Questionnaire = Questionnaire;
                _Page = PageDto;

                _CountryCode = CountryCode;
                _languageCode = LanguageCode;

                _RequestIsValid = true;
            }