当前位置: 首页>>代码示例>>C#>>正文


C# IProjectService.GetProjectStep方法代码示例

本文整理汇总了C#中IProjectService.GetProjectStep方法的典型用法代码示例。如果您正苦于以下问题:C# IProjectService.GetProjectStep方法的具体用法?C# IProjectService.GetProjectStep怎么用?C# IProjectService.GetProjectStep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IProjectService的用法示例。


在下文中一共展示了IProjectService.GetProjectStep方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetProjectInfo

    public void SetProjectInfo(IProjectService projectService, int projectId, int projectStepId, string userId)
    {
        Check.Require(projectService != null, "projectService is required.");
        Check.Require(!string.IsNullOrWhiteSpace(userId), "userId is required.");

        this.Project = projectService.GetProject(projectId, userId);
        this.ProjectStep = projectService.GetProjectStep(projectStepId, userId);

        Check.Ensure(this.Project != null, "this.Project is required.");
        Check.Ensure(this.ProjectStep != null, "this.ProjectStep is required.");
        Check.Ensure(this.Project.Id == this.ProjectStep.Project.Id, Messages.ProjectStepMismatch);
    }
开发者ID:anlai,项目名称:2-SQUARE,代码行数:12,代码来源:ViewModelBase.cs

示例2: Create

        public static PRAUCEditViewModel Create(SquareContext db, IProjectService projectService, int projectStepId, int projectId, string userId, Risk risk = null)
        {
            var viewModel = new PRAUCEditViewModel()
                                {
                                    ProjectStep = projectService.GetProjectStep(projectStepId, userId),
                                    Project = projectService.GetProject(projectId, userId),
                                    RiskLevels = db.RiskLevels.OrderBy(a=>a.Order).ToList(),
                                    Risk = risk ?? new Risk()
                                };

            Check.Ensure(viewModel.Risk.Project.Id == viewModel.Project.Id, "Risk does not belong to the intended project.");

            return viewModel;
        }
开发者ID:anlai,项目名称:2-SQUARE,代码行数:14,代码来源:PRAUCEditViewModel.cs

示例3: Create

        public static ArtifactViewModel Create(SquareContext db, IProjectService projectService, Artifact artifact, int projectStepId, string loginId)
        {
            Check.Require(db != null, "Repository is required.");

            var projectStep = projectService.GetProjectStep(projectStepId, loginId);

            var viewModel = new ArtifactViewModel()
                                {
                                    ArtifactTypes = db.ArtifactTypes.Where(a=>a.SquareType.Id == projectStep.Step.SquareType.Id).ToList(),
                                    ProjectStep = projectStep,
                                    Artifact = artifact ?? new Artifact()
                                };

            return viewModel;
        }
开发者ID:anlai,项目名称:2-SQUARE,代码行数:15,代码来源:ArtifactViewModel.cs

示例4: Create

        public static RiskAssessmentViewModel Create(SquareContext db, IProjectService projectService, int projectStepId, int projectId, string userId)
        {
            Check.Require(db != null, "db is required.");

            var projectStep = projectService.GetProjectStep(projectStepId, userId);

            var viewModel = new RiskAssessmentViewModel()
            {
                ProjectStep = projectStep,
                Project = projectService.GetProject(projectId, userId),
                Risks = db.Risks.Include("Likelihood").Include("Impact").Include("Magnitude").Include("RiskLevel").Include("RiskRecommendations").Include("Damage")
                                .Where(a => a.Project.Id == projectStep.Project.Id
                                            && a.SquareType.Id == projectStep.Step.SquareType.Id)
                                            .OrderByDescending(a=>a.RiskLevel.Order).ToList()
            };

            return viewModel;
        }
开发者ID:anlai,项目名称:2-SQUARE,代码行数:18,代码来源:RiskAssessmentViewModel.cs

示例5: Create

        public static GoalViewModel Create(SquareContext db, IProjectService projectService, int projectStepId, string login, Goal goal = null)
        {
            Check.Require(db != null, "db is required.");

            var projectStep = projectService.GetProjectStep(projectStepId, login);

            if (goal == null)
            {
                goal = new Goal()
                           {
                               Project = projectStep.Project,
                               SquareType = projectStep.Step.SquareType
                           };
            }

            var viewModel = new GoalViewModel()
                                {
                                    ProjectStep = projectStep,
                                    Goal = goal,
                                    GoalTypes = db.GoalTypes.Include("SquareType").Where(a=>a.SquareType.Id == projectStep.Step.SquareType.Id).ToList()
                                };

            return viewModel;
        }
开发者ID:anlai,项目名称:2-SQUARE,代码行数:24,代码来源:GoalViewModel.cs

示例6: Create

        public static NIST800_30EditViewModel Create(SquareContext db, IProjectService projectService, int projectStepId, int projectId, string userId, Risk risk = null)
        {
            Check.Require(db != null, "db is required.");

            var viewModel = new NIST800_30EditViewModel()
                                {
                                    ProjectStep = projectService.GetProjectStep(projectStepId, userId),
                                    Project = projectService.GetProject(projectId, userId),
                                    RiskLevels = db.RiskLevels.OrderBy(a=>a.Order).ToList(),
                                    Impacts = db.Impacts.ToList(),
                                    Risk = risk ?? new Risk(),
                                    RiskLevelColor = string.Empty
                                };

            // figure out the risk level color, if not null
            if (risk != null)
            {
                viewModel.RiskLevelColor = risk.RiskLevel != null ? risk.RiskLevel.Color : string.Empty;
            }

            Check.Ensure(viewModel.Risk.Project.Id == viewModel.Project.Id, "Risk does not belong to the intended project.");

            return viewModel;
        }
开发者ID:anlai,项目名称:2-SQUARE,代码行数:24,代码来源:NIST800_30EditViewModel.cs


注:本文中的IProjectService.GetProjectStep方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。