public ActionResult PendingReport()
        {
            //var pendingReports = _context.Reports.OrderBy(t=>t.Id)
            //    .Include(t=>t.Doctor)
            //    .Include(t=>t.Patient)
            //    .Include(t=>t.TestTitle)
            //    .Include(t=>t.ConsultingPathologist)
            //    .Where(t => t.isInvestgationDone == false)
            //    .ToList();
            var billItems = _context.BillItems
                            .Include(t => t.Report)
                            .Include(t => t.Report.Doctor)
                            .Include(t => t.Report.Patient)
                            .Include(t => t.Report.TestTitle)
                            .Include(t => t.Report.ConsultingPathologist)
                            .Where(t => t.Report.isInvestgationDone == false)
                            .OrderByDescending(t => t.BillId).ToList();
            var pendingReportsCount = billItems.Count();

            var pendingReportViewModel = new PendingReportViewModel {
                PendingreportCount = pendingReportsCount,
                Billitems          = billItems
            };

            return(View(pendingReportViewModel));
        }
Exemplo n.º 2
0
        // GET: /Report/Edit/n
        public IActionResult Edit(int?id, string commiterror = null)
        {
            string method = "Report/Edit";

            Log.Me.Debug(method + " - User: "******", PendingId: " + (id ?? 0).ToString());
            ApplicationVersion();

            if (NullId(id, "PendingId", method))
            {
                return(RedirectToAction("Error", "Home"));
            }

            try
            {
                PendingReport pr = null;
                if ((pr = Read(id.Value, method)) == null)
                {
                    return(RedirectToAction("Error", "Home"));
                }

                StandingData sd = _context.StandingDataRepo.Load();

                ViewData["RecipientMessage"] = "- " + _context.CirculationRepo.RecipientMessage(id.Value);
                if (commiterror != null)
                {
                    ViewData["CommitError"] = commiterror;
                }
                ViewData["UploadMax"] = ((int)((Config.Get("FileSizeLimit").ToLong()) / (1024 * 1024))).ToString() + "Mb";

                PendingReportViewModel report = new PendingReportViewModel(pr, sd);

                //Log.Me.Info("ReportType='" + report.ReportType + "'");
                //foreach (SelectListItem item in report.ReportTypes) Log.Me.Info("ReportTypeSelect: '" + item.Text + "' = '" + item.Value + "'");

                return(View(report));
            }
            catch (Exception ex)
            {
                Log.Me.Error("Exception in " + method + ": " + ex.Message);
                return(RedirectToAction("Error", "Home"));
            }
        }