public ProjectMapModelMinified GetProjectsToMap(ProjectFieldMapModel GeneralPreference)
{
Sessions.GeneralPreferences = GeneralPreference ?? Sessions.GeneralPreferences ?? GetGeneralPreferences();
if (Sessions.ProjectMapModel.MatchedProjects.IsEmpty() && Sessions.ProjectMapModel.NewProjectsToAddInAims.IsEmpty())
{
Sessions.activitiesContainer = aimsDbIatiDAL.GetMappedActivities(Sessions.DP.ID);
var heirarchyModel = CalculateHierarchyMatching();
var filterBDModel = SubmitHierarchy(heirarchyModel);
var iOrgs = GetAllImplementingOrg(filterBDModel);
var relevantActivities = FilterDP(iOrgs.Orgs);
var projectMapModel = SubmitActivities(relevantActivities);
}
ImportLogic.SetFieldMappingPreferences(Sessions.ProjectMapModel.MatchedProjects, Sessions.GeneralPreferences);
Sessions.CurrentStage = Stage.ReviewAdjustment;
var returnResult = new ProjectMapModel
{
MatchedProjects = Sessions.ProjectMapModel.MatchedProjects,
IatiActivitiesNotInAims = null,
AimsProjectsNotInIati = null,
NewProjectsToAddInAims = Sessions.ProjectMapModel.NewProjectsToAddInAims,
ProjectsOwnedByOther = null
};
Sessions.ProjectsToMap = returnResult;
return ToMinifiedProjectMapModel(returnResult);
}