private void Page_Loaded(object sender, RoutedEventArgs e) { try { pageMode = PageFunctions.pageParameter(this, "Mode"); Globals.ProjectSourceMode = pageMode; } catch (Exception generalException) { MessageFunctions.Error("Error retrieving query details", generalException); PageFunctions.ShowTilesPage(); } refreshClientCombo(); refreshStatusCombo(); refreshStageCombo(); setTimelineType(Globals.SelectedTimelineType); FromDate.SelectedDate = Globals.SelectedFromDate; ToDate.SelectedDate = Globals.SelectedToDate; PageFunctions.ShowFavouriteButton(); if (pageMode == PageFunctions.View) { AmendImage.SetResourceReference(Image.SourceProperty, "ViewIcon"); Instructions.Content += " Click 'Details' to see a project's full timeline."; } else { Instructions.Content += " Click 'Details' to amend a project's timeline."; } pageLoaded = true; refreshHistoryDataGrid(); Globals.ProjectSourcePage = "StageHistoryPage"; }
private void Page_Loaded(object sender, RoutedEventArgs e) { try { pageMode = PageFunctions.pageParameter(this, "Mode"); Globals.ProjectSourceMode = pageMode; //Globals.ProjectSourcePage = "ProjectPage"; // Now set in Page Functions beforehand if (pageMode == PageFunctions.View || !Globals.MyPermissions.Allow("EditProjects")) { viewOnly = true; } if (pageMode != PageFunctions.Lookup) { PageFunctions.ShowFavouriteButton(); } } catch (Exception generalException) { MessageFunctions.Error("Error retrieving query details", generalException); closePage(true); } if (pageMode == PageFunctions.View) { AddButton.Visibility = CommitButton.Visibility = Visibility.Hidden; AmendImage.SetResourceReference(Image.SourceProperty, "ViewIcon"); } else if (pageMode == PageFunctions.Amend) { PageHeader.Content = "Amend or Manage Projects"; Instructions.Content = "Use filters to restrict results and column headers to sort them, then choose the required option."; HeaderImage2.SetResourceReference(Image.SourceProperty, "AmendIcon"); CommitButton.Visibility = Visibility.Hidden; AddButton.Visibility = Globals.MyPermissions.ShowOrCollapse("AddProjects"); } else if (pageMode == PageFunctions.Lookup) { PageHeader.Content = "Select Project"; Instructions.Content = "Use filters to restrict results and column headers to sort them, then choose the desired project."; HeaderImage2.SetResourceReference(Image.SourceProperty, "SearchIcon"); AddButton.Visibility = AmendButton.Visibility = BackButton.Visibility = MoreButton.Visibility = Visibility.Hidden; CommitButton.Margin = AmendButton.Margin; CancelButtonText.Text = "Cancel"; } try { BackButton.Visibility = ProjectFunctions.BackButtonVisibility("ProjectPage"); BackButton.ToolTip = ProjectFunctions.BackButtonTooltip(); refreshClientCombo(); refreshPMsCombo(); if (ProjectFunctions.PMFilterList.Exists(ssr => ssr.ID == Globals.MyStaffID)) { PMsCombo.SelectedItem = ProjectFunctions.PMFilterList.First(ssr => ssr.ID == Globals.MyStaffID); } refreshStatusCombo(); toggleMoreButton(); } catch (Exception generalException) { MessageFunctions.Error("Error refreshing filters", generalException); closePage(true); } }