コード例 #1
0
ファイル: DashboardController.cs プロジェクト: BD-IATI/edi
        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;
        }
コード例 #2
0
ファイル: IATIImportController.cs プロジェクト: BD-IATI/edi
        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;
        }
コード例 #3
0
ファイル: DashboardController.cs プロジェクト: BD-IATI/edi
 public string RestartSession(DPLookupItem dp)
 {
     //Sessions.DP = null;
     Sessions.Clear();
     return "";
 }
コード例 #4
0
ファイル: DashboardController.cs プロジェクト: BD-IATI/edi
 public string CheckSession(DPLookupItem dp)
 {
     Sessions.DP = dp;
     return Sessions.CurrentStage;
 }