Exemplo n.º 1
0
        public void TestEditScrum()
        {
            ScrumModel scrumModel = new ScrumModel();
            scrumModel.AnswerList = new System.Collections.ArrayList();

            Answers answers = new Answers();
            answers.Answer = "Test Edit";
            answers.QuestionId = 1;
            answers.UserId = 1;
            answers.AnswerKey = 0;
            scrumModel.AnswerList.Add(answers);

            answers = new Answers();
            answers.Answer = "Test Edit";
            answers.QuestionId = 2;
            answers.UserId = 1;
            answers.AnswerKey = 0;
            scrumModel.AnswerList.Add(answers);

            answers = new Answers();
            answers.Answer = "None";
            answers.QuestionId = 3;
            answers.UserId = 1;
            answers.AnswerKey = 0;
            scrumModel.AnswerList.Add(answers);

            Assert.IsTrue(new ScrumController().EditScrum(scrumModel));
        }
Exemplo n.º 2
0
        protected void submit_Click(object sender, EventArgs e)
        {
            ScrumModel scrumModel = new ScrumModel();
            scrumModel.AnswerList = new System.Collections.ArrayList();

            Answers answer = new Answers();
            answer.QuestionId = 1;
            answer.AnswerKey = Convert.ToInt32(Request["AnswerKey"]);
            answer.Answer = txtBoxAnswer1.Text;
            scrumModel.AnswerList.Add(answer);

            answer = new Answers();
            answer.QuestionId = 2;
            answer.AnswerKey = Convert.ToInt32(Request["AnswerKey"]);
            answer.Answer = txtBoxAnswer2.Text;
            scrumModel.AnswerList.Add(answer);

            answer = new Answers();
            answer.QuestionId = 3;
            answer.AnswerKey = Convert.ToInt32(Request["AnswerKey"]);
            answer.Answer = txtBoxAnswer3.Text;
            scrumModel.AnswerList.Add(answer);

            new Controllers.ScrumController().EditScrum(scrumModel);
            Response.Redirect("~/Scrum/ViewScrumData.aspx");
        }
Exemplo n.º 3
0
        protected void submit_Click(object sender, EventArgs e)
        {
            User user = (User)Session["User"];
            ScrumModel scrumModel = new ScrumModel();
            scrumModel.AnswerList = new System.Collections.ArrayList();

            Answers answers = new Answers();
            answers.Answer = answer1.Text;
            answers.QuestionId = Convert.ToInt32(answer1.ID);
            answers.UserId = user.UserId;
            scrumModel.AnswerList.Add(answers);

            answers = new Answers();
            answers.Answer = answer2.Text;
            answers.QuestionId = Convert.ToInt32(answer2.ID);
            answers.UserId = user.UserId;
            scrumModel.AnswerList.Add(answers);

            answers = new Answers();
            answers.Answer = answer3.Text;
            answers.QuestionId = Convert.ToInt32(answer3.ID);
            answers.UserId = user.UserId;
            scrumModel.AnswerList.Add(answers);

            bool dataInserted = new ScrumController().InputNewScrum(scrumModel);
            if (dataInserted)
            {
                Session.Add("Message", "The scrum data was successfully entered.");
                Response.Redirect("~/Scrum/ViewScrumData.aspx");
            }
            else
            {
                Message.Text = "There was an error inserting the scrum data.";
            }
        }
Exemplo n.º 4
0
 public ScrumModel GetScrumDetails(int AnswerKey)
 {
     ScrumModel scrumModel = new ScrumModel();
     using (SqlConnection sqlConnection = new SqlConnection(Constants.DATABASE.CONNECTION_STRING))
     {
         sqlConnection.Open();
         using (SqlCommand sqlCommand = new SqlCommand("SELECT * FROM ScrumAnswers WHERE AnswerKey=" + AnswerKey, sqlConnection))
         {
             using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader())
             {
                 if (sqlDataReader.HasRows)
                 {
                     scrumModel.AnswerList = new System.Collections.ArrayList();
                     while (sqlDataReader.Read())
                     {
                         Answers answers = new Answers();
                         answers.QuestionId = Convert.ToInt32(sqlDataReader["QuestionId"]);
                         answers.Answer = Convert.ToString(sqlDataReader["Answer"]);
                         scrumModel.AnswerList.Add(answers);
                     }
                 }
                 sqlDataReader.Close();
             }
         }
         sqlConnection.Close();
     }
     return scrumModel;
 }
Exemplo n.º 5
0
        public void TestInputNewScrum()
        {
            ScrumModel scrumModel = new ScrumModel();
            scrumModel.AnswerList = new System.Collections.ArrayList();

            Answers answers = new Answers();
            answers.Answer = "Worked on Unit Test Cases";
            answers.QuestionId = 1;
            answers.UserId = 1;
            scrumModel.AnswerList.Add(answers);

            answers = new Answers();
            answers.Answer = "Worked on Scrum Room";
            answers.QuestionId = 2;
            answers.UserId = 1;
            scrumModel.AnswerList.Add(answers);

            answers = new Answers();
            answers.Answer = "None";
            answers.QuestionId = 3;
            answers.UserId = 1;
            scrumModel.AnswerList.Add(answers);

            Assert.IsTrue(new ScrumController().InputNewScrum(scrumModel));
        }