Beispiel #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            List <Survey_Response> response = GetSurveyReponse();

            foreach (Survey_Response sres in response)
            {
                context.AddToSurvey_Response(sres);
            }
            context.SaveChanges();
        }
Beispiel #2
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         SurveyAppConString context = new SurveyAppConString();
         Question           quest   = new Question();
         quest.Text         = txtTitle.Text.Trim();
         quest.QuestionType = ddlTypes.SelectedItem.Text;
         quest.Options      = txtValues.Text.Trim();
         context.AddToQuestions(quest);
         context.SaveChanges();
     }
 }
Beispiel #3
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         Survey survey = new Survey();
         survey.Title       = txtTitle.Text;
         survey.Description = txtDesc.Text;
         survey.ExpiresOn   = Convert.ToDateTime(txtDate.Text.Trim());
         survey.CreatedOn   = Convert.ToDateTime(DateTime.Now);
         survey.CreatedBy   = 2;
         List <SurveyQuestion> questions = new List <SurveyQuestion>();
         foreach (ListItem li in lbTarget.Items)
         {
             SurveyQuestion quest = new SurveyQuestion();
             quest.QuestionID = int.Parse(li.Value);
             survey.SurveyQuestions.Add(quest);
             questions.Add(quest);
         }
         context.AddToSurveys(survey);
         context.SaveChanges();
     }
 }