Пример #1
0
        public void CreateAccountSurvey()
        {
            ManagedAccount a = new ManagedAccount(Session);
            ManagedSurvey m_survey = new ManagedSurvey(Session);
            ManagedSurveyQuestion m_question = new ManagedSurveyQuestion(Session);
            ManagedAccountSurveyAnswer m_answer = new ManagedAccountSurveyAnswer(Session);

            try
            {
                a.Create("Test User", "testpassword", "*****@*****.**", DateTime.UtcNow, AdminSecurityContext);

                TransitSurvey t_survey = new TransitSurvey();
                t_survey.Name = GetNewString();
                m_survey.CreateOrUpdate(t_survey, AdminSecurityContext);

                TransitSurveyQuestion t_question = new TransitSurveyQuestion();
                t_question.SurveyId = m_survey.Id;
                t_question.Question = GetNewString();
                m_question.CreateOrUpdate(t_question, AdminSecurityContext);

                TransitAccountSurveyAnswer ta = new TransitAccountSurveyAnswer();
                ta.SurveyQuestionId = m_question.Id;
                ta.Answer = GetNewString();
                m_answer.CreateOrUpdate(ta, a.GetSecurityContext());
            }
            finally
            {
                m_answer.Delete(a.GetSecurityContext());
                a.Delete(AdminSecurityContext);
                m_survey.Delete(AdminSecurityContext);
                Session.Flush();
            }
        }
Пример #2
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Surveys", Request, "SystemSurveysManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode(Survey.Name, Request, string.Format("SystemSurveyEdit.aspx?id={0}", SurveyId)));

            DomainClass cs = SessionManager.GetDomainClass("SurveyQuestion");
            inputQuestion.MaxLength = cs["Question"].MaxLengthInChars;

            linkBack.NavigateUrl = "SystemSurveyEdit.aspx?id=" + SurveyId.ToString();
            if (RequestId > 0)
            {
                TransitSurveyQuestion tw = SessionManager.ObjectService.GetSurveyQuestionById(
                    SessionManager.Ticket, RequestId);
                inputQuestion.Text = Renderer.Render(tw.Question);
                sitemapdata.Add(new SiteMapDataAttributeNode(tw.Question, Request.Url));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("New Question", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Пример #3
0
        public void CreateAccountSurvey()
        {
            ManagedAccount             a          = new ManagedAccount(Session);
            ManagedSurvey              m_survey   = new ManagedSurvey(Session);
            ManagedSurveyQuestion      m_question = new ManagedSurveyQuestion(Session);
            ManagedAccountSurveyAnswer m_answer   = new ManagedAccountSurveyAnswer(Session);

            try
            {
                a.Create("Test User", "testpassword", "*****@*****.**", DateTime.UtcNow, AdminSecurityContext);

                TransitSurvey t_survey = new TransitSurvey();
                t_survey.Name = GetNewString();
                m_survey.CreateOrUpdate(t_survey, AdminSecurityContext);

                TransitSurveyQuestion t_question = new TransitSurveyQuestion();
                t_question.SurveyId = m_survey.Id;
                t_question.Question = GetNewString();
                m_question.CreateOrUpdate(t_question, AdminSecurityContext);

                TransitAccountSurveyAnswer ta = new TransitAccountSurveyAnswer();
                ta.SurveyQuestionId = m_question.Id;
                ta.Answer           = GetNewString();
                m_answer.CreateOrUpdate(ta, a.GetSecurityContext());
            }
            finally
            {
                m_answer.Delete(a.GetSecurityContext());
                a.Delete(AdminSecurityContext);
                m_survey.Delete(AdminSecurityContext);
                Session.Flush();
            }
        }
 public void save_Click(object sender, EventArgs e)
 {
     TransitSurveyQuestion tw = new TransitSurveyQuestion();
     tw.Question = inputQuestion.Text;
     tw.Id = RequestId;
     tw.SurveyId = SurveyId;
     SessionManager.CreateOrUpdate<TransitSurveyQuestion>(
         tw, SessionManager.ObjectService.CreateOrUpdateSurveyQuestion);
     Redirect("SystemSurveyEdit.aspx?id=" + SurveyId.ToString());
 }
Пример #5
0
    public void save_Click(object sender, EventArgs e)
    {
        TransitSurveyQuestion tw = new TransitSurveyQuestion();

        tw.Question = inputQuestion.Text;
        tw.Id       = RequestId;
        tw.SurveyId = SurveyId;
        SessionManager.CreateOrUpdate <TransitSurveyQuestion>(
            tw, SessionManager.ObjectService.CreateOrUpdateSurveyQuestion);
        Redirect("SystemSurveyEdit.aspx?id=" + SurveyId.ToString());
    }
Пример #6
0
    public void Page_Load(object sender, EventArgs e)
    {
        accountSurveyAnswers.OnGetDataSource += new EventHandler(accountSurveyAnswers_OnGetDataSource);
        if (!IsPostBack)
        {
            TransitSurvey         ts  = Survey;
            TransitSurveyQuestion tsq = SurveyQuestion;

            surveyName.Text = this.Title = Renderer.Render(ts.Name);

            GetData();

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode(ts.Name, Request, string.Format("AccountSurveyView.aspx?id={0}", ts.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode(tsq.Question, Request.Url));
            StackSiteMap(sitemapdata);
        }
    }
Пример #7
0
 public int CreateOrUpdateSurveyQuestion(string ticket, TransitSurveyQuestion surveyquestion)
 {
     return(WebServiceImpl <TransitSurveyQuestion, ManagedSurveyQuestion, SurveyQuestion> .CreateOrUpdate(
                ticket, surveyquestion));
 }
Пример #8
0
 public int CreateOrUpdateSurveyQuestion(string ticket, TransitSurveyQuestion surveyquestion)
 {
     return WebServiceImpl<TransitSurveyQuestion, ManagedSurveyQuestion, SurveyQuestion>.CreateOrUpdate(
         ticket, surveyquestion);
 }