/// <summary> /// Assigns the project hour consumption. /// </summary> /// <param name="reportPresenter">The report presenter.</param> private void AssignProjectHourConsumption(ReportPresenter reportPresenter) { string roleTypeIds = null; string roleGroupIds = null; string supervisorIds = null; roleGroupIds = reportPresenter.ReportFilter.SelectedRoleGroup.ToString(); supervisorIds = reportPresenter.ReportFilter.SelectedSupervisor.ToString(); var roleType = reportPresenter.RoleTypesList.FirstOrDefault(); reportPresenter.RoleTypesList.Remove(roleType); if (string.IsNullOrEmpty(reportPresenter.SelectedRoleIdsForTrend)) { reportPresenter.RoleTypesList.ForEach(s => reportPresenter.SelectedRoles.Add(s.ID)); reportPresenter.SelectedRoleIdsForTrend = string.Join(",", reportPresenter.SelectedRoles.Select(s => s.ToString(CultureInfo.InvariantCulture)).ToList()); } else { var selectedRoleIdsForTrend = reportPresenter.SelectedRoleIdsForTrend.Split(',').Select(id => Convert.ToInt32(id, CultureInfo.CurrentCulture)); roleTypeIds = string.Join(",", reportPresenter.RoleTypesList.Where(r => selectedRoleIdsForTrend.Contains(r.ID)).Select(r => r.Name)); reportPresenter.AssignSelectedRoleTypeList(selectedRoleIdsForTrend.ToList()); } reportPresenter.AssignProjectHourConsumption(this.reportService.RetrieveRoleWorkCategoryHours(reportPresenter.ReportFilter.DateFrom, reportPresenter.ReportFilter.DateTo, roleGroupIds, roleTypeIds, supervisorIds, SessionData.Instance.UserInfo.Developer.DeveloperID)); }