/// <summary> /// Initializes the month view presenter. /// </summary> /// <param name="dateTime">The date time.</param> /// <param name="releaseCalendarPresenter">The release calendar presenter.</param> private void InitializeMonthViewPresenter(DateTime dateTime, ReleaseCalendarPresenter releaseCalendarPresenter) { this.AssignCountValue(releaseCalendarPresenter, null, null); releaseCalendarPresenter.AssignReleases(this.releaseService.RetrieveListForMonth(dateTime, null, null, SessionData.Instance.UserInfo.Developer.DeveloperID)); IList<Release> releases = new List<Release>(); Dictionary<DateTime, IList<ReleaseListItem>> dictionary = new Dictionary<DateTime, IList<ReleaseListItem>>(); releaseCalendarPresenter.Releases.ForEach(item => AssignValuesToDictionary(dictionary, item)); AssignReleases(releases, dictionary); releaseCalendarPresenter.AssignMonthViewReleases(releases); releaseCalendarPresenter.TotalReleases = releaseCalendarPresenter.Releases.Count; this.AssignProjectReleaseTypes(releaseCalendarPresenter, true); releaseCalendarPresenter.AssignSelectedProjects(releaseCalendarPresenter.MasterProjects); }
/// <summary> /// Refreshes the month view. /// </summary> /// <param name="releaseCalendarPresenter">The release calendar presenter.</param> /// <param name="releaseTypes">The release types.</param> /// <param name="selectedIds">The selected ids.</param> /// <returns> /// List of counts /// </returns> private IList<ReleaseCountListItem> RefreshMonthView(ReleaseCalendarPresenter releaseCalendarPresenter, IList<byte> releaseTypes, IList<int> selectedIds) { this.AssignCountValue(releaseCalendarPresenter, releaseTypes, selectedIds); releaseCalendarPresenter.AssignReleases(this.releaseService.RetrieveListForMonth(releaseCalendarPresenter.SelectedDate, releaseTypes, selectedIds, SessionData.Instance.UserInfo.Developer.DeveloperID)); IList<Release> releases = new List<Release>(); Dictionary<DateTime, IList<ReleaseListItem>> dictionary = new Dictionary<DateTime, IList<ReleaseListItem>>(); releaseCalendarPresenter.Releases.ForEach(release => release.EndDate = release.StartDate.Value.AddHours(1)); releaseCalendarPresenter.Releases.ForEach(item => AssignValuesToDictionary(dictionary, item)); AssignReleases(releases, dictionary); releaseCalendarPresenter.AssignMonthViewReleases(releases); releaseCalendarPresenter.TotalReleases = releaseCalendarPresenter.MonthViewReleases.Count; IList<ReleaseCountListItem> releaseCounts = null; if (!string.IsNullOrEmpty(releaseCalendarPresenter.IsSearchByProject) && releaseCalendarPresenter.IsSearchByProject.Equals("true", StringComparison.OrdinalIgnoreCase)) { releaseCalendarPresenter.ProjectReleaseTypes.Clear(); this.AssignProjectReleaseTypes(releaseCalendarPresenter, true); } else { releaseCounts = this.releaseService.RetrieveReleaseCountForMonth(releaseCalendarPresenter.SelectedDate, null, selectedIds, SessionData.Instance.UserInfo.Developer.DeveloperID); } releaseCalendarPresenter.IsSearchByProject = string.Empty; return releaseCounts; }