public ActionResult Indicator2() { AppDropDownsService ServiceDDL = new AppDropDownsService(); IEnumerable <ProgramAreaList> ProgramArea = ServiceDDL.GetProgramAreaList(); IEnumerable <ProposalStatusList> ProposalStatus = ServiceDDL.GetProposalStatusList(); IEnumerable <GrantTypeList> GrantType = ServiceDDL.GetGrantTypeList(); IEnumerable <CompetitionCodeList> CompletionCode = ServiceDDL.GetCompetitionCodeList(); IEnumerable <ProposalStatusList> Status = ServiceDDL.GetProposalStatusList(); IEnumerable <RegionList> Region = ServiceDDL.GetRegionList(); IEnumerable <IndicatorLabelContentCategory> IndicatorCategoryList = ServiceDDL.IndicatorLabelContentCategoryList(); ViewData["ProgramArea"] = ProgramArea; ViewData["ProposalStatus"] = ProposalStatus; ViewData["GrantType"] = GrantType; ViewData["CompletionCode"] = CompletionCode; ViewData["Status"] = Status; ViewData["Region"] = Region; ViewData["IndicatorCategoryList"] = IndicatorCategoryList; ViewData["results"] = null; return(View()); }
public ActionResult BudgetAnalysis() { AppDropDownsService ServiceDDL = new AppDropDownsService(); ViewData["CompletionCode"] = ServiceDDL.GetCompetitionCodeList(); ViewData["ProgramArea"] = ServiceDDL.GetProgramAreaList(); ViewData["GrantType"] = ServiceDDL.GetGrantTypeList(); ViewData["Status"] = ServiceDDL.GetProposalStatusList(); ViewData["results"] = null; ViewData["Region"] = ServiceDDL.GetRegionList(); return(View()); }
public ActionResult AppDropDowns() { ViewData["EventType"] = appddservice.GetEventTypeList(); ViewData["OrgLegalStatus"] = appddservice.GetLegalStatusList(); ViewData["GrantType"] = appddservice.GetGrantTypeList(); ViewData["ProgramArea"] = appddservice.GetProgramAreaList(); ViewData["CompetitionCode"] = appddservice.GetCompetitionCodeList(); ViewData["ProposalStatus"] = appddservice.GetProposalStatusList(); ViewData["SSPRoles"] = staffservice.GetALLSSPRoles(); ViewData["Regions"] = appddservice.GetRegionList(); ViewData["GetBudgetCatList"] = appddservice.GetCatList(); ViewData["ProjectLocationList"] = appddservice.GetProjectLocationList(); return(View()); }
public ActionResult Indicator(FinReportFilter frepf, int?ID, List <String> Area, List <String> gtype, List <String> compete, List <String> status, List <String> oblast, List <String> period, List <String> amount, List <String> location) { AppDropDownsService ServiceDDL = new AppDropDownsService(); IEnumerable <ProgramAreaList> ProgramArea = ServiceDDL.GetProgramAreaList(); IEnumerable <ProposalStatusList> ProposalStatus = ServiceDDL.GetProposalStatusList(); IEnumerable <GrantTypeList> GrantType = ServiceDDL.GetGrantTypeList(); IEnumerable <CompetitionCodeList> CompletionCode = ServiceDDL.GetCompetitionCodeList(); IEnumerable <ProposalStatusList> Status = ServiceDDL.GetProposalStatusList(); IEnumerable <RegionList> Region = ServiceDDL.GetRegionList(); ViewData["ProgramArea"] = ProgramArea; ViewData["ProposalStatus"] = ProposalStatus; ViewData["GrantType"] = GrantType; ViewData["CompletionCode"] = CompletionCode; ViewData["Status"] = Status; ViewData["Region"] = Region; if (frepf != null) { LReportsRepository rep = new LReportsRepository(); // IQueryable<Project> prj = rep.GetResults(frepf); IQueryable <Project> prj = rep.GetResults2(frepf, ID, Area, gtype, compete, status, oblast, period, amount, location); List <Project> prjList = prj.ToList(); if (prj != null) { // List<LabelByCount> test = rep.IndicatorByBaseline(prj, 2); ViewData["report31"] = rep.IndicatorByBaseline(prj); ViewData["report32"] = rep.IndicatorByBenchmark(prj); ViewData["report33"] = rep.IndicatorByFinal(prj); ViewData["prj"] = prj; } return(View(frepf)); } else { return(View()); } }
public ActionResult Indicator() { AppDropDownsService ServiceDDL = new AppDropDownsService(); IEnumerable <ProgramAreaList> ProgramArea = ServiceDDL.GetProgramAreaList(); // IEnumerable<ProposalStatusList> ProposalStatus = ServiceDDL.GetProposalStatusList(); IEnumerable <GrantTypeList> GrantType = ServiceDDL.GetGrantTypeList(); IEnumerable <CompetitionCodeList> CompletionCode = ServiceDDL.GetCompetitionCodeList(); IEnumerable <ProposalStatusList> Status = ServiceDDL.GetProposalStatusList(); IEnumerable <RegionList> Region = ServiceDDL.GetRegionList(); ViewData["ProgramArea"] = ProgramArea; // ViewData["ProposalStatus"] = ProposalStatus; ViewData["GrantType"] = GrantType; ViewData["CompletionCode"] = CompletionCode; ViewData["Status"] = Status; ViewData["Region"] = Region; return(View()); }
public ActionResult Indicator2(FinReportFilter frepf, int?ID, List <String> Area, List <String> gtype, List <String> compete, List <String> status, List <String> oblast, List <String> period, List <String> amount, List <String> indicatorcategory) { LReportsRepository rep = new LReportsRepository(); //IndRepHolder inp = new IndRepHolder(); // inp.Column = "Akmola obl"; // inp.Row ="ECD"; // inp.Val = 1; AppDropDownsService ServiceDDL = new AppDropDownsService(); #region drops IEnumerable <ProgramAreaList> ProgramArea = ServiceDDL.GetProgramAreaList(); IEnumerable <ProposalStatusList> ProposalStatus = ServiceDDL.GetProposalStatusList(); IEnumerable <GrantTypeList> GrantType = ServiceDDL.GetGrantTypeList(); IEnumerable <CompetitionCodeList> CompletionCode = ServiceDDL.GetCompetitionCodeList(); IEnumerable <ProposalStatusList> Status = ServiceDDL.GetProposalStatusList(); IEnumerable <RegionList> Region = ServiceDDL.GetRegionList(); IEnumerable <IndicatorLabelContentCategory> IndicatorCategoryList = ServiceDDL.IndicatorLabelContentCategoryList(); ViewData["ProgramArea"] = ProgramArea; //take only ECD and Youth. IEnumerable <ProgramAreaList> ProgramArea2 = ProgramArea.Where(s => s.ProgramAreaText == "ECD" || s.ProgramAreaText == "Youth"); ViewData["ProgramArea2"] = ProgramArea2; ViewData["ProposalStatus"] = ProposalStatus; ViewData["GrantType"] = GrantType; ViewData["CompletionCode"] = CompletionCode; ViewData["Status"] = Status; ViewData["Region"] = Region; ViewData["IndicatorCategoryList"] = IndicatorCategoryList; #endregion //if (frepf != null) //{ IQueryable <Project> prj = rep.GetResults3(frepf, ID, Area, gtype, compete, status, period, oblast, amount); //1. gets resulting project list after filtering. List <Project> prjList = prj.ToList(); ViewData["prj"] = prj; // List<IndRepHolder> zz = rep.IndicatorsByRoundArea(prj); List <IndRepHolder> zz = rep.IndicatorsByCompetitionContentCategory(prj); List <IndRepHolder> zz2 = rep.IndicatorsByRegionContentCategory(prj); ViewData["LIndRep"] = zz; ViewData["LIndRep2"] = zz2; if (prjList != null) { //2. generates/calculates VS amounts. Dictionary <IndicatorContainerType, Dictionary <IndicatorLabelContentCategory, List <IndicatorRepContainer> > > results = IndicatorReportCore( prj, frepf, Area, gtype, compete, status, oblast, period, amount, indicatorcategory); ViewData["results2"] = results; } //add List Filters. //enable Report View enabled if not null. if (frepf.isIndicator != null && frepf.isIndicator.Value == true) { frepf.isIndicator = true; } else { frepf.isIndicator = false; } if (Area != null) { frepf.IsArea = true; } if (gtype != null) { frepf.IsGrantType = true; } if (compete != null) { frepf.IsCompetitionCode = true; } if (status != null) { frepf.IsStatus = true; } if (period != null) { frepf.IsPeriod = true; } //===== return(View(frepf)); }
public Dictionary <IndicatorContainerType, Dictionary <IndicatorLabelContentCategory, List <IndicatorRepContainer> > > IndicatorReportCore( IQueryable <Project> prjList, FinReportFilter frepf, List <String> Area, List <String> gtype, List <String> compete, List <String> status, List <String> oblast, List <String> period, List <String> amount, List <String> indicatorcategory) { AppDropDownsService ServiceDDL = new AppDropDownsService(); List <IndicatorLabelContentCategory> IndContCats = new List <IndicatorLabelContentCategory>(); var regions = new List <RegionList>(); var areas = new List <ProgramAreaList>(); var statusList = new List <ProposalStatusList>(); var gtypeList = new List <GrantTypeList>(); var competeList = new List <CompetitionCodeList>(); //create IndicatorContentCategory List to be passed. if (indicatorcategory != null) { foreach (string s in indicatorcategory) { IndContCats.Add(ServiceDDL.GetIndicatorLabelContentCategory(Convert.ToInt32(s))); } } var LLVsContainer = new Dictionary <IndicatorContainerType, Dictionary <IndicatorLabelContentCategory, List <IndicatorRepContainer> > >(); // Dictionary<ContainerType, List<VsContainer>> LLVsContainer = null; if (oblast != null && oblast.Count > 0 && indicatorcategory != null && indicatorcategory.Count > 0) { //create RegionsList List to be passed. foreach (string s in oblast) { if (!s.Contains("All")) //skip ALL. { regions.Add(ServiceDDL.GetRegionList().FirstOrDefault(w => w.DDID == Convert.ToInt32(s))); } } var result = FillContainer(prjList, frepf, IndicatorContainerType.OblastVsIndicatorLabelCategory, IndContCats, regions, null, null, null); LLVsContainer.Add(IndicatorContainerType.OblastVsIndicatorLabelCategory, result); } if (Area != null && Area.Count > 0 && indicatorcategory != null && indicatorcategory.Count > 0) { foreach (string s in Area) { if (!s.Contains("All")) //skip ALL. { areas.Add(ServiceDDL.GetProgramAreaList().FirstOrDefault(w => w.ProgramAreaCodeID == Convert.ToInt32(s))); } } var result = FillContainer(prjList, frepf, IndicatorContainerType.AreaVsIndicatorLabelCategory, IndContCats, null, areas, null, null); LLVsContainer.Add(IndicatorContainerType.AreaVsIndicatorLabelCategory, result); } if (gtype != null && gtype.Count > 0 && indicatorcategory != null && indicatorcategory.Count > 0) { foreach (string s in gtype) { if (!s.Contains("All")) //skip ALL. { gtypeList.Add(ServiceDDL.GetGrantTypeList().FirstOrDefault(w => w.GrantTypeCodeID == Convert.ToInt32(s))); } } var result = FillContainer(prjList, frepf, IndicatorContainerType.TypeVsIndicatorLabelCategory, IndContCats, null, null, gtypeList, null); LLVsContainer.Add(IndicatorContainerType.TypeVsIndicatorLabelCategory, result); } if (compete != null && compete.Count > 0 && indicatorcategory != null && indicatorcategory.Count > 0) { foreach (string s in compete) { if (!s.Contains("All")) //skip ALL. { competeList.Add(ServiceDDL.GetCompetitionCodeList().FirstOrDefault(w => w.CompetitionCodeID == Convert.ToInt32(s))); } } var result = FillContainer(prjList, frepf, IndicatorContainerType.RoundVsIndicatorLabelCategory, IndContCats, null, null, null, competeList); LLVsContainer.Add(IndicatorContainerType.RoundVsIndicatorLabelCategory, result); } bool areaVsRound = false; //more coming here. return(LLVsContainer); }
public ActionResult outcome(FinReportFilter frepf, int?ID, List <String> Area, List <String> gtype, List <String> compete, List <String> status, List <String> oblast, List <String> period, List <String> amount, List <String> indicatorcategory) { AppDropDownsService ServiceDDL = new AppDropDownsService(); #region drops IEnumerable <ProgramAreaList> ProgramArea = ServiceDDL.GetProgramAreaList(); IEnumerable <ProposalStatusList> ProposalStatus = ServiceDDL.GetProposalStatusList(); IEnumerable <GrantTypeList> GrantType = ServiceDDL.GetGrantTypeList(); IEnumerable <CompetitionCodeList> CompletionCode = ServiceDDL.GetCompetitionCodeList(); IEnumerable <ProposalStatusList> Status = ServiceDDL.GetProposalStatusList(); IEnumerable <RegionList> Region = ServiceDDL.GetRegionList(); IEnumerable <IndicatorLabelContentCategory> IndicatorCategoryList = ServiceDDL.IndicatorLabelContentCategoryList(); ViewData["ProgramArea"] = ProgramArea; ViewData["ProposalStatus"] = ProposalStatus; ViewData["GrantType"] = GrantType; ViewData["CompletionCode"] = CompletionCode; ViewData["Status"] = Status; ViewData["Region"] = Region; ViewData["IndicatorCategoryList"] = IndicatorCategoryList; #endregion //if (frepf != null) //{ LReportsRepository rep = new LReportsRepository(); IQueryable <Project> prj = rep.GetResults3(frepf, ID, Area, gtype, compete, status, period, oblast, amount); //1. gets resulting project list after filtering. List <Project> prjList = prj.ToList(); ViewData["prj"] = prj; //add List Filters. //enable Report View enabled if not null. if (Area != null) { frepf.IsArea = true; } if (gtype != null) { frepf.IsGrantType = true; } if (compete != null) { frepf.IsCompetitionCode = true; } if (status != null) { frepf.IsStatus = true; } if (period != null) { frepf.IsPeriod = true; } //===== return(View(frepf)); }
public ActionResult BudgetAnalysis(FinReportFilter frepf, int?ID, List <String> Area, List <String> gtype, List <String> compete, List <String> status, List <String> period, List <String> amount, List <String> oblast) { AppDropDownsService ServiceDDL = new AppDropDownsService(); ViewData["CompletionCode"] = ServiceDDL.GetCompetitionCodeList(); ViewData["ProgramArea"] = ServiceDDL.GetProgramAreaList(); ViewData["GrantType"] = ServiceDDL.GetGrantTypeList(); ViewData["Status"] = ServiceDDL.GetProposalStatusList(); ViewData["Region"] = ServiceDDL.GetRegionList(); //if (frepf != null) //{ LReportsRepository rep = new LReportsRepository(); IQueryable <Project> prj = rep.GetResults3(frepf, ID, Area, gtype, compete, status, period, oblast, amount); //1. gets resulting project list after filtering. List <Project> prjList = prj.ToList(); ViewData["prj"] = prj; if (prjList != null) { //2. generates/calculates VS amounts. if (!frepf.isListOnly.Value) { Dictionary <ContainerType, Dictionary <AmountTypes, List <VsContainer> > > results = FinReportCore(prj, frepf, Area, gtype, compete, status, period, oblast); ViewData["results2"] = results; } } //add List Filters. //enable Report View enabled if not null. if (Area != null) { frepf.IsArea = true; } if (gtype != null) { frepf.IsGrantType = true; } if (compete != null) { frepf.IsCompetitionCode = true; } if (status != null) { frepf.IsStatus = true; } if (period != null) { frepf.IsPeriod = true; } if (oblast != null) { frepf.isRegion = true; } //===== return(View(frepf)); }
public ActionResult Index(FinReportFilter frepf, int?ID, List <String> Area, List <String> gtype, List <String> compete, List <String> status, List <String> period, List <String> amount, List <String> oblast, List <String> lfIndicators) { AppDropDownsService ServiceDDL = new AppDropDownsService(); ViewData["CompletionCode"] = ServiceDDL.GetCompetitionCodeList(); ViewData["ProgramArea"] = ServiceDDL.GetProgramAreaList(); ViewData["GrantType"] = ServiceDDL.GetGrantTypeList(); ViewData["Status"] = ServiceDDL.GetProposalStatusList(); ViewData["Region"] = ServiceDDL.GetRegionList(); ViewData["BudgetCatList"] = ServiceDDL.GetCatList(); ViewData["LfIndicatorList"] = ServiceDDL.GetLfIndicatorList(); LReportsRepository rep = new LReportsRepository(); IQueryable <Project> prj = rep.GetResults3(frepf, ID, Area, gtype, compete, status, period, oblast, amount, lfIndicators); //1. gets resulting project list after filtering. List <Project> prjList = prj.ToList(); ViewData["prj"] = prj; if (prjList != null) { var query = prjList .GroupBy(g => new //GROUP BY GrantType, ProgramArea Field1, Field2 and SUM AmtRequested. { g.LFIndicator.LFIndicatorID, }) .Select(group => new VsContainer() //Select all Grouped into VersusContainer. { ProjId = group.Select(i => i.ProjectID).ToList(), Field1 = group.Key.LFIndicatorID, iAmount = prjList.Count(), dAmount = group.Select(i => i.ProjectID).Count(), Field1Title = "# of grants with " + group.Select(i => i.LFIndicator.LFIndicatorList.CodeText).FirstOrDefault() }); List <VsContainer> vsc = query.ToList(); //test. ViewData["vsc"] = vsc; } //add List Filters. //enable Report View enabled if not null. if (lfIndicators != null) { frepf.isLFIndicator = true; } if (Area != null) { frepf.IsArea = true; } if (gtype != null) { frepf.IsGrantType = true; } if (compete != null) { frepf.IsCompetitionCode = true; } if (status != null) { frepf.IsStatus = true; } if (period != null) { frepf.IsPeriod = true; } if (oblast != null) { frepf.isRegion = true; } //===== return(View(frepf)); }
public ActionResult test() { // var View = new Dictionary<ProgramAreaID, Dictionary<RegionID, numberOfItems>>(); var MView = new Dictionary <FirstVs, Dictionary <int, numberOfItems> >(); ProjectService prj = new ProjectService(); ProjectEventService evnts = new ProjectEventService(); AppDropDownsService appDropDown = new AppDropDownsService(); int?id = 1; IEnumerable <ProjectEvent> projevnts = evnts.GetProjectEventList(id.Value); int sitevisits = 0; IEnumerable <Project> projects = prj.getAllProjects().Where(p => p.CompetitionCode != null && p.ProgramArea != null); //int sitevisits = projevnts.Count(projevnt => projevnt.EventType.EventTypeID == 1 || projevnt.EventType.EventTypeID == 2); // if (projevnt.EventType.EventTypeName == "Site Visit" || projevnt.EventType.EventTypeName == "Site visit") // projevnt.EventType.EventTypeID == 1 || projevnt.EventType.EventTypeID == 2 var projSiteVisits = new Dictionary <Project, int>(); var MView2 = new Dictionary <int, List <VsContainer> >(); //==========1=========== if (projects != null) { var query = projects .GroupBy(g => new //GROUP BY GrantType, ProgramArea Field1, Field2 and SUM AmtRequested. { g.CompetitionCode.CompetCodeID, g.ProgramArea.ProgramAreaCodeID }) .Select(group => new VsContainer() //Select all Grouped into VersusContainer. { ProjId = group.Select(i => i.ProjectID).ToList(), Field1 = group.Key.CompetCodeID.Value, Field2 = group.Key.ProgramAreaCodeID.Value, iAmount = group.Sum(c => c.ProjectEvents.Count(projevnt => projevnt.EventType.EventTypeID == 1 || projevnt.EventType.EventTypeID == 2)), dAmount = group.Select(i => i.ProjectID).Count(), Field1Title = group.Select(i => i.CompetitionCode.CompetitionCodeList.CodeText).FirstOrDefault(), Field2Title = group.Select(i => i.ProgramArea.ProgramAreaList.ProgramAreaText).FirstOrDefault() }); List <VsContainer> vsc = query.ToList(); //test. MView2.Add(1, vsc); } // var View = new Dictionary<ProgramAreaID, Dictionary<CompCodeID, numberOfItems>>(); //======var MView = new Dictionary<FirstVs, Dictionary<int, numberOfItems>>();========================= //==========2=========== IEnumerable <Project> projects2 = prj.getAllProjects().Where(p => p.Organization.Addresses.FirstOrDefault().Region != null && p.ProgramArea != null); if (projects != null) { var query = projects2 .GroupBy(g => new //GROUP BY GrantType, ProgramArea Field1, Field2 and SUM AmtRequested. { g.Organization.Addresses.FirstOrDefault().DDIDRegion, g.ProgramArea.ProgramAreaCodeID }) .Select(group => new VsContainer() //Select all Grouped into VersusContainer. { ProjId = group.Select(i => i.ProjectID).ToList(), Field1 = group.Key.DDIDRegion.Value, Field2 = group.Key.ProgramAreaCodeID.Value, iAmount = group.Sum(c => c.ProjectEvents.Count(projevnt => projevnt.EventType.EventTypeID == 1 || projevnt.EventType.EventTypeID == 2)), dAmount = group.Select(i => i.ProjectID).Count(), Field1Title = group.Select(i => i.Organization.Addresses.FirstOrDefault().RegionList.DDNAME).FirstOrDefault(), Field2Title = group.Select(i => i.ProgramArea.ProgramAreaList.ProgramAreaText).FirstOrDefault() }); List <VsContainer> vsc = query.ToList(); //test. MView2.Add(2, vsc); } //=============================== //foreach (var p in projects) //{ // sitevisits += p.ProjectEvents.Count(projevnt => projevnt.EventType.EventTypeID == 1 || projevnt.EventType.EventTypeID == 2); // projSiteVisits.Add(p, sitevisits); // sitevisits = 0; //} //IEnumerable<RegionList> regions = appDropDown.GetRegionList(); //foreach (RegionList reg in regions) //{ //} //foreach (var v in View) //{ // foreach(var vl in v.Value) // { // int hello = vl.Value.numOfgrant; // } //} //AppDropDownsService ServiceDDL = new AppDropDownsService(); //var SubView = new Dictionary<int, numberOfItems>(); //var SubView2 = new Dictionary<int, numberOfItems>(); //// ============== //var number1 = new numberOfItems(); //number1.numOfgrant = 35; //number1.numOfvisits = 40; //SubView.Add(1, number1); //var number2 = new numberOfItems(); //number2.numOfgrant = 15; //number2.numOfvisits = 10; //SubView.Add(4, number2); //var number3 = new numberOfItems(); //number3.numOfgrant = 25; //number3.numOfvisits = 60; //SubView.Add(8, number3); //var number4 = new numberOfItems(); //number4.numOfgrant = 125; //number4.numOfvisits = 60; //var number5 = new numberOfItems(); //number5.numOfgrant = 125; //number5.numOfvisits = 60; //SubView2.Add(3, number4); //SubView2.Add(2, number5); //FirstVs fv = new FirstVs(); //fv.id = 1; //fv.title = "ECD"; //MView.Add(fv, SubView); //FirstVs fv2 = new FirstVs(); //fv2.id = 2; //fv2.title = "Youth"; //MView.Add(fv2, SubView2); AppDropDownsService ServiceDDL = new AppDropDownsService(); ViewData["MView"] = MView; ViewData["MView2"] = MView2; ViewData["Region"] = ServiceDDL.GetRegionList(); ViewData["CompletionCode"] = ServiceDDL.GetCompetitionCodeList(); ViewData["ProgramArea"] = ServiceDDL.GetProgramAreaList(); return(View()); }