public static List <ProjectRelevantCostTypeSimple> GetAllProjectRelevantCostTypesAsSimples(this ProjectUpdateBatch projectUpdateBatch, ProjectRelevantCostTypeGroup projectRelevantCostTypeGroup) { var costTypes = HttpRequestStorage.DatabaseEntities.CostTypes.ToList(); var projectRelevantCostTypes = projectUpdateBatch.GetRelevantCostTypesByCostTypeGroup(projectRelevantCostTypeGroup).Select(x => new ProjectRelevantCostTypeSimple(x)).ToList(); var currentRelevantCostTypeIDs = projectRelevantCostTypes.Select(x => x.CostTypeID).ToList(); projectRelevantCostTypes.AddRange( costTypes.Where(x => !currentRelevantCostTypeIDs.Contains(x.CostTypeID)) .Select((x, index) => new ProjectRelevantCostTypeSimple(-(index + 1), projectUpdateBatch.ProjectID, x.CostTypeID, x.CostTypeName))); return(projectRelevantCostTypes); }
public static List <ProjectRelevantCostTypeUpdate> GetBudgetsRelevantCostTypes(this ProjectUpdateBatch projectUpdateBatch) { return(projectUpdateBatch.GetRelevantCostTypesByCostTypeGroup(ProjectRelevantCostTypeGroup.Budgets)); }
public static List <ProjectRelevantCostTypeUpdate> GetExpendituresRelevantCostTypes(this ProjectUpdateBatch projectUpdateBatch) { return(projectUpdateBatch.GetRelevantCostTypesByCostTypeGroup(ProjectRelevantCostTypeGroup.Expenditures)); }