public JsonResult ReturnCharts()
        {
            var yourStaffs   = (List <Student4WhoWhere>)TempData["Staffs"];
            var othersStaffs = (List <Student4WhoWhere>)TempData["OthersStaffs"];
            var appsToYou    = (List <RegularApplication>)TempData["StudentAppRecovereds"];

            TempData.Keep();

            var currentstaff            = appsToYou.Join(yourStaffs, x => x.Id, y => y.Id, (x, y) => x);
            List <PartnerChart2> pchart = new List <PartnerChart2>();
            PartnerChart2        pc1    = new PartnerChart2();

            pc1.Chart = new List <ChartObject2>();
            foreach (var item in WhoIsWhereLists.Applications)
            {
                ChartObject2 c2 = new ChartObject2();
                c2.DataFieild  = item.Type;
                c2.ValueField1 = currentstaff.Where(x => x.AppTypeId == item.Id).Count();
                c2.ValueField2 = appsToYou.Where(x => x.AppTypeId == item.Id).Count();
                pc1.Chart.Add(c2);
            }
            pchart.Add(pc1);

            PartnerChart2 pc2 = new PartnerChart2();

            pc2.Chart = new List <ChartObject2>();
            ChartObject2 Accepted = new ChartObject2
            {
                DataFieild  = "Accepted",
                ValueField1 = currentstaff.Where(x => x.Accepted == true).Count(),
                ValueField2 = appsToYou.Where(x => x.Accepted == true).Count()
            };
            ChartObject2 Rejected = new ChartObject2
            {
                DataFieild  = "Rejected",
                ValueField1 = currentstaff.Where(x => x.Accepted == false).Count(),
                ValueField2 = appsToYou.Where(x => x.Accepted == false).Count()
            };
            ChartObject2 NotDecided = new ChartObject2
            {
                DataFieild  = "Not Decided",
                ValueField1 = currentstaff.Where(x => x.Accepted == null).Count(),
                ValueField2 = appsToYou.Where(x => x.Accepted == null).Count()
            };

            pc2.Chart.Add(Accepted); pc2.Chart.Add(Rejected); pc2.Chart.Add(NotDecided);
            pchart.Add(pc2);
            #region Existing Staffs Chart
            var status1 = Lists4CV.Status.Where(x => x.Name == "Course Completed" ||
                                                x.Name == "Articled" ||
                                                x.Name == "Apprentice" ||
                                                x.Name == "Applied for Registration");

            var status2 = Lists4CV.Status.Where(x => x.Name != "Course Completed" &&
                                                x.Name != "Articled" &&
                                                x.Name != "Apprentice" &&
                                                x.Name != "Applied for Registration" &&
                                                x.Name != "Partner");
            PartnerChart2 pc = new PartnerChart2();
            pc.Chart = new List <ChartObject2>();
            foreach (var item in status1)
            {
                ChartObject2 c2 = new ChartObject2();
                c2.DataFieild  = item.Name;
                c2.ValueField1 = yourStaffs.Where(x => x.Status == item.Id.ToString()).Count();
                c2.ValueField2 = othersStaffs.Where(x => x.Status == item.Id.ToString()).Count();
                pc.Chart.Add(c2);
            }
            ChartObject2 c3 = new ChartObject2();
            c3.DataFieild = "Employee";
            foreach (var item in status2)
            {
                c3.ValueField1 += yourStaffs.Where(x => x.Status == item.Id.ToString()).Count();
                c3.ValueField2 += othersStaffs.Where(x => x.Status == item.Id.ToString()).Count();
            }
            pc.Chart.Add(c3);
            pchart.Add(pc);
            #endregion

            return(Json(pchart, JsonRequestBehavior.AllowGet));
        }
        public JsonResult ReturnCharts()
        {
            var students    = (List <Student4WhoWhere>)TempData["ManagableStudents"];
            var studentApps = (List <RegularApplication>)TempData["StudentAppRecovereds1"];
            var myApps      = (List <RegularApplication>)TempData["MyAppications"];

            TempData.Keep();
            List <PartnerChart2> pCharts = new List <PartnerChart2>();
            var status1 = Lists4CV.Status.Where(x => x.Name == "Articled" ||
                                                x.Name == "Apprentice" ||
                                                x.Name == "Applied for Registration");

            PartnerChart2 pc = new PartnerChart2();

            pc.Chart = new List <ChartObject2>();
            foreach (var item in status1)
            {
                ChartObject2 c2 = new ChartObject2();
                c2.DataFieild  = item.Name;
                c2.ValueField1 = students.Where(x => x.Status == item.Id.ToString()).Count();
                pc.Chart.Add(c2);
            }
            pCharts.Add(pc);
            PartnerChart2 pc1 = new PartnerChart2();

            pc1.Chart = new List <ChartObject2>();
            foreach (var item in WhoIsWhereLists.Applications)
            {
                ChartObject2 c2 = new ChartObject2();
                c2.DataFieild  = item.Type;
                c2.ValueField1 = studentApps.Where(x => x.AppTypeId == item.Id).Count();
                c2.ValueField2 = myApps.Where(x => x.AppTypeId == item.Id).Count();
                pc1.Chart.Add(c2);
            }
            pCharts.Add(pc1);
            PartnerChart2 pc2 = new PartnerChart2();

            pc2.Chart = new List <ChartObject2>();
            ChartObject2 Accepted = new ChartObject2
            {
                DataFieild  = "Accepted",
                ValueField1 = studentApps.Where(x => x.Accepted == true).Count(),
                ValueField2 = myApps.Where(x => x.Accepted == true).Count()
            };
            ChartObject2 Rejected = new ChartObject2
            {
                DataFieild  = "Rejected",
                ValueField1 = studentApps.Where(x => x.Accepted == false).Count(),
                ValueField2 = myApps.Where(x => x.Accepted == false).Count()
            };
            ChartObject2 NotDecided = new ChartObject2
            {
                DataFieild  = "Not Decided",
                ValueField1 = studentApps.Where(x => x.Accepted == null).Count(),
                ValueField2 = myApps.Where(x => x.Accepted == null).Count()
            };

            pc2.Chart.Add(Accepted); pc2.Chart.Add(Rejected); pc2.Chart.Add(NotDecided);
            pCharts.Add(pc2);
            return(Json(pCharts, JsonRequestBehavior.AllowGet));
        }