public DashboardModel GetDashboardData(DPLookupItem dp) { if (dp == null) return null; //Sessions.Clear(); string dpId = dp.ID; //Sessions.DP.ID = dpId; Sessions.DP = dp; var dashboardModel = new DashboardModel(); dashboardModel.LastDownloadDate = aimsDbIatiDAL.GetLastDownloadDate(dpId); dashboardModel.NewActivityCount = aimsDbIatiDAL.GetNewActivityCount(dpId); dashboardModel.MappedActivityCount = aimsDbIatiDAL.GetMappedActivityCount(dpId); dashboardModel.AssignedActivityCount = aimsDbIatiDAL.GetAssignedActivityCount(dpId); dashboardModel.TotalActivityCount = aimsDbIatiDAL.GetTotalActivityCount(dpId); dashboardModel.DelegatedActivities = aimsDbIatiDAL.GetDelegatedActivities(dpId); dashboardModel.DelegatedActivities.ForEach(f => f.AssignedOrgName = Sessions.FundSources?.Find(k => k.IATICode == f.AssignedOrgId)?.Name); #region trust fund and cofinance projects Sessions.CFnTFModel = aimsDbIatiDAL.GetAssignActivities(dpId, true); Sessions.CFnTFModel = new CFnTFController().SubmitAssignedActivities(Sessions.CFnTFModel.AssignedActivities); dashboardModel.CFnTFModel = Sessions.CFnTFModel; #endregion dashboardModel.addLogs(aimsDbIatiDAL.GetLastDayLogs(dpId)); return dashboardModel; }
public HeirarchyModel GetHierarchyData(DPLookupItem dp) { //bool isDPChanged = Sessions.activitiesContainer??.DP != dp?.ID; //if (isDPChanged) //{ dp = dp ?? Sessions.DP; Sessions.activitiesContainer = aimsDbIatiDAL.GetNotMappedActivities(Sessions.DP.ID); var returnResult = CalculateHierarchyMatching(); //} Sessions.heirarchyModel = returnResult; return returnResult; }
public string RestartSession(DPLookupItem dp) { //Sessions.DP = null; Sessions.Clear(); return ""; }
public string CheckSession(DPLookupItem dp) { Sessions.DP = dp; return Sessions.CurrentStage; }