Exemple #1
0
        public ActionResult _ReportSummaryPDF(int Month, int Year, bool bFull)
        {
            if (User.Identity.Name == "")
            {
                throw new Exception("Access not denid");
            }
            string access_type = db.StaffPersons.Where(p => p.UserName == User.Identity.Name).First().AccessType;

            if (access_type != "Administrator" && access_type != "Chef")
            {
                throw new Exception("Access not denid");
            }


            PerformOperationsSummary summary = new PerformOperationsSummary();

            summary.CreatePerformReport(new MDTime().GetStartRange(Month, Year),
                                        new MDTime().GetEndRange(Month, Year));

            summary.isFull = bFull;

            string text = new ReportManagement.HtmlViewRenderer().RenderViewToString(this, "ReportSummary", summary);

            byte[] buffer = new ReportManagement.StandardPdfRenderer().Render(text, "");
            return(new ReportManagement.BinaryContentResult(buffer, "application/pdf", summary.GetPDFFilename()));
        }
Exemple #2
0
        public PartialViewResult _ReportSummary(int Month, int Year, bool bFull)
        {
            if (User.Identity.Name == "")
            {
                throw new Exception("Access not denid");
            }
            string access_type = db.StaffPersons.Where(p => p.UserName == User.Identity.Name).First().AccessType;

            if (access_type != "Administrator" && access_type != "Chef")
            {
                throw new Exception("Access not denid");
            }


            PerformOperationsSummary summary = new PerformOperationsSummary();

            summary.CreatePerformReport(new MDTime().GetStartRange(Month, Year),
                                        new MDTime().GetEndRange(Month, Year));

            summary.isFull = bFull;

            return(PartialView("ReportSummary", summary));
        }