Beispiel #1
0
        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;
        }
Beispiel #2
0
        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;
        }
Beispiel #3
0
 public string RestartSession(DPLookupItem dp)
 {
     //Sessions.DP = null;
     Sessions.Clear();
     return "";
 }
Beispiel #4
0
 public string CheckSession(DPLookupItem dp)
 {
     Sessions.DP = dp;
     return Sessions.CurrentStage;
 }