/// <summary> /// Assigns the selected status. /// </summary> /// <param name="reportPresenter">The report presenter.</param> private static void AssignSelectedStatus(ReportPresenter reportPresenter) { IList<int> statusIds = string.IsNullOrEmpty(reportPresenter.SelectedStatusIds) ? reportPresenter.TaskStatusFilterList.Select(item => item.ID).Take(2).ToList() : reportPresenter.SelectedStatusIds.Split(',').Select(id => Convert.ToInt32(id, CultureInfo.CurrentCulture)).ToList(); if (string.IsNullOrEmpty(reportPresenter.SelectedStatusIds)) { reportPresenter.SelectedStatusIds = string.Join(",", statusIds); } reportPresenter.AssignSelectedStatusList(statusIds); }
/// <summary> /// Assigns the reports filters. /// </summary> /// <param name="reportPresenter">The report presenter.</param> private void AssignReportsFilters(ReportPresenter reportPresenter) { /*need for 1. Role Allocation Report=> RoleAlloactionDrillDown*/ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.RoleAllocation.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.RoleAllocationDrillDown.ToString())) { reportPresenter.AssignRoleGroupsForAllocation(this.lookupService.RetrieveRoleGroups(SessionData.Instance.UserInfo.Developer.DeveloperID)); } /*need for. Active Projects List*/ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.ActiveProjects.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ReleaseReport.ToString())) { reportPresenter.AssignClientForDailyReport(this.lookupService.RetrieveClients(null, false, SessionData.Instance.UserInfo.Developer.DeveloperID)); } /*need for: Release report*/ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.ReleaseReport.ToString())) { reportPresenter.AssignReleaseStatusList(this.lookupService.RetrieveReleaseCalendarStatusList(default(byte?), SessionData.Instance.UserInfo.Developer.DeveloperID)); if (string.IsNullOrEmpty(reportPresenter.SelectedStatusIds)) { var ids = reportPresenter.ReleaseStatusList.Select(a => a.ID).ToList(); if (ids.Count > 0) { foreach (var id in ids) { reportPresenter.SelectedStatusIds = reportPresenter.SelectedStatusIds + id + ","; } reportPresenter.SelectedStatusIds = reportPresenter.SelectedStatusIds.TrimEnd(','); } reportPresenter.AssignSelectedStatusList(ids); } } /*RoleAlloactionDrillDown>RoleProjectAlloaction, 3. ProjectTeamMemberAllocation,ProjectTeamMemberAllocationReport */ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.RoleProjectAllocation.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectTeamMemberAllocation.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectTeamMemberAllocationReport.ToString())) { if (reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectTeamMemberAllocation.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectTeamMemberAllocationReport.ToString())) { reportPresenter.AssignMultiSelectRoleGroups(this.lookupService.RetrieveRoleGroups(SessionData.Instance.UserInfo.Developer.DeveloperID)); AssignSelectedRoleGroups(reportPresenter); } else { reportPresenter.AssignRoleGroups(this.lookupService.RetrieveRoleGroups(SessionData.Instance.UserInfo.Developer.DeveloperID)); } } /* 3.ComplianceSummaryGraph, ProjectHoursAnalysisDrillDown, projectHourAlloactionDrillDown, RoleWiseAlloaction, ProjectHourAnaluysis, estimated Vs consumed hours(ProjectWeeklyHourConsumption), WeeklyProjectHourBurndown, ProjectHourBreakdown, ProductivityGraph*/ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.ComplianceSummaryGraph.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectHoursAnalysisDrillDown.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectHoursAllocationDrillDown.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.RoleWiseAllocation.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectHoursAnalysis.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectWeeklyHourConsumption.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.WeeklyProjectHourBurndown.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectHourBreakdown.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProductivityGraph.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProductivityGraph.ToString())) { reportPresenter.AssignParentProjects(this.lookupService.RetrieveProjects(null, null, false, null, SessionData.Instance.UserInfo.Developer.DeveloperID)); } /* 3. GameChangersWeeklyStatus,DailyReport,ProjectTeamMemberAllocation,NonComplianceDrillDown */ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.NonComplianceDrillDown.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectTeamMemberAllocation.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectTeamMemberAllocationReport.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.GameChangersWeeklyStatus.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.DailyReport.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ActivityReport.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.TaskReport.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.TaskProjectReport.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ReleaseReport.ToString())) { reportPresenter.AssignProjectsForDailyReport(this.lookupService.RetrieveProjects(null, null, false, null, SessionData.Instance.UserInfo.Developer.DeveloperID)); } /* 3. ProjectTeamMemberAllocation,ProjectTeamMemberAllocationReport */ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectTeamMemberAllocation.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ActivityReport.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectTeamMemberAllocationReport.ToString())) { reportPresenter.AssignSupervisors(this.developerService.RetrieveManagers(null, false, SessionData.Instance.UserInfo.Developer.DeveloperID)); if (string.IsNullOrEmpty(reportPresenter.SelectedSupervisorIds)) { reportPresenter.Supervisors.ForEach(s => reportPresenter.SelectedSupervisors.Add(s.DeveloperID)); reportPresenter.SelectedSupervisorIds = string.Join(",", reportPresenter.SelectedSupervisors.Select(s => s.ToString(CultureInfo.InvariantCulture)).ToList()); } AssignSelectedProjectIds(reportPresenter); AssignSelectedSupervisors(reportPresenter); } /* 3. ProductivityGraph, DailyReport, employee leave record(special leave)*/ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.Feedback.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProductivityGraph.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.DailyReport.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.SalarySheet.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.SpecialLeave.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.TaskReport.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.TaskProjectReport.ToString())) { var developers = this.lookupService.RetrieveDevelopers(null, null, SessionData.Instance.UserInfo.Developer.DeveloperID); if (reportPresenter.SelectedMenuItem.Equals(ReportOption.TaskReport.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.TaskProjectReport.ToString())) { developers.Insert(0, new LookupItem() { ID = Zero, Name = All }); } else if (reportPresenter.SelectedMenuItem.Equals(ReportOption.DailyReport.ToString()) && SessionData.Instance.UserInfo != null && !(SessionUserManager.IsUserHR() || SessionUserManager.IsUserManagement() || SessionData.Instance.UserInfo.Developer.RoleGroupID == ProjectManager)) { var managerList = new List<int> { SessionData.Instance.UserInfo.Developer.DeveloperID }; var teamDevelopers = this.teamEngagementService.RetrieveDeveloperList(managerList, null, null, null, SessionData.Instance.UserInfo.Developer.DeveloperID); reportPresenter.AssignTeamDevelopers(teamDevelopers); developers = reportPresenter.TeamMembersList; } if (SessionUserManager.IsUserManagement() || SessionData.Instance.UserInfo.Developer.RoleGroupID == ProjectManager) { reportPresenter.AssignSupervisors(this.developerService.RetrieveManagers(null, false, SessionData.Instance.UserInfo.Developer.DeveloperID)); if (!string.IsNullOrEmpty(reportPresenter.SelectedSupervisorIds)) { var supervisorList = reportPresenter.SelectedSupervisorIds.Split(',').ToList(); reportPresenter.Supervisors.Where(s => supervisorList.Contains(s.DeveloperID.ToString())).ToList().ForEach(s => reportPresenter.SelectedSupervisors.Add(s.DeveloperID)); } } reportPresenter.AssignDevelopers(developers); } /* Team member reporting */ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.TeamMemberReporting.ToString())) { var developers = this.lookupService.RetrieveDevelopers(null, false, SessionData.Instance.UserInfo.Developer.DeveloperID); developers.Insert(0, new LookupItem() { ID = Zero, Name = Select }); reportPresenter.AssignDevelopers(developers); } /* DailyReport */ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.DailyReport.ToString())) { reportPresenter.AssignClientForDailyReport(this.lookupService.RetrieveClients(null, false, SessionData.Instance.UserInfo.Developer.DeveloperID)); reportPresenter.AssignWorkCategories(this.lookupService.RetrieveWorkCategories(null, false, SessionData.Instance.UserInfo.Developer.DeveloperID)); } /* Feedback */ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.Feedback.ToString())) { reportPresenter.AssignFeedbackStatus(this.lookupService.RetrieveFeedbackStatusList(SessionData.Instance.UserInfo.Developer.DeveloperID)); } /* special leave */ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.SpecialLeave.ToString())) { reportPresenter.AssignLeaveTypes(this.lookupService.RetrieveLeaveTypes(SessionData.Instance.UserInfo.Developer.DeveloperID).ToList()); } /* ComplianceSummaryGraph */ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.ComplianceSummaryGraph.ToString())) { reportPresenter.AssignFunctionalAreaList(this.lookupService.RetrieveFunctionalAreaList()); AssignSelectedFunctionalAreas(reportPresenter); reportPresenter.AssignReleaseList(null); } /* ComplianceSummaryGraph */ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.NonComplianceDrillDown.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ReleaseReport.ToString())) { reportPresenter.AssignReleaseTypes(this.lookupService.RetrieveReleaseTypes(SessionData.Instance.UserInfo.Developer.DeveloperID)); } /* swipeInOut,SalarySheet, yearly leave roster, feedback, NameYearlyLeaveRoster, TaskReport */ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.SwipeInOut.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.NameYearlyLeaveRoster.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.NameLeaveRoaster.ToString())) { reportPresenter.AssignTeamDevelopers(this.developerService.RetrieveList(null, null, SessionData.Instance.UserInfo.Developer.DeveloperID)); } if (reportPresenter.SelectedMenuItem.Equals(ReportOption.TaskReport.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.TaskProjectReport.ToString())) { var managerList = new List<int> { SessionData.Instance.UserInfo.Developer.DeveloperID }; reportPresenter.AssignTeamDevelopers(this.teamEngagementService.RetrieveDeveloperList(managerList, null, null, null, SessionData.Instance.UserInfo.Developer.DeveloperID)); } if (reportPresenter.SelectedMenuItem.Equals(ReportOption.ProductivityGraph.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectTeamMemberAllocation.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectTeamMemberAllocationReport.ToString())) { reportPresenter.AssignDevelopersByRoleList(this.developerService.RetrieveList(null, null, SessionData.Instance.UserInfo.Developer.DeveloperID)); reportPresenter.AssignDeveloperByRoleGroups(this.lookupService.RetrieveRoleGroups(SessionData.Instance.UserInfo.Developer.DeveloperID)); reportPresenter.AssignFilterType(); AssignProductivityGraphFilter(reportPresenter); } if (reportPresenter.SelectedMenuItem.Equals(ReportOption.TaskReport.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.TaskProjectReport.ToString())) { var taskPriorityList = this.lookupService.RetrieveTaskPriorityList(SessionData.Instance.UserInfo.Developer.DeveloperID); taskPriorityList.Insert(0, new LookupItem() { ID = 0, Name = All }); reportPresenter.AssignPriorityList(taskPriorityList); var taskStatusFilter = this.lookupService.RetrieveTaskStatusFilterList(SessionData.Instance.UserInfo.Developer.DeveloperID); taskStatusFilter.Remove(taskStatusFilter.FirstOrDefault(s => s.Name == All)); reportPresenter.AssignTaskStatusFilter(taskStatusFilter); } /* Role or Monthly Productivity */ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.MonthlyProductivity.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.TeamMemberProductivityHour.ToString()) || reportPresenter.SelectedMenuItem.Equals(ReportOption.RoleProductivityDrilldown.ToString())) { reportPresenter.AssignRoleGroups(this.lookupService.RetrieveRoleGroups(SessionData.Instance.UserInfo.Developer.DeveloperID)); } /* Team member productivity */ if (reportPresenter.SelectedMenuItem.Equals(ReportOption.TeamMemberProductivityHour.ToString())) { reportPresenter.AssignRoleTypes(this.lookupService.RetrieveRoleTypesList(SessionData.Instance.UserInfo.Developer.DeveloperID)); } if (reportPresenter.SelectedMenuItem.Equals(ReportOption.ProjectHourConsumptionTrend.ToString())) { reportPresenter.AssignRoleGroups(this.lookupService.RetrieveRoleGroups(SessionData.Instance.UserInfo.Developer.DeveloperID)); if (reportPresenter.ReportFilter.SelectedRoleGroup.Equals(0)) { var roleGroup = reportPresenter.RoleGroupList.OrderBy(role => role.RoleGroup); reportPresenter.ReportFilter.SelectedRoleGroup = Convert.ToInt32(roleGroup.FirstOrDefault().RoleGroupID); } reportPresenter.AssignRoleTypes(this.lookupService.RetrieveRoleTypesList(SessionData.Instance.UserInfo.Developer.DeveloperID)); reportPresenter.AssignSupervisors(this.developerService.RetrieveManagers(null, false, SessionData.Instance.UserInfo.Developer.DeveloperID)); if (reportPresenter.ReportFilter.SelectedSupervisor.Equals(0)) { var supervisorId = reportPresenter.Supervisors.FirstOrDefault(a => a.DeveloperID.Equals(SessionData.Instance.UserInfo.Developer.DeveloperID)); if (supervisorId != null) { reportPresenter.ReportFilter.SelectedSupervisor = supervisorId.DeveloperID; } else { var teamMemberReportingData = this.developerService.RetrieveByDeveloperId(SessionData.Instance.UserInfo.Developer.DeveloperID, SessionData.Instance.UserInfo.Developer.DeveloperID); reportPresenter.ReportFilter.SelectedSupervisor = Convert.ToInt32(teamMemberReportingData.ManagerID, CultureInfo.CurrentCulture); } } } }