public ActionResult Create([Bind(Include = "ID,Name,Description,CreatedBy,CreatedDate,StartDate,ExpectedEndDate,ActualEndDate,ReleaseBacklogID")] Sprint sprint, string[] selectedUserStories)
        {
            if (selectedUserStories != null)
            {
                //releaseBacklog.UserStories = new List<UserStory>();
                sprint.UserStories = new List <UserStory>();

                //foreach (var userStory in selectedUserStories)
                foreach (var userStory in selectedUserStories)
                {
                    var userStoryToAdd = db.UserStories.Find(int.Parse(userStory));
                    //releaseBacklog.UserStories.Add(userStoryToAdd);
                    sprint.UserStories.Add(userStoryToAdd);
                }
            }

            if (ModelState.IsValid)
            {
                sprint.CreatedBy   = 1;
                sprint.CreatedDate = DateTime.Now;

                db.Sprints.Add(sprint);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            PopulateAssignedUserStories(sprint);

            ViewBag.ReleaseBacklogID = new SelectList(db.ReleaseBacklogs, "ID", "Name", sprint.ReleaseBacklogID);
            return(View(sprint));
        }
Exemple #2
0
        public ActionResult Create([Bind(Include = "ID,EmpPosition")] Position position)
        {
            if (ModelState.IsValid)
            {
                db.Positions.Add(position);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(position));
        }
Exemple #3
0
        public ActionResult Create([Bind(Include = "ID,FirstName,LastName,Gender,CreatedBy,CreatedDate,HiringDate,PositionID,EmployeeStatus,UserName,Password,Role")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                employee.CreatedBy   = 1;
                employee.CreatedDate = DateTime.Now;

                db.Employees.Add(employee);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.PositionID = new SelectList(db.Positions, "ID", "EmpPosition", employee.PositionID);
            return(View(employee));
        }
        public ActionResult Create([Bind(Include = "ID,Name,Description,CreatedBy,CreatedDate,StartDate,ExpectedEndDate,ActualEndDate,DevelopmentStatus,TestStatus,SprintID,ReleaseBacklogID,ProductBacklogID,DeveloperID,TesterID,DeveloperEstimateInHours,TesterEstimateInHours,DeveloperHoursCompleted,TesterHoursCompleted")] UserStory userStory)
        {
            if (ModelState.IsValid)
            {
                userStory.CreatedBy         = 1;
                userStory.CreatedDate       = DateTime.Now;
                userStory.DevelopmentStatus = USDevelopmentStatus.New;
                userStory.TestStatus        = USTestStatus.WaitingDevelopment;

                db.UserStories.Add(userStory);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ProductBacklogID = new SelectList(db.ProductBacklogs, "ID", "Name", userStory.ProductBacklogID);
            ViewBag.ReleaseBacklogID = new SelectList(db.ReleaseBacklogs, "ID", "Name", userStory.ReleaseBacklogID);
            ViewBag.SprintID         = new SelectList(db.Sprints, "ID", "Name", userStory.SprintID);
            return(View(userStory));
        }
        public ActionResult Create([Bind(Include = "ID,Name,Description,CreatedBy,CreatedDate,StartDate,ExpectedEndDate,ActualEndDate,ProductBacklogID,EmployeeID")] ReleaseBacklog releaseBacklog, string[] selectedUserStories, string ScrumMasterList)
        {
            if (selectedUserStories != null)
            {
                releaseBacklog.UserStories = new List <UserStory>();

                foreach (var userStory in selectedUserStories)
                {
                    var userStoryToAdd = db.UserStories.Find(int.Parse(userStory));
                    releaseBacklog.UserStories.Add(userStoryToAdd);
                }
            }

            if (ScrumMasterList != "")
            {
                releaseBacklog.EmployeeID = int.Parse(ScrumMasterList);

                ////hr interface method has to be given here
                //var emp = db.Employees.Find(int.Parse(ScrumMasterList));
                //emp.Role = Role.ScrumMaster;
                //emp.ReleaseBacklogs.Add(releaseBacklog);

                HRInterface hr = new clsHRFacade();
                hr.AssignScrumMaster(int.Parse(ScrumMasterList), releaseBacklog, db);
            }

            releaseBacklog.CreatedBy   = 1;
            releaseBacklog.CreatedDate = DateTime.Now;

            if (ModelState.IsValid)
            {
                db.ReleaseBacklogs.Add(releaseBacklog);

                db.SaveChanges();

                return(RedirectToAction("Index"));
            }

            PopulateAssignedUserStories(releaseBacklog);

            ViewBag.ProductBacklogID = new SelectList(db.ProductBacklogs, "ID", "Name", releaseBacklog.ProductBacklogID);
            return(View(releaseBacklog));
        }
        public ActionResult EstimateEffort([Bind(Include = "ID,Name,Description,CreatedBy,CreatedDate,StartDate,ExpectedEndDate,ActualEndDate,DevelopmentStatus,TestStatus,SprintID,ReleaseBacklogID,ProductBacklogID,DeveloperID,TesterID,DeveloperEstimateInHours,TesterEstimateInHours,DeveloperHoursCompleted,TesterHoursCompleted")] UserStory userStory)
        {
            if (ModelState.IsValid)
            {
                if (userStory.TesterEstimateInHours == userStory.TesterHoursCompleted)
                {
                    userStory.TestStatus = USTestStatus.Completed;
                }

                db.Entry(userStory).State = EntityState.Modified;

                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(userStory));
        }