Exemplo n.º 1
0
        // This method will return an instance of GeneralReportModel Class
        public GeneralReportModel GeneralReport()
        {
            var allUsers        = db.Users.Where(x => x.RoleId == 2).ToList();
            var allVacancies    = db.JobOpenings.Where(x => x.Vacancy != 0 && x.IsExpired == false && x.LastApplyDate >= DateTime.Now).ToList();
            var userApplication = db.JobApplications.Where(x => x.Status == 1).ToList();

            GeneralReportModel model = new GeneralReportModel
            {
                TotalEmployee = allUsers.Count(),
                TotalVacancy  = allVacancies.Count(),
                TotalApplied  = userApplication.Count()
            };

            return(model);
        }
Exemplo n.º 2
0
        public GeneralReportModel GetGeneralReport(string fromDate, string toDate)
        {
            DateTime dateFrom = string.IsNullOrEmpty(fromDate) ? DateTime.Now : DateTime.Parse(fromDate);
            DateTime dateto   = string.IsNullOrEmpty(toDate) ? DateTime.Now : DateTime.Parse(toDate);

            dateto = dateto.AddDays(1);
            GeneralReportModel model = new GeneralReportModel();

            model.SchoolCount = Context.schools.Where(x =>
                                                      (x.CreatedAt >= dateFrom) &&
                                                      (x.CreatedAt < dateto && x.Status == "Approved")
                                                      ).ToList().Count();

            model.StudentCount = Context.participant_profile.Where(x =>
                                                                   (x.CreatedAt >= dateFrom) &&
                                                                   (x.CreatedAt < dateto)
                                                                   ).ToList().Count();

            model.VolunteerCount = Context.volunteer_profile.Where(x =>
                                                                   (x.CreatedAt >= dateFrom) &&
                                                                   (x.CreatedAt < dateto)
                                                                   ).ToList().Count();

            model.SessionCount = Context.sessions.Where(x =>
                                                        (x.CreatedAt >= dateFrom) &&
                                                        (x.CreatedAt < dateto)
                                                        ).ToList().Count();

            model.PartnerCount = Context.funder_profile.Where(x =>
                                                              (x.CreatedAt >= dateFrom) &&
                                                              (x.CreatedAt < dateto)
                                                              ).ToList().Count();

            model.CoordinatorCount = Context.coordinator_profile.Where(x =>
                                                                       (x.CreatedAt >= dateFrom) &&
                                                                       (x.CreatedAt < dateto)
                                                                       ).ToList().Count();

            var resultCPpre = Context.evaluation_cp_pre.Where(x =>
                                                              (x.CreateAt >= dateFrom) &&
                                                              (x.CreateAt < dateto)
                                                              ).ToList().Count();

            var resultMurshadeepre = Context.evaluation_murshadee_before.Where(x =>
                                                                               (x.CreatedAt >= dateFrom) &&
                                                                               (x.CreatedAt < dateto)
                                                                               ).ToList().Count();

            var resultPFpre = Context.evaluation_pf_pre.Where(x =>
                                                              (x.CreatedAt >= dateFrom) &&
                                                              (x.CreatedAt < dateto)
                                                              ).ToList().Count();

            var resultSafeerpre = Context.evaluation_safeer_pre.Where(x =>
                                                                      (x.CreatedAt >= dateFrom) &&
                                                                      (x.CreatedAt < dateto)
                                                                      ).ToList().Count();

            var resultSYCpre1 = Context.evaluation_syc_pre_part1.Where(x =>
                                                                       (x.CreatedAt >= dateFrom) &&
                                                                       (x.CreatedAt < dateto)
                                                                       ).ToList().Count();

            var resultPFpre2 = Context.evaluation_syc_pre_part2.Where(x =>
                                                                      (x.CreatedAt >= dateFrom) &&
                                                                      (x.CreatedAt < dateto)
                                                                      ).ToList().Count();


            model.EvaluationPreCount = resultCPpre + resultMurshadeepre + resultPFpre + resultSafeerpre + resultSYCpre1 + resultPFpre2;


            var resultCPpost = Context.evaluation_cp_post.Where(x =>
                                                                (x.CreatedAt >= dateFrom) &&
                                                                (x.CreatedAt < dateto)
                                                                ).ToList().Count();

            var resultMurshadeepost = Context.evaluation_murshadee_after.Where(x =>
                                                                               (x.CreatedAt >= dateFrom) &&
                                                                               (x.CreatedAt < dateto)
                                                                               ).ToList().Count();

            var resultPFpost = Context.evaluation_pf_post.Where(x =>
                                                                (x.CreatedAt >= dateFrom) &&
                                                                (x.CreatedAt < dateto)
                                                                ).ToList().Count();

            var resultSafeerpost = Context.evaluation_safeer_post.Where(x =>
                                                                        (x.CreatedAt >= dateFrom) &&
                                                                        (x.CreatedAt < dateto)
                                                                        ).ToList().Count();

            var resultSYCpost1 = Context.evaluation_syc_post_part1.Where(x =>
                                                                         (x.CreatedAT >= dateFrom) &&
                                                                         (x.CreatedAT < dateto)
                                                                         ).ToList().Count();

            var resultPFpost2 = Context.evaluation_syc_post_part2.Where(x =>
                                                                        (x.CreatedAt >= dateFrom) &&
                                                                        (x.CreatedAt < dateto)
                                                                        ).ToList().Count();

            model.EvaluationPostCount = resultCPpost + resultMurshadeepost + resultPFpost + resultSafeerpost + resultSYCpost1 + resultPFpost2;
            model.CitiesCount         = Context.lk_city.Count();
            return(model);
        }
Exemplo n.º 3
0
        public ActionResult GeneralReport()
        {
            var Values = new GeneralReportModel();

            return(View(Values));
        }