public override FlowDocument Build() { FlowDocument flowDocument = new FlowDocument(); flowDocument.Blocks.Add(FlowDocumentHelper.BuildTitle(Title)); Dictionary <string, Tuple <string, string> > columnDefinitions = new Dictionary <string, Tuple <string, string> >() { { "Title", new Tuple <string, string>("Title", null) }, { "StatusDescription", new Tuple <string, string>("Status", null) }, { "PriorityDescription", new Tuple <string, string>("Priority", null) }, { "CreatedDate", new Tuple <string, string>("Date Created", null) }, { "CompletedDate", new Tuple <string, string>("Date Completed", null) } }; using (TaskData tData = new TaskData()) { List <Task> activeTasks = tData.GetActiveTasks(); List <TaskViewModel> rowData = new List <TaskViewModel>(); foreach (Task task in activeTasks) { rowData.Add(new TaskViewModel(task, tData)); } flowDocument.Blocks.Add(FlowDocumentHelper.BuildTable <TaskViewModel>(columnDefinitions, rowData)); foreach (TaskViewModel taskVm in rowData) { taskVm.Dispose(); } } return(flowDocument); }
public override FlowDocument Build() { FlowDocument flowDocument = new FlowDocument(); flowDocument.Blocks.Add(FlowDocumentHelper.BuildTitle(Title)); Paragraph criteriaPara = new Paragraph(); Span titleSpan = new Span(); titleSpan.Inlines.Add("Title: "); titleSpan.FontWeight = FontWeights.Bold; Span titleValueSpan = new Span(); titleValueSpan.Inlines.Add(SelectedProject.Title); Span dateTitleSpan = new Span(); dateTitleSpan.Inlines.Add(" Date Created: "); dateTitleSpan.FontWeight = FontWeights.Bold; Span dateValueSpan = new Span(); dateValueSpan.Inlines.Add(SelectedProject.CreatedDate.ToShortDateString()); criteriaPara.Inlines.Add(titleSpan); criteriaPara.Inlines.Add(titleValueSpan); criteriaPara.Inlines.Add(dateTitleSpan); criteriaPara.Inlines.Add(dateValueSpan); flowDocument.Blocks.Add(criteriaPara); Dictionary <string, Tuple <string, string> > columnDefinitions = new Dictionary <string, Tuple <string, string> >() { { "Title", new Tuple <string, string>("Task Title", null) }, { "StatusDescription", new Tuple <string, string>("Status", null) }, { "PriorityDescription", new Tuple <string, string>("Priority", null) }, { "CreatedDate", new Tuple <string, string>("Date Created", null) }, { "CompletedDate", new Tuple <string, string>("Date Completed", null) } }; using (TaskData tData = new TaskData()) { using (ProjectData pData = new ProjectData()) { List <Task> childTasks = pData.GetChildTasks(SelectedProject.ProjectId); List <TaskViewModel> rowData = new List <TaskViewModel>(); foreach (Task task in childTasks) { rowData.Add(new TaskViewModel(task, tData)); } flowDocument.Blocks.Add(FlowDocumentHelper.BuildTable <TaskViewModel>(columnDefinitions, rowData)); foreach (TaskViewModel taskVm in rowData) { taskVm.Dispose(); } } } return(flowDocument); }
public override FlowDocument Build() { FlowDocument flowDocument = base.Build(); Dictionary <string, Tuple <string, string> > columnDefinitions = new Dictionary <string, Tuple <string, string> >() { { "Title", new Tuple <string, string>("Title", null) }, { "StatusDescription", new Tuple <string, string>("Status", null) }, { "CategoryDescription", new Tuple <string, string>("Category", null) }, { "CreatedDate", new Tuple <string, string>("Date Created", null) }, { "CompletedDate", new Tuple <string, string>("Date Completed", null) } }; using (GoalData gData = new GoalData()) { using (ProjectData pData = new ProjectData()) { using (TaskData tData = new TaskData()) { List <Goal> completedGoals = gData.GetCompletedGoalsByDate(StartDate, EndDate); List <GoalViewModel> rowData = new List <GoalViewModel>(); foreach (Goal goal in completedGoals) { rowData.Add(new GoalViewModel(goal, gData, pData, tData)); } flowDocument.Blocks.Add(FlowDocumentHelper.BuildTable <GoalViewModel>(columnDefinitions, rowData)); foreach (GoalViewModel goalVm in rowData) { goalVm.Dispose(); } } } } return(flowDocument); }
public override FlowDocument Build() { FlowDocument flowDocument = base.Build(); Dictionary <string, Tuple <string, string> > columnDefinitions = new Dictionary <string, Tuple <string, string> >() { { "Title", new Tuple <string, string>("Title", null) }, { "StatusDescription", new Tuple <string, string>("Status", null) }, { "GoalTitle", new Tuple <string, string>("Goal", null) }, { "EstimatedCost", new Tuple <string, string>("Est. Cost", "{0:C}") }, { "CreatedDate", new Tuple <string, string>("Date Created", null) }, { "CompletedDate", new Tuple <string, string>("Date Completed", null) } }; using (ProjectData pData = new ProjectData()) { using (TaskData tData = new TaskData()) { List <Project> completedProjects = pData.GetCompletedProjectsByDate(StartDate, EndDate); List <ProjectViewModel> rowData = new List <ProjectViewModel>(); foreach (Project project in completedProjects) { rowData.Add(new ProjectViewModel(project, pData, tData)); } flowDocument.Blocks.Add(FlowDocumentHelper.BuildTable <ProjectViewModel>(columnDefinitions, rowData)); foreach (ProjectViewModel projectVm in rowData) { projectVm.Dispose(); } } } return(flowDocument); }
public override FlowDocument Build() { FlowDocument flowDocument = new FlowDocument(); flowDocument.Blocks.Add(FlowDocumentHelper.BuildTitle(Title)); Paragraph criteriaPara = new Paragraph(); Span titleSpan = new Span(); titleSpan.Inlines.Add("Title: "); titleSpan.FontWeight = FontWeights.Bold; Span titleValueSpan = new Span(); titleValueSpan.Inlines.Add(SelectedGoal.Title); Span dateTitleSpan = new Span(); dateTitleSpan.Inlines.Add(" Date Created: "); dateTitleSpan.FontWeight = FontWeights.Bold; Span dateValueSpan = new Span(); dateValueSpan.Inlines.Add(SelectedGoal.CreatedDate.ToShortDateString()); criteriaPara.Inlines.Add(titleSpan); criteriaPara.Inlines.Add(titleValueSpan); criteriaPara.Inlines.Add(dateTitleSpan); criteriaPara.Inlines.Add(dateValueSpan); flowDocument.Blocks.Add(criteriaPara); Dictionary <string, Tuple <string, string> > columnDefinitions = new Dictionary <string, Tuple <string, string> >() { { "Title", new Tuple <string, string>("Project Title", null) }, { "StatusDescription", new Tuple <string, string>("Status", null) }, { "EstimatedCost", new Tuple <string, string>("Estimated Cost", "0:C") }, { "CreatedDate", new Tuple <string, string>("Date Created", null) }, { "CompletedDate", new Tuple <string, string>("Date Completed", null) } }; using (ProjectData pData = new ProjectData()) { using (TaskData tData = new TaskData()) { using (GoalData gData = new GoalData()) { List <Project> childProjects = gData.GetChildProjects(SelectedGoal.GoalId); List <ProjectViewModel> rowData = new List <ProjectViewModel>(); foreach (Project project in childProjects) { rowData.Add(new ProjectViewModel(project, pData, tData)); } flowDocument.Blocks.Add(FlowDocumentHelper.BuildTable <ProjectViewModel>(columnDefinitions, rowData)); foreach (ProjectViewModel projectVm in rowData) { projectVm.Dispose(); } } } } return(flowDocument); }