Пример #1
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.";
            }
        }
        protected void ddlUserList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlUserList.SelectedIndex != 0)
            {
                ScrumController scrumController = new ScrumController();
                ScrumModel scrumModel = scrumController.ViewScrumData(Convert.ToInt32(ddlUserList.SelectedValue));
                if (scrumModel.ScrumList != null && scrumModel.ScrumList.Count > 0)
                {
                    ScrumList = scrumModel.ScrumList;
                    divData.Visible = true;
                    divNoData.Visible = false;
                }
                else
                {
                    divData.Visible = false;
                    divNoData.Visible = true;
                }

            }
            else
            {
                divData.Visible = false;
                divNoData.Visible = false;
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            User user = (User)Session["User"];
            ScrumController scrumController = new ScrumController();
            ScrumModel scrumModel = scrumController.ViewScrumData(user.UserId);

            if (scrumModel.ScrumList != null)
            {
                ScrumList = scrumModel.ScrumList;
            }
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ScrumController scrumController = new ScrumController();
            ScrumModel scrumModel = scrumController.GetScrumQuestions();

            Label1.Text = ((Questions)scrumModel.QuestionList[0]).Question;
            Label2.Text = ((Questions)scrumModel.QuestionList[1]).Question;
            Label3.Text = ((Questions)scrumModel.QuestionList[2]).Question;

            answer1.ID = Convert.ToString(((Questions)scrumModel.QuestionList[0]).QuestionId);
            answer2.ID = Convert.ToString(((Questions)scrumModel.QuestionList[1]).QuestionId);
            answer3.ID = Convert.ToString(((Questions)scrumModel.QuestionList[2]).QuestionId);
        }
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if(ddlMonth.SelectedIndex > 0 && ddlDay.SelectedIndex > 0)
     {
         string date = ddlYear.SelectedValue + "-" + ddlMonth.SelectedValue + "-" + ddlDay.SelectedValue;
         string nextDay = ddlYear.SelectedValue + "-" + ddlMonth.SelectedValue + "-" + (Convert.ToInt32(ddlDay.SelectedValue) + 1).ToString();
         ScrumController scrumController = new ScrumController();
         ScrumModel scrumModel = scrumController.ScrumByDate(date, nextDay);
         if (scrumModel.ScrumList != null && scrumModel.ScrumList.Count > 0)
         {
             ScrumList = scrumModel.ScrumList;
             divData.Visible = true;
             divNoData.Visible = false;
         }
         else
         {
             divData.Visible = false;
             divNoData.Visible = true;
         }
     }
 }
Пример #6
0
 public void TestGetScrumQuestions()
 {
     ScrumController scrumController = new ScrumController();
     ScrumModel scrum = scrumController.GetScrumQuestions();
     Assert.IsTrue(scrum.QuestionList.Count == 3);
 }
Пример #7
0
 public void TestViewTeamMembersScrum()
 {
     ScrumController scrumController = new ScrumController();
     Assert.IsTrue(scrumController.ViewTeamMembersScrum());
 }
Пример #8
0
 public void TestViewScrumDetails()
 {
     ScrumController scrumController = new ScrumController();
     Assert.IsTrue(scrumController.GetScrumDetails(0).AnswerList.Count > 1);
 }
Пример #9
0
 public void TestViewScrum()
 {
     ScrumController scrumController = new ScrumController();
     Assert.IsTrue(scrumController.ViewScrumData(1).ScrumList.Count > 0);
 }
Пример #10
0
 public void TestScrumByDate()
 {
     ScrumController scrumController = new ScrumController();
     Assert.IsTrue(scrumController.ScrumByDate("2013-07-02", "2013-07-03").ScrumList.Count > 0);
 }