Ejemplo n.º 1
0
        public ActionResult ExportJobList(int AdminStatisticId, int?month = 0, int?export = 0)
        {
            bool UnexportedItemNoExists = false;

            if (month.Value == 0)
            {
                month = jobStatusService.Months;
            }
            else
            {
                jobStatusService.Months = month.Value;
            }
            var model = new JobStatus_SearchModel();

            model.Title = jobStatusService.Title;
            //model.JobStatusCount = _jobStatus.GetSummaryJobsStatuses();
            if (export == 2)
            {
                model.JobStatusSearchResults = jobStatusService.GetUnExportedRejectedJobList(jobStatusService.Months);

                if (model.JobStatusSearchResults.Count > 0)
                {
                    foreach (JobStatus_Search JS in model.JobStatusSearchResults)
                    {
                        jobStatusService.SetJobExported(JS.ServiceId, DateTime.Now, accountService.UserId);
                    }
                    //   jobStatusService.SetJobExported()
                }
            }
            else
            {
                model.JobStatusSearchResults = jobStatusService.GetJobsListByAdminStatisticid(jobStatusService.StatusId, jobStatusService.Months);
                //model.JobStatusSearchResults = jobStatusService.GetRejectedJobList(jobStatusService.Months);
                UnexportedItemNoExists = true;
            }
            //model.AdminJobStatisticList = jobStatusService.AdminJobsStatistics(jobStatusService.Months);

            model.JobDurationList = jobStatusService.GetJobSearchDurationList(jobStatusService.Months);
            model.JobDuration     = jobStatusService.Months;
            model.StatusId        = jobStatusService.StatusId;

            if (export == 1 || export == 2)
            {
                if (model.JobStatusSearchResults.Count == 0)
                {
                    //  if No items are available newly to export
                    model.JobStatusSearchResults = jobStatusService.GetJobsListByAdminStatisticid(jobStatusService.StatusId, jobStatusService.Months);
                    ViewBag.ExportRecordEmpty    = "No records to download";
                }
                else
                {
                    Export exportt = new Export();
                    exportt.JobListToExcel(model.Title, Response, model.JobStatusSearchResults, export.Value);
                }
            }
            ViewBag.AdminStatisticId    = jobStatusService.StatusId;
            model.AdminJobStatisticList = jobStatusService.AdminJobsStatistics(jobStatusService.Months);
            return(View("JobList", model));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Shows jobs by the status as a part of process
        /// </summary>
        /// <returns>Jobs list</returns>
        public ActionResult JobList(int?month = 0, int?export = 0)
        {
            if (month.Value == 0)
            {
                month = jobStatusService.Months;
            }
            else
            {
                jobStatusService.Months = month.Value;
            }
            var model = new JobStatus_SearchModel();

            model.Title = jobStatusService.Title;
            //model.JobStatusCount = _jobStatus.GetSummaryJobsStatuses();
            //if (export == 2)
            //{
            //    model.JobStatusSearchResults = jobStatusService.GetUnExportedRejectedJobList(jobStatusService.Months);

            //    if (model.JobStatusSearchResults.Count > 0)
            //    {
            //        foreach (JobStatus_Search JS in model.JobStatusSearchResults)
            //        {
            //            jobStatusService.SetJobExported(JS.ServiceId, DateTime.Now, "1");
            //        }
            //     //   jobStatusService.SetJobExported()
            //    }
            //}
            //else
            //{
            model.JobStatusSearchResults = jobStatusService.GetJobsListByAdminStatisticid(jobStatusService.StatusId, jobStatusService.Months);
            //model.JobStatusSearchResults = jobStatusService.GetRejectedJobList(jobStatusService.Months);
            //}
            model.AdminJobStatisticList = jobStatusService.AdminJobsStatistics(jobStatusService.Months);

            model.JobDurationList = jobStatusService.GetJobSearchDurationList(jobStatusService.Months);
            model.JobDuration     = jobStatusService.Months;
            model.StatusId        = jobStatusService.StatusId;

            //if (export == 1 || export == 2)
            //{
            //    Export exportt = new Export();
            //    exportt.JobListToExcel(Response, model.JobStatusSearchResults);
            //}
            ViewBag.AdminStatisticId = jobStatusService.StatusId;
            return(View(model));
        }
Ejemplo n.º 3
0
 public ActionResult RepeatStatics(int?page = 1)
 {
     if (accountService.IsSuperAdmin)
     {
         var model = new JobStatus_SearchModel();
         model.Title                  = jobStatusService.Title;
         model.JobStatusCount         = jobStatusService.GetSummaryJobsStatuses();
         model.JobStatusSearchResults = jobStatusService.GetJobsList();
         if (model.JobStatusSearchResults.Count > 0)
         {
             model.ChangeStatusText = model.JobStatusSearchResults[0].ChangeStatusText;
             model.ChangeStatusId   = model.JobStatusSearchResults[0].ChangeStatusId;
         }
         model.StatusId = jobStatusService.StatusId;
         return(View(model));
     }
     else
     {
         return(RedirectToAction("AccessDenied", "Account"));
     }
 }