Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Check Login
            CheckSchoolAdminSession();
            #endregion Check Login

            var view = new ScripSafe();
            string viewTID = CCLib.Common.Strings.GetQueryString("viewTID");
            string viewSID = CCLib.Common.DataAccess.GetValue(@"SELECT t.StudentNumber FROM Transcript_Transcripts t
                             WHERE t.SchoolID=" + AdminInfo["SchoolID"] + " and t.TranscriptID=" + viewTID).ToString();
            string pdfPath = view.ViewTranscriptRequest(AdminInfo["SchoolID"].ToString(), viewSID, viewTID);
            string strName = "\"attachment; filename=\"Transcript_" + viewSID + ".pdf\"";
            Response.Clear();
            Response.AddHeader("content-disposition", strName);
            Response.Charset = "";
            Response.ContentType = "application/pdf";
            //Response.Write(CareerCruisingWeb.CCLib.Common.Forms.JavaScriptNotify(pdfPath));
            var bytes = File.ReadAllBytes(pdfPath);
            File.Delete(pdfPath);
            Response.BinaryWrite(bytes);
            Response.End();
        }