public ActionResult Index(int projectId) { StoriesIndexModel model = new StoriesIndexModel(); try { if (StoriesFilterSession == null) { StoriesFilter story = new StoriesFilter() { AllStories = StoriesLogic.GetStoriesList(projectId), projectId = projectId, sprintId = SprintsLogic.GetCurrentSprint(projectId) }; StoriesFilterSession = story; } model = StoriesLogic.GetStoriesIndexModel(StoriesFilterSession, projectId); } catch (Exception e) { LogsLogic.InsertLog(new Log() { Message = e.Message, StackTrace = e.StackTrace, StoryName = "ManagementProject/Stories/Index", Parameters = "projectId= " + projectId }); return(RedirectToAction("GeneralError", "Error", new { ErrorMessage = Error.ServerNotRespond })); } return(View(model)); }
public ActionResult Index() { try { if (SessionData.UserRole == UserRoles.Employee) { Attendance attendance = AttendancesLogic.GetLastSignByUserId(SessionData.UserId); if (attendance == null) { DateTime serverTime = DateTimeHelper.Today(); if (serverTime.Hour >= 12) { return(RedirectToAction("Index", "Employees")); } else { return(RedirectToAction("UserSign", "Attendances")); } } List <StandUpMeetingDetails> model = StandUpMeetingsLogic.GetTodayStandUpMeeting(SessionData.UserId); if (model.Count == 0) { return(RedirectToAction("Create", "StandUpMeet")); } return(RedirectToAction("Index", "Employees")); } else { HomeIndexModel model = new HomeIndexModel(); model.Projects = ProjectsLogic.GetProjectlist(); List <Sprint> sprints = SprintsLogic.GetAllSprints(); model.PreviousSprint = sprints.FindLast(a => a.PreviousSprint); model.CurrentSprint = sprints.Find(a => a.CurrentSprint); model.FutureSprint = sprints.Find(a => a.FutureSprint); model.CanCreateSprint = !sprints.Any(a => a.FutureSprint); return(View(model)); } } catch (Exception e) { LogsLogic.InsertLog(new Log() { Message = e.Message, StackTrace = e.StackTrace, StoryName = "ManagementProject/Projects/GetProjectlist", }); return(RedirectToAction("GeneralError", "Error", new { ErrorMessage = Error.ServerNotRespond })); } }
public void SetCurrent() { try { SprintsLogic.SetCurrent(); } catch (Exception e) { LogsLogic.InsertLog(new Log() { Message = e.Message, StackTrace = e.StackTrace, StoryName = "ManagementProject/Sprints/SetCurrent" }); } }
public ActionResult Create(bool isOneWeek) { try { SprintsLogic.InsertNewSprint(new Sprint() { CreateByUserId = SessionData.UserId, IsOneWeek = isOneWeek }); } catch (Exception e) { LogsLogic.InsertLog(new Log() { Message = e.Message, StackTrace = e.StackTrace, StoryName = "ManagementProject/Sprints/Create" }); } return(RedirectToAction("Index", "Home")); }
public ActionResult AssignProjectToSprint(string projectName) { try { if (SprintsLogic.InsertNewSprintProject(StoriesFilterSession.sprintId, projectName)) { return(Json("success", JsonRequestBehavior.AllowGet)); //return RedirectToAction("Index", new { sprintId = StoriesFilterSession.sprintId }); } } catch (Exception e) { LogsLogic.InsertLog(new Log() { Message = e.Message, StackTrace = e.StackTrace, StoryName = "ManagementProject/Sprints/AssignProjectToSprint(Post)", Parameters = projectName }); } return(Json("fail", JsonRequestBehavior.AllowGet)); }
public ActionResult Index(int?sprintId) { List <Sprint> sprints = SprintsLogic.GetAllSprints(); if (sprintId == null && StoriesFilterSession == null) { return(RedirectToAction("Index", "Home")); } if (StoriesFilterSession == null && sprints.Count > 0) { StoriesFilterSession = new StoriesFilter(); StoriesFilterSession.Sprints = new SprintModel() { Current = sprints.Find(a => a.CurrentSprint), Future = sprints.FindAll(a => a.FutureSprint), Previous = sprints.FindAll(a => a.PreviousSprint) }; } StoriesFilterSession.sprintId = sprintId.Value; return(View(StoriesFilterSession)); }