private void displaySelectedStage()
 {
     try
     {
         ProjectStages selectedStage = ProjectFunctions.GetStageByID(thisProjectProxy.StageID); // Gets it from FullStageList, so it is picked up
         StageCombo.SelectedIndex = ProjectFunctions.FullStageList.IndexOf(selectedStage);
     }
     catch (Exception generalException) { MessageFunctions.Error("Error selecting current project stage", generalException); }
 }
예제 #2
0
        public bool Validate()
        {
            string        invalidMessage = "";
            ProjectStages projectStage   = ProjectFunctions.GetStageByID(Project.StageID);

            if (ActionCode == "")
            {
                invalidMessage = "Please ensure all new actions are registered by focusing on a different row or column.|Incomplete Data";
            }
            else if (ShortDescription == "")
            {
                invalidMessage = "Please enter a description for action " + ActionCode + ".|Missing Description";
            }
            else if (ProjectFunctions.ActionList.Exists(al => al.ActionCode != ActionCode && al.Project.ID == Project.ID && al.ShortDescription == ShortDescription))
            {
                invalidMessage = "Another action exists on this project with the same description as action " + ActionCode + ". Please provide a more specific description."
                                 + "|Duplicate Description";
            }
            else if (Owner == null)
            {
                invalidMessage = "Please select an owner for action " + ActionCode + ".|Missing Owner";
            }
            else if ((LinkedStage == null || LinkedStage.StageNumber == NoID) && TargetCompletion == null)
            {
                invalidMessage = "Please either link action " + ActionCode + " to a stage (meaning it is due before the end of that stage) or specify a target due date. "
                                 + "Incomplete actions can only be linked to the current stage (" + projectStage.StageName + ") or later.|Missing Due Date/Stage";
            }
            else if (CompletedNumber < 3 && LinkedStage != null && LinkedStage.StageNumber >= 0 && LinkedStage.StageNumber < projectStage.StageNumber)
            {
                invalidMessage = "Action " + ActionCode + " cannot be linked to the " + LinkedStage.StageName + " stage as the project is already in a later stage, "
                                 + "and it is not marked as completed. Please choose the current stage (" + projectStage.StageName + ") or a later stage, if the action is not complete."
                                 + "|Invalid Linked Stage";
            }

            if (invalidMessage != "")
            {
                MessageFunctions.SplitInvalid(invalidMessage);
                return(false);
            }
            else
            {
                return(true);
            }
        }
예제 #3
0
        public static void ResetProjectParameters()
        {
            SelectedClientProxy  = DefaultClientProxy;
            SelectedPMProxy      = DefaultPMProxy;
            SelectedStatusFilter = DefaultStatusFilter;
            SelectedProjectProxy = DefaultProjectProxy;
            SelectedProjectRole  = DefaultProjectRole;
            SelectedClientRole   = DefaultClientRole;

            ProjectSourcePage = TilesPageName;
            ProjectSourceMode = PageFunctions.None;

            SelectedTeamTimeFilter = DefaultTeamTimeFilter;
            SelectedStage          = DefaultStage;
            SelectedTimelineType   = DefaultTimelineType;
            SelectedFromDate       = DefaultFromDate;
            SelectedToDate         = DefaultToDate;
            SelectedHistory        = null;
        }
예제 #4
0
        // --------- Other/shared functions --------- //

        private void displaySelectedStage()
        {
            try
            {
                if (currentTimeline == null || ProjectFunctions.FullStageList == null || !stagesLoaded)
                {
                    return;
                }
                ProjectStages selectedStage = ProjectFunctions.GetStageByID(currentTimeline.StageID); // Gets it from FullStageList, so it is picked up
                if (selectedStage != null)
                {
                    int selectedIndex = ProjectFunctions.FullStageList.IndexOf(selectedStage);
                    if (selectedIndex >= 0)
                    {
                        StageCombo.SelectedIndex = ProjectFunctions.FullStageList.IndexOf(selectedStage);
                    }
                }
            }
            catch (Exception generalException) { MessageFunctions.Error("Error selecting current project stage", generalException); }
        }
 private void StageCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         if (StageCombo.SelectedItem != null)
         {
             ProjectStages stageFilter = StageCombo.SelectedItem as ProjectStages;
             if (stageFilter != null)
             {
                 Globals.SelectedStage = stageFilter;
                 stageNumber           = stageFilter.StageNumber;
             }
             else
             {
                 Globals.SelectedStage = Globals.AllStages;
                 stageNumber           = -1;
             }
             refreshHistoryDataGrid();
         }
     }
     catch (Exception generalException) { MessageFunctions.Error("Error handling stage selection", generalException); }
 }