I am collecting 3 years of data and building a string that will be used with an ASP Literal control. The method GetListOfMeetingBygroupId
takes in a groupID
and year
and will return meeting for that group and year.
MeetingService ms = new MeetingService();
int groupId = 574;
//Meeting
int totalYearCount = 3;
StringBuilder sbMeeting = new StringBuilder();
DateTime aDate = DateTime.Now;
for (int x = 1; x <= totalYearCount; x++)
{
var list = ms.GetListOfMeetingBygroupId(groupId, aDate.Year);
sbMeeting.AppendFormat("<p><b>{0}</p></b>",aDate.ToString("yyyy"));
foreach (var meeting in list)
{
sbMeeting.Append("<p>");
DateTime meetingendDate = Convert.ToDateTime(meeting.MeetingDateList.Select(c => c.StartDate).Max());
DateTime meetingstartDate = Convert.ToDateTime(meeting.MeetingDateList.Select(c => c.StartDate).Min());
int totalMeetingPresentation = ms.GetListOfPresentationsBymeetingId(meeting.MeetingId).Count();
sbMeeting.Append(meetingstartDate.ToString("dddd, MMMM dd yyyy"));
sbMeeting.Append("<br>");
sbMeeting.Append(meeting.Type.Name);
sbMeeting.Append("<br>");
if (totalMeetingPresentation > 0)
{
sbMeeting.AppendFormat("<a class='body'href=meetingdetails.aspx?meetingId={0}>{1}</a>", meeting.MeetingId, "Minutes and Presentations");
}
else
{
var meetingMinFile = ms.GetMeetingFile(meeting.MeetingId);
sbMeeting.AppendFormat("<td><a href=../../../Common/FileManager.ashx?FileManagerId={0}>{1}</a></td>", meetingMinFile.FileManagerId, "Minutes");
}
sbMeeting.Append("<p>");
sbMeeting.Append("<br>");
sbMeeting.Append("</p>");
}
aDate = aDate.AddYears(-1);
}