public ActionResult New_Member(string userEmail) { 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(PartialView("MemberList")); } ViewBag.AddMemberError = ProjectManager.AddMember(userEmail, proj.ProjectID); var project = ProjectManager.GetProjectByID(proj.ProjectID, user.Email); var memberList = SharedManager.SplitString(project.DevTeam); memberList.Insert(0, proj.ScrumMaster); ViewBag.MemberList = memberList; SharedManager.RepeatMethod = false; Session["Project"] = project; return(PartialView("MemberList")); }
public ActionResult Create_Item(int id) { var user = (User)Session["UserInfo"]; if (user == null) { return(RedirectToAction("Login", "Login")); } var proj = (Project)Session["Project"]; ViewBag.Link = "Project"; if (proj == null) { return(RedirectToAction("Dashboard", "Dashboard")); } var sprint = SprintManager.GetSprintFromID(id); if (sprint == null) { return(RedirectToAction("Home", "Project")); } ViewBag.Members = SharedManager.SplitString(proj.DevTeam); return(View()); }
public ActionResult Statistics(int id) { var user = (User)Session["UserInfo"]; if (user == null) { return(RedirectToAction("Login", "Login")); } var proj = (Project)Session["Project"]; ViewBag.Link = "Project"; if (proj == null) { return(RedirectToAction("Dashboard", "Dashboard")); } proj = ProjectManager.GetProjectByID(proj.ProjectID, user.Email); var sprints = ProjectManager.GetSprintFromProject(proj.Sprints); if (sprints == null || sprints.Count(m => m.SprintID == id) == 0) { ViewBag.Error = "Sprint not found"; return(RedirectToAction("Home", "Project")); } var sprint = sprints.First(m => m.SprintID == id); ViewBag.Sprint = sprint; ViewBag.Members = SharedManager.SplitString(proj.DevTeam); ViewBag.Items = SprintManager.GetItemsFromSprint(sprint.Items).OrderByDescending(m => m.AssignedTo == user.Email).ThenBy(m => m.ItemStatus).ToList(); return(View()); }
public ActionResult Create_Meeting(int id, Meeting meeting) { var user = (User)Session["UserInfo"]; if (user == null) { return(RedirectToAction("Login", "Login")); } var proj = (Project)Session["Project"]; ViewBag.Link = "Project"; if (proj == null) { return(RedirectToAction("Dashboard", "Dashboard")); } var sprint = SprintManager.GetSprintFromID(id); if (sprint == null) { return(RedirectToAction("Home", "Project")); } ViewBag.Type = user.Role; ViewBag.Short = false; ViewBag.Meetings = (MeetingManager.GetMeetingsByEmail(user.Email, id)).OrderBy(m => m.Time).ToList(); ViewBag.Members = SharedManager.SplitString(proj.DevTeam); ViewBag.ScrumMaster = proj.ScrumMaster; if (!ModelState.IsValid) { return(PartialView("MeetingList")); } if (meeting.Time.Date > sprint.FinishDate) { ViewBag.Error = "Meeting date after sprint finish date"; return(PartialView("MeetingList")); } meeting.ProjectID = proj.ProjectID; if (meeting.Developer == "*****@*****.**") { meeting.Developer = "," + proj.DevTeam + ","; ViewBag.Error = MeetingManager.AddMeeting(meeting, id); } else { ViewBag.Error = MeetingManager.AddMeeting(meeting, id); } var meetings = (MeetingManager.GetMeetingsByEmail(user.Email, id)).OrderBy(m => m.Time).ToList(); Session["Meetings"] = meetings; ViewBag.Meetings = meetings; Session["Project"] = ProjectManager.GetProjectByID(proj.ProjectID, user.Email); return(PartialView("MeetingList")); }
public ActionResult Remove_Meeting(int id, Meeting meeting) { var user = (User)Session["UserInfo"]; if (user == null) { return(RedirectToAction("Login", "Login")); } var proj = (Project)Session["Project"]; ViewBag.Link = "Project"; if (proj == null) { return(RedirectToAction("Dashboard", "Dashboard")); } var sprint = SprintManager.GetSprintFromID(id); if (sprint == null) { return(RedirectToAction("Home", "Project")); } ViewBag.Type = user.Role; ViewBag.Short = false; ViewBag.Meetings = (MeetingManager.GetMeetingsByEmail(user.Email, id)).OrderBy(m => m.Time).ToList(); ViewBag.Members = SharedManager.SplitString(proj.DevTeam); ViewBag.ScrumMaster = proj.ScrumMaster; meeting.ProjectID = proj.ProjectID; ViewBag.Error = MeetingManager.RemoveMeeting(meeting); var meetings = (MeetingManager.GetMeetingsByEmail(user.Email, id)).OrderBy(m => m.Time).ToList(); Session["Meetings"] = meetings; ViewBag.Meetings = meetings; Session["Project"] = ProjectManager.GetProjectByID(proj.ProjectID, user.Email); return(PartialView("MeetingList")); }
public ActionResult Home(string projectName) { var user = (User)Session["UserInfo"]; if (user == null) { return(RedirectToAction("Login", "Login")); } var proj = (Project)Session["Project"]; ViewBag.Link = "Project"; if (proj == null) { return(RedirectToAction("Dashboard", "Dashboard")); } proj = ProjectManager.GetProjectByID(proj.ProjectID, user.Email); //ViewBag.Project = proj; ViewBag.Sprints = ProjectManager.GetSprintFromProject(proj.Sprints).OrderByDescending(m => m.FinishDate) .ThenBy(x => x.StartDate).ToList(); var dict = new Dictionary <Sprint, List <Item> >(); foreach (var sprint in ((List <Sprint>)ViewBag.Sprints).OrderBy(m => m.FinishDate)) { dict.Add(sprint, SprintManager.GetItemsFromSprint(sprint.Items)); } ViewBag.ItemsSprints = dict; ViewBag.ProjectName = proj.Name; var memberList = SharedManager.SplitString(proj.DevTeam); memberList.Insert(0, proj.ScrumMaster); ViewBag.MemberList = memberList; Session["Project"] = proj; Session["Meetings"] = MeetingManager.GetMeetingsByEmail(user.Email, -1, proj.ProjectID); return(View()); }
public ActionResult Meetings(int id) { var user = (User)Session["UserInfo"]; if (user == null) { return(RedirectToAction("Login", "Login")); } var proj = (Project)Session["Project"]; ViewBag.Link = "Project"; if (proj == null) { return(RedirectToAction("Dashboard", "Dashboard")); } proj = ProjectManager.GetProjectByID(proj.ProjectID, user.Email); var sprints = ProjectManager.GetSprintFromProject(proj.Sprints); if (sprints == null || sprints.Count(m => m.SprintID == id) == 0) { ViewBag.Error = "Sprint not found"; return(RedirectToAction("Home", "Project")); } var sprint = sprints.First(m => m.SprintID == id); SharedManager.DailyScrumMeeting(proj, sprint, false); ViewBag.Short = false; ViewBag.Meetings = MeetingManager.GetMeetingsByEmail(user.Email, sprint.SprintID).OrderBy(m => m.Time).ToList(); ViewBag.ScrumMaster = proj.ScrumMaster; ViewBag.Type = user.Role; ViewBag.Error = null; ViewBag.Members = SharedManager.SplitString(proj.DevTeam); return(View()); }
public ActionResult Home(int id) { var user = (User)Session["UserInfo"]; if (user == null) { return(RedirectToAction("Login", "Login")); } var proj = (Project)Session["Project"]; ViewBag.Link = "Project"; if (proj == null) { return(RedirectToAction("Dashboard", "Dashboard")); } var sprints = ProjectManager.GetSprintFromProject(proj.Sprints); if (sprints == null || sprints.Count(m => m.SprintID == id) == 0) { ViewBag.Error = "Sprint not found"; return(RedirectToAction("Home", "Project")); } var sprint = sprints.First(m => m.SprintID == id); var DailyTime = "08:00:00"; var timeParts = DailyTime.Split(new char[1] { ':' }); var dateNow = DateTime.Now; var date = new DateTime(dateNow.Year, dateNow.Month, dateNow.Day, int.Parse(timeParts[0]), int.Parse(timeParts[1]), int.Parse(timeParts[2])); TimeSpan ts; if (date > dateNow) { ts = date - dateNow; } else { date = date.AddDays(1); ts = date - dateNow; } SharedManager.DailyScrumMeeting(proj, sprint, false); var meetings = MeetingManager.GetMeetingsByEmail(user.Email, sprint.SprintID); //waits certan time and run the code Task.Delay(ts).ContinueWith((x) => SharedManager.DailyScrumMeeting(proj, sprint)); ViewBag.Items = SprintManager.GetItemsFromSprint(sprint.Items); ViewBag.Sprint = sprint; ViewBag.Short = true; ViewBag.Meetings = meetings.Where(m => m.Time > DateTime.Now).Take(5).OrderBy(m => m.Time).ToList(); ViewBag.ScrumMaster = proj.ScrumMaster; ViewBag.Type = user.Role; ViewBag.Members = SharedManager.SplitString(proj.DevTeam); ViewBag.Email = user.Email; return(View()); }