Exemplo n.º 1
0
            public StateTransition
            (
                ProjectStages thisStage,
                ProjectStages theNextStage,
                TeamMemberData.UserTypes eMemberTypeWithEditToken,
                string strDisplayString,
                string strInstructions,
                List <AllowablePreviousStateWithConditions> lstAllowableBackwardsStages,
                bool bRequiresBiblicalStory,
                bool bRequiresNonBiblicalStory
            )
            {
                CurrentStage            = thisStage;
                NextState               = theNextStage;
                MemberTypeWithEditToken = eMemberTypeWithEditToken;
                StageDisplayString      = strDisplayString;
                StageInstructions       = strInstructions;
                AllowableBackwardsTransitions.AddRange(lstAllowableBackwardsStages);
                string strMethodName = thisStage.ToString().Substring(1);

#if !DataDllBuild
                IsReadyForTransition = (CheckEndOfStateTransition.CheckForValidEndOfState)Delegate.CreateDelegate(
                    typeof(CheckEndOfStateTransition.CheckForValidEndOfState),
                    typeof(CheckEndOfStateTransition), strMethodName);
#endif
                RequiresBiblicalStory    = bRequiresBiblicalStory;
                RequiresNonBiblicalStory = bRequiresNonBiblicalStory;
            }
Exemplo n.º 2
0
        public bool IsTerminalTransition(ProjectStages eNextStage)
        {
            StateTransition stThis = stateTransitions[ProjectStage];
            StateTransition stNext = stateTransitions[eNextStage];

            return(stThis.MemberTypeWithEditToken != stNext.MemberTypeWithEditToken);
        }
Exemplo n.º 3
0
 public StoryStageLogic(string strProjectStage, bool bHasIndependentConsultant)
 {
     ProjectStage = GetProjectStageFromString(strProjectStage);
     if ((stateTransitions == null) ||
         (stateTransitions.RewroteCitAsIndependentConsultant != bHasIndependentConsultant))
     {
         stateTransitions = new StateTransitions(bHasIndependentConsultant);
     }
 }
Exemplo n.º 4
0
        private void RegisterSelectedTask()
        {
            Messenger.Default.Register <BaseTask>(this, "TaskSelected", task =>
            {
                if (task == null)
                {
                    return;
                }

                selectedProject = Projects.FirstOrDefault(x => x.ID == task.Project.ID);
                SetControlsVisibility();

                RaisePropertyChanged(() => SelectedProject);

                if (task.Project.ProjectType == Model.Domain.ProjectType.Engineer)
                {
                    ProjectTask pt = task as ProjectTask;

                    if (pt.ProjectStage != null)
                    {
                        SelectedProjectStage = ProjectStages.FirstOrDefault(x => x.ID == pt.ProjectStage.ID);
                    }

                    if (pt.Workset.Activities.ElementAt(0) != null)
                    {
                        SelectedFirstActivity = FirstActivities.FirstOrDefault(x => x.ID == pt.Workset.Activities.ElementAt(0).ID);
                    }

                    if (pt.Workset.Activities.ElementAt(1) != null)
                    {
                        SelectedSecondActivity = SecondActivities.FirstOrDefault(x => x.ID == pt.Workset.Activities.ElementAt(1).ID);
                    }

                    if (pt.Workset.Activities.ElementAt(2) != null)
                    {
                        SelectedThirdActivity = ThirdActivities.FirstOrDefault(x => x.ID == pt.Workset.Activities.ElementAt(2).ID);
                    }

                    if (pt.Workset.Activities.ElementAt(3) != null)
                    {
                        SelectedSoftware = Softwares.FirstOrDefault(x => x.ID == pt.Workset.Activities.ElementAt(3).ID);
                    }

                    IsAddCost = pt.IsAddCost;
                    IsMistake = pt.IsMistake;

                    RaisePropertyChanged(() => SelectedProjectStage);
                    RaisePropertyChanged(() => SelectedFirstActivity);
                    RaisePropertyChanged(() => SelectedSecondActivity);
                    RaisePropertyChanged(() => SelectedThirdActivity);
                    RaisePropertyChanged(() => SelectedSoftware);
                    RaisePropertyChanged(() => IsAddCost);
                    RaisePropertyChanged(() => IsMistake);
                }
            });
        }
Exemplo n.º 5
0
 public bool IsTransitionValid(ProjectStages eToStage)
 {
     foreach (AllowablePreviousStateWithConditions aps in AllowableBackwardsTransitions)
     {
         if (aps.ProjectStage == eToStage)
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 6
0
        public StoryStageLogic(ProjectSettings projSettings)
        {
            System.Diagnostics.Debug.Assert(projSettings.Vernacular.HasData ||
                                            projSettings.NationalBT.HasData ||
                                            projSettings.InternationalBT.HasData);

            // the first state is either eProjFacTypeVernacular or eProjFacTypeNationalBT or eProjFacTypeInternationalBT
            //  (can't have a separate EngBTr if there's no Vernacular or National BT)
            ProjectStage = (projSettings.Vernacular.HasData) ? ProjectStages.eProjFacTypeVernacular :
                           (projSettings.NationalBT.HasData) ? ProjectStages.eProjFacTypeNationalBT : ProjectStages.eProjFacTypeInternationalBT;

            System.Diagnostics.Debug.Assert(stateTransitions != null);
        }
        public ActionResult UpdateLaborInfo(List <StageModels.StageDetails> Data)
        {
            if (Data != null && Data.Any())
            {
                var psd = Data.FirstOrDefault();

                var q = db.ProjectItemPricing.Where(p => p.ItemID == psd.ItemID).FirstOrDefault();
                db.UpdateProjectItemPricing(psd.ItemID, q.UnitCost, q.UnitPrice, psd.UnitHours, q.SalesTaxID, q.Margin, q.Markup, q.SalesTaxed, q.LaborTaxed, q.CostTaxed, q.ProjectCostCodeID);
                db.SaveChanges();
                foreach (var item in Data)
                {
                    var isNew = item.ProjectStageID == 0;

                    var ProjectStage = new ProjectStages()
                    {
                        ProjectID             = item.ProjectID,
                        ProjectStageID        = item.ProjectStageID ?? 0,
                        StageSubID            = item.SubStageID ?? 0,
                        StageLaborCost        = item.CostPerHour,
                        StageLaborPrice       = item.PricePerHour,
                        StageMasterID         = item.StageMasterID,
                        StageLaborFactor      = item.Percent / 100,
                        StageDifficultyFactor = 1
                    };

                    var psid = repo.SaveProjectStageDetails(ProjectStage);
                }

                int projectID = 0, stageID = 0;
                if (psd != null)
                {
                    projectID = psd.ProjectID;
                    stageID   = (int)(psd.ProjectStageID);
                    return(GetStageDetails((int)psd.ItemID, projectID, stageID));
                }
                else
                {
                    return(Json(new { status = "SOME_ERROR", }));
                }
            }
            else
            {
                return(Json(new { status = "NOT_SAVED", }));
            }
        }
        public ActionResult SaveProjectStageDetails(List <StageModels.StageDetails> Data)
        {
            if (Data != null && Data.Any())
            {
                foreach (var item in Data)
                {
                    var isNew = item.ProjectStageID == 0;

                    var ProjectStage = new ProjectStages()
                    {
                        ProjectID             = item.ProjectID,
                        ProjectStageID        = item.ProjectStageID ?? 0,
                        StageSubID            = item.SubStageID ?? 0,
                        StageLaborCost        = item.CostPerHour,
                        StageLaborPrice       = item.PricePerHour,
                        StageMasterID         = item.StageMasterID,
                        StageLaborFactor      = item.Percent / 100,
                        StageDifficultyFactor = 1
                    };

                    var psid = repo.SaveProjectStageDetails(ProjectStage);
                }

                int projectID = 0, stageID = 0;
                var psd = Data.FirstOrDefault();
                if (psd != null)
                {
                    projectID = psd.ProjectID;
                    stageID   = psd.StageMasterID;
                    return(GetStageDetails(projectID, stageID));
                }
                else
                {
                    return(Json(new { status = "SOME_ERROR", }));
                }
            }
            else
            {
                return(Json(new { status = "NOT_SAVED", }));
            }
        }
Exemplo n.º 9
0
 public StoryStageLogic(StoryStageLogic rhs)
 {
     ProjectStage = rhs.ProjectStage;
     System.Diagnostics.Debug.Assert(stateTransitions != null);
 }