本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}