Beispiel #1
0
        public ActionResult _ReportMaintanacePDF(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");
            }


            PerformMaintanaceSummary summary = new PerformMaintanaceSummary();

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

            summary.isFull = bFull;

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

            byte[] buffer = new ReportManagement.StandardPdfRenderer().Render(text, "");
            return(new ReportManagement.BinaryContentResult(buffer, "application/pdf", summary.GetPDFFilename()));
        }
Beispiel #2
0
        public PartialViewResult _ReportMaintenace(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");
            }


            PerformMaintanaceSummary summary = new PerformMaintanaceSummary();

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

            summary.isFull = bFull;

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