} // #endregion // public static CommonTotals SiteTotals_Get() { CommonTotals entity = new CommonTotals(); using (var context = new ViewContext()) { //21-01-05 mparsons - note that the view (SiteTotalsSummaries) states to no longer use it!!!! Views.SiteTotalsSummary item = context.SiteTotalsSummaries .SingleOrDefault(s => s.Id == 1); if (item != null && item.Id > 0) { entity.TotalOrganizations = GetField(item.TotalOrgs); entity.TotalPartnerOrganizations = GetField(item.TotalDirectOrgs); entity.TotalOtherOrganizations = entity.TotalOrganizations - entity.TotalPartnerOrganizations; entity.TotalQAOrganizations = GetField(item.TotalQAOrgs); entity.TotalEnteredCredentials = GetField(item.TotalEnteredCredentials); entity.TotalPartnerCredentials = GetField(item.TotalPartnerCredentials); entity.TotalPendingCredentials = GetField(item.TotalPendingCredentials); entity.TotalDirectCredentials = GetField(item.TotalDirectCredentials); entity.TotalOtherOrganizations = entity.TotalPartnerCredentials - entity.TotalDirectCredentials; entity.TotalCredentialsAtCurrentCtdl = GetField(item.TotalCredentialsAtCurrentCtdl); entity.TotalCredentialsToBeUpdatedToCurrentCtdl = GetField(item.TotalCredentialsToBeUpdatedToCurrentCtdl); } } return(entity); }
public ActionResult ReportsV1() { CommonTotals vm = new CommonTotals(); vm = ReportServices.SiteTotals(); return(View("~/Views/Reports/ReportsV1.cshtml", vm)); }
public static CommonTotals SiteTotals() { var currentDate = DateTime.Now; currentDate = currentDate.AddDays(-2); CommonTotals totals = ActivityManager.SiteTotals_Get(); totals.MainEntityTotals = MainEntityTotals(); totals.CredentialHistory = HistoryReports(1); totals.OrganizationHistory = HistoryReports(2); totals.AssessmentHistory = HistoryReports(3); totals.LearningOpportunityHistory = ReportServices.HistoryReports(7); totals.EntityRegionTotals = CodesManager.GetEntityRegionTotals(1, "United States"); //vm.TotalDirectCredentials = list.FirstOrDefault( x => x.Id == 1 ).Totals; //vm.TotalOrganizations = list.FirstOrDefault( x => x.Id == 2 ).Totals; //vm.TotalQAOrganizations = list.FirstOrDefault( x => x.Id == 99 ).Totals; totals.AgentServiceTypes = new EnumerationServices().GetOrganizationServices(EnumerationType.MULTI_SELECT, false); totals.PropertiesTotals = PropertyTotals(); // //get totals from view: CodesProperty_Counts_ByEntity. // the latter has a union with Counts.SiteTotals totals.PropertiesTotalsByEntity = CodesManager.Property_GetTotalsByEntity(); totals.PropertiesTotals.AddRange(CodesManager.GetAllEntityStatistics()); totals.PropertiesTotals.AddRange(CodesManager.GetAllPathwayComponentStatistics()); //using counts.SiteTotals - so based on the above, this should not be needed??? //var allSiteTotals = CodesManager.CodeEntity_GetCountsSiteTotals(); //totals.SOC_Groups = allSiteTotals.Where( s => s.EntityTypeId == 1 && s.CategoryId == 11 ).ToList(); //totals.CredentialIndustry_Groups = allSiteTotals.Where( s => s.EntityTypeId == 1 && s.CategoryId == 10 ).ToList(); //totals.CredentialCIP_Groups = allSiteTotals.Where( s => s.EntityTypeId == 3 && s.CategoryId == 23 ).ToList(); //totals.OrgIndustry_Groups = allSiteTotals.Where( s => s.EntityTypeId == 2 && s.CategoryId == 10 ).ToList(); //totals.AssessmentCIP_Groups = allSiteTotals.Where( s => s.EntityTypeId == 3 && s.CategoryId == 23 ).ToList(); //totals.LoppCIP_Groups = allSiteTotals.Where( s => s.EntityTypeId == 7 && s.CategoryId == 23 ).ToList(); return(totals); }