public static StatusInfoList StatusFetchInfoList(int projectId) { ProjectUserRepository.AuthorizeProjectUser(projectId); return(StatusInfoList.FetchStatusInfoList( new StatusDataCriteria { ProjectId = projectId })); }
protected override void Execute(RuleContext context) { var target = (IStatus)context.Target; var users = StatusInfoList.FetchStatusInfoList(new StatusCriteria { Name = target.Name }); if (users.Count(row => row.StatusId != target.StatusId) != 0) { context.AddErrorResult("That status name is already in use."); } }
protected override void Execute(RuleContext context) { var target = (IStatus)context.Target; if (string.IsNullOrEmpty(target.Name)) { return; } var data = StatusInfoList.FetchStatusInfoList(new StatusDataCriteria { Name = target.Name, ProjectId = target.ProjectId }); if (data.Count(row => row.StatusId != target.StatusId) != 0) { context.AddErrorResult(string.Format("The status name '{0}' is already in use.", target.Name)); } }
public static StatusInfoList StatusFetchInfoList(StatusDataCriteria criteria) { return(StatusInfoList.FetchStatusInfoList(criteria)); }