Пример #1
0
        public ActionResult Create_Sprint(Sprint sprint)
        {
            var user = (User)Session["UserInfo"];

            if (user == null)
            {
                return(RedirectToAction("Login", "Login"));
            }
            ViewBag.Link = "Project";
            var proj = (Project)Session["Project"];

            if (proj == null)
            {
                return(RedirectToAction("Create_Project", "Dashboard"));
            }

            if (!ModelState.IsValid)
            {
                return(View());
            }

            var result = ProjectManager.AddSprint(sprint, proj);

            Session["Project"] = ProjectManager.GetProjectByID(proj.ProjectID, user.Email);

            if (string.IsNullOrEmpty(result))
            {
                return(RedirectToAction("Home", "Project"));
            }

            ViewBag.Error = result;
            return(View());
        }
Пример #2
0
        public void Init()
        {
            if (UserManager.RegisterUser(new Register
            {
                Email = "[email protected]",
                Password = "******",
                Username = "******",
                Role = "ScrumMaster"
            }) == "")
            {
                UserManager.RegisterUser(new Register
                {
                    Email    = "[email protected]",
                    Password = "******",
                    Username = "******",
                    Role     = "Developer"
                });
                UserManager.RegisterUser(new Register
                {
                    Email    = "[email protected]",
                    Password = "******",
                    Username = "******",
                    Role     = "Developer"
                });
                UserManager.RegisterUser(new Register
                {
                    Email    = "[email protected]",
                    Password = "******",
                    Username = "******",
                    Role     = "ScrumMaster"
                });
                UserManager.RegisterUser(new Register
                {
                    Email    = "[email protected]",
                    Password = "******",
                    Username = "******",
                    Role     = "Developer"
                });
                UserManager.RegisterUser(new Register
                {
                    Email    = "[email protected]",
                    Password = "******",
                    Username = "******",
                    Role     = "Developer"
                });
                UserManager.RegisterUser(new Register
                {
                    Email    = "[email protected]",
                    Password = "******",
                    Username = "******",
                    Role     = "Developer"
                });
                UserManager.RegisterUser(new Register
                {
                    Email    = "[email protected]",
                    Password = "******",
                    Username = "******",
                    Role     = "Developer"
                });

                var proj = new Project
                {
                    Name        = "OnlineScrum",
                    DevTeamList = new List <string> {
                        "[email protected]", "[email protected]", "[email protected]"
                    },
                    ProjectID   = 1,
                    Sprints     = "",
                    ScrumMaster = "[email protected]",
                    Description = "This is a mock example to demonstrate the features in this platform."
                };
                var sprint1 = new Sprint
                {
                    StartDate       = DateTime.Now.AddDays(-60),
                    MeetingInterval = 1,
                    MeetingLocation = "X",
                    SprintID        = 1,
                    SprintName      = "Requirements Analysis",
                    SprintNumber    = 1,
                    FinishDate      = DateTime.Now.AddDays(-45)
                };
                var sprint2 = new Sprint
                {
                    StartDate       = DateTime.Now.AddDays(-45),
                    MeetingInterval = 1,
                    MeetingLocation = "X",
                    SprintID        = 2,
                    SprintName      = "Design",
                    SprintNumber    = 2,
                    FinishDate      = DateTime.Now.AddDays(-30)
                };
                var sprint3 = new Sprint
                {
                    StartDate       = DateTime.Now.AddDays(-30),
                    MeetingInterval = 1,
                    MeetingLocation = "X",
                    SprintID        = 3,
                    SprintName      = "Initial Implementation",
                    SprintNumber    = 3,
                    FinishDate      = DateTime.Now.AddDays(-15)
                };
                var sprint3_2 = new Sprint
                {
                    StartDate       = DateTime.Now.AddDays(-15),
                    MeetingInterval = 1,
                    MeetingLocation = "X",
                    SprintID        = 4,
                    SprintName      = "Final Implementation",
                    SprintNumber    = 4,
                    FinishDate      = DateTime.Now.AddDays(15)
                };
                var sprint4 = new Sprint
                {
                    StartDate       = DateTime.Now.AddDays(15),
                    MeetingInterval = 1,
                    MeetingLocation = "X",
                    SprintID        = 5,
                    SprintName      = "Verification",
                    SprintNumber    = 5,
                    FinishDate      = DateTime.Now.AddDays(30)
                };
                var sprint5 = new Sprint
                {
                    StartDate       = DateTime.Now.AddDays(30),
                    MeetingInterval = 1,
                    MeetingLocation = "X",
                    SprintID        = 1,
                    SprintName      = "Maintenance",
                    SprintNumber    = 1,
                    FinishDate      = DateTime.Now.AddDays(45)
                };
                var item1 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 1,
                    ItemID          = 1,
                    ItemName        = "Customer Requirements",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-55),
                };
                var item2 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 1,
                    ItemID          = 2,
                    ItemName        = "Architectural Requirements",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-53)
                };
                var item3 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 4,
                    ItemID          = 3,
                    ItemName        = "Functional Requirements",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-50)
                };
                var item4 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 2,
                    ItemID          = 4,
                    ItemName        = "Core Funcionality Requirements",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-47)
                };
                var item5 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 5,
                    ItemID          = 5,
                    ItemName        = "Non Functional Requirements",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-46)
                };
                var item6 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 4,
                    ItemID          = 6,
                    ItemName        = "DB Design",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-44)
                };
                var item7 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 1,
                    ItemID          = 7,
                    ItemName        = "Architecture Design",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-40),
                };
                var item8 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 2,
                    ItemID          = 8,
                    ItemName        = "Security Design",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-38)
                };
                var item9 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 3,
                    ItemID          = 9,
                    ItemName        = "Interface Mockup",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-37)
                };
                var item10 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 3,
                    ItemID          = 10,
                    ItemName        = "Usability Design",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-33),
                };
                var item11 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 1,
                    ItemID          = 11,
                    ItemName        = "Use Cases",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-31)
                };
                var item12 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 3,
                    ItemID          = 12,
                    ItemName        = "Item",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-31)
                };
                var item13 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 1,
                    ItemID          = 13,
                    ItemName        = "Login",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-27),
                };
                var item14 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 2,
                    ItemID          = 14,
                    ItemName        = "Project",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-23),
                };
                var item15 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 1,
                    ItemID          = 15,
                    ItemName        = "Database",
                    ItemStatus      = "Delayed"
                };
                var item16 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 3,
                    ItemID          = 16,
                    ItemName        = "Interaction with Database",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-17),
                };
                var item17 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 1,
                    ItemID          = 17,
                    ItemName        = "User",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-16),
                };
                var item18 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 2,
                    ItemID          = 18,
                    ItemName        = "Meeting",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-14),
                };
                var item19 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 4,
                    ItemID          = 19,
                    ItemName        = "Statistics",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-12),
                };
                var item20 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 1,
                    ItemID          = 20,
                    ItemName        = "Interface",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-10),
                };
                var item21 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 2,
                    ItemID          = 21,
                    ItemName        = "Security",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-7),
                };
                var item22 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 3,
                    ItemID          = 22,
                    ItemName        = "Burndown Chart",
                    ItemStatus      = "Closed",
                    DateClosed      = DateTime.Now.AddDays(-3),
                };
                var item23 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 4,
                    ItemID          = 23,
                    ItemName        = "Velocity Chart",
                    ItemStatus      = "Testing",
                };
                var item24 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 3,
                    ItemID          = 24,
                    ItemName        = "Multiple Projects",
                    ItemStatus      = "Developing",
                };
                var item25 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 1,
                    ItemID          = 25,
                    ItemName        = "Settings",
                    ItemStatus      = "Developing",
                };
                var item26 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 2,
                    ItemID          = 26,
                    ItemName        = "Refactor",
                    ItemStatus      = "Developing",
                };
                var item27 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 2,
                    ItemID          = 27,
                    ItemName        = "Usability tests",
                    ItemStatus      = "Testing",
                };
                var item28 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 3,
                    ItemID          = 28,
                    ItemName        = "Sprint",
                    ItemStatus      = "Testing",
                };
                var item29 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 2,
                    ItemID          = 29,
                    ItemName        = "Product Backlog",
                    ItemStatus      = "Developing",
                };
                var item30 = new Item
                {
                    AssignedTo      = "[email protected]",
                    EstimatedEffort = 4,
                    ItemID          = 30,
                    ItemName        = "Meeting Table",
                    ItemStatus      = "Testing"
                };

                var s1 = new Item
                {
                    AssignedTo          = "[email protected]",
                    EstimatedEffort     = 5,
                    ItemID              = 28,
                    ItemName            = "Migrate to Cloud",
                    ItemStatus          = "Developing",
                    SprintlessProjectID = 1
                };

                var s2 = new Item
                {
                    AssignedTo          = "[email protected]",
                    EstimatedEffort     = 4,
                    ItemID              = 29,
                    ItemName            = "Language Support",
                    ItemStatus          = "Developing",
                    SprintlessProjectID = 1
                };

                var s3 = new Item
                {
                    AssignedTo          = "[email protected]",
                    EstimatedEffort     = 3,
                    ItemID              = 30,
                    ItemName            = "Contact Support",
                    ItemStatus          = "Developing",
                    SprintlessProjectID = 1
                };

                ProjectManager.AddProject(proj, "[email protected]", out proj);
                proj = ProjectManager.GetProjectByEmail("[email protected]");
                ProjectManager.AddSprint(sprint1, proj);
                proj = ProjectManager.GetProjectByEmail("[email protected]");
                ProjectManager.AddSprint(sprint2, proj);
                proj = ProjectManager.GetProjectByEmail("[email protected]");
                ProjectManager.AddSprint(sprint3, proj);
                proj = ProjectManager.GetProjectByEmail("[email protected]");
                ProjectManager.AddSprint(sprint3_2, proj);
                proj = ProjectManager.GetProjectByEmail("[email protected]");
                ProjectManager.AddSprint(sprint4, proj);
                proj = ProjectManager.GetProjectByEmail("[email protected]");
                ProjectManager.AddSprint(sprint5, proj);

                SprintManager.AddItem(sprint1, item1);
                sprint1 = SprintManager.GetSprintFromID(sprint1.SprintID);
                SprintManager.AddItem(sprint1, item2);
                sprint1 = SprintManager.GetSprintFromID(sprint1.SprintID);
                SprintManager.AddItem(sprint1, item3);
                sprint1 = SprintManager.GetSprintFromID(sprint1.SprintID);
                SprintManager.AddItem(sprint1, item4);
                sprint1 = SprintManager.GetSprintFromID(sprint1.SprintID);
                SprintManager.AddItem(sprint1, item5);

                SprintManager.AddItem(sprint2, item6);
                sprint2 = SprintManager.GetSprintFromID(sprint2.SprintID);
                SprintManager.AddItem(sprint2, item7);
                sprint2 = SprintManager.GetSprintFromID(sprint2.SprintID);
                SprintManager.AddItem(sprint2, item8);
                sprint2 = SprintManager.GetSprintFromID(sprint2.SprintID);
                SprintManager.AddItem(sprint2, item9);
                sprint2 = SprintManager.GetSprintFromID(sprint2.SprintID);
                SprintManager.AddItem(sprint2, item10);
                sprint2 = SprintManager.GetSprintFromID(sprint2.SprintID);
                SprintManager.AddItem(sprint2, item11);
                sprint2 = SprintManager.GetSprintFromID(sprint2.SprintID);
                SprintManager.AddItem(sprint2, item12);

                sprint3 = SprintManager.GetSprintFromID(sprint3.SprintID);
                SprintManager.AddItem(sprint3, item13);
                sprint3 = SprintManager.GetSprintFromID(sprint3.SprintID);
                SprintManager.AddItem(sprint3, item14);
                sprint3 = SprintManager.GetSprintFromID(sprint3.SprintID);
                SprintManager.AddItem(sprint3, item15);
                sprint3 = SprintManager.GetSprintFromID(sprint3.SprintID);
                SprintManager.AddItem(sprint3, item16);
                sprint3 = SprintManager.GetSprintFromID(sprint3.SprintID);
                SprintManager.AddItem(sprint3, item17);

                sprint3_2 = SprintManager.GetSprintFromID(sprint3_2.SprintID);
                SprintManager.AddItem(sprint3_2, item18);
                sprint3_2 = SprintManager.GetSprintFromID(sprint3_2.SprintID);
                SprintManager.AddItem(sprint3_2, item19);
                sprint3_2 = SprintManager.GetSprintFromID(sprint3_2.SprintID);
                SprintManager.AddItem(sprint3_2, item20);
                sprint3_2 = SprintManager.GetSprintFromID(sprint3_2.SprintID);
                SprintManager.AddItem(sprint3_2, item21);
                sprint3_2 = SprintManager.GetSprintFromID(sprint3_2.SprintID);
                SprintManager.AddItem(sprint3_2, item22);
                sprint3_2 = SprintManager.GetSprintFromID(sprint3_2.SprintID);
                SprintManager.AddItem(sprint3_2, item23);
                sprint3_2 = SprintManager.GetSprintFromID(sprint3_2.SprintID);
                SprintManager.AddItem(sprint3_2, item24);
                sprint3_2 = SprintManager.GetSprintFromID(sprint3_2.SprintID);
                SprintManager.AddItem(sprint3_2, item25);
                sprint3_2 = SprintManager.GetSprintFromID(sprint3_2.SprintID);
                SprintManager.AddItem(sprint3_2, item26);
                sprint3_2 = SprintManager.GetSprintFromID(sprint3_2.SprintID);
                SprintManager.AddItem(sprint3_2, item27);
                sprint3_2 = SprintManager.GetSprintFromID(sprint3_2.SprintID);
                SprintManager.AddItem(sprint3_2, item28);
                sprint3_2 = SprintManager.GetSprintFromID(sprint3_2.SprintID);
                SprintManager.AddItem(sprint3_2, item29);
                sprint3_2 = SprintManager.GetSprintFromID(sprint3_2.SprintID);
                SprintManager.AddItem(sprint3_2, item30);

                ProjectManager.ChangeSprintInItem(new List <SprintItem>
                {
                    new SprintItem
                    {
                        Item   = "15",
                        Sprint = sprint3_2.SprintName
                    }
                }, proj.ProjectID);

                SprintManager.AddItem(null, s1);
                SprintManager.AddItem(null, s2);
                SprintManager.AddItem(null, s3);
            }
        }