public void ReportFilterTest() { var filter = new ReportFilter(); filter.DepartmentId = Guid.NewGuid(); filter.FromDate = DateTime.Now.Date; filter.ToDate = DateTime.Now.Date; filter.MilestoneStatuses.Add(MilestoneStatus.Open); filter.MilestoneStatuses.Add(MilestoneStatus.Closed); filter.ProjectIds.Add(1); filter.ProjectIds.Add(3); filter.ProjectStatuses.Add(ProjectStatus.Open); filter.ProjectStatuses.Add(ProjectStatus.Closed); filter.ProjectTag = "tag"; filter.TaskStatuses.Add(TaskStatus.Open); filter.TaskStatuses.Add(TaskStatus.Closed); filter.TimeInterval = ReportTimeInterval.Absolute; filter.UserId = Guid.NewGuid(); filter.ViewType = 4; var xml = filter.ToXml(); var uri = filter.ToUri(); AreEquals(filter, ReportFilter.FromXml(xml)); AreEquals(filter, ReportFilter.FromUri(uri)); filter.TimeInterval = ReportTimeInterval.CurrMonth; xml = filter.ToXml(); uri = filter.ToUri(); AreEquals(filter, ReportFilter.FromXml(xml)); AreEquals(filter, ReportFilter.FromUri(uri)); }
public string GetActivityReportUri() { var filter = new ReportFilter { TimeInterval = ReportTimeInterval.Absolute, UserId = UserID }; return(string.Format("{0}?action=generate&reportType=5&{1}", VirtualPathUtility.ToAbsolute(PathProvider.BaseVirtualPath + "reports.aspx"), filter.ToUri())); }
public string GetReportUri() { var filter = new ReportFilter { TimeInterval = ReportTimeInterval.Absolute, UserId = SecurityContext.CurrentAccount.ID }; filter.ProjectStatuses.Add(ProjectStatus.Open); return(string.Format("reports.aspx?action=generate&reportType=7&{0}", filter.ToUri())); }
public string GetReportUri(bool onlyOpenTasks, Guid userID) { var filter = new ReportFilter(); filter.TimeInterval = ReportTimeInterval.Absolute; filter.UserId = userID; filter.MilestoneStatuses.Add(MilestoneStatus.Open); filter.MilestoneStatuses.Add(MilestoneStatus.Closed); filter.TaskStatuses.Add(onlyOpenTasks ? TaskStatus.Open : TaskStatus.Closed); return(string.Format("reports.aspx?action=generate&reportType=10&{0}", filter.ToUri())); }
public string GetTasksReportUri() { var filter = new ReportFilter { TimeInterval = ReportTimeInterval.Absolute, UserId = UserID }; filter.TaskStatuses.Add(TaskStatus.Open); filter.TaskStatuses.Add(TaskStatus.Closed); return(string.Format("{0}?action=generate&reportType=10&{1}", VirtualPathUtility.ToAbsolute(PathProvider.BaseVirtualPath + "reports.aspx"), filter.ToUri())); }