示例#1
0
        protected void ProjectImgStampaEtichette_Click(object o, EventArgs e)
        {
            //try
            //{
            //    this.EnumLabel = "1";
            //    PrintLabel_alreadyPrinted = false;
            //    PrintLabel_alreadyPrinted2 = false;
            //    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "print_labels", "ajaxModalPopupPrintLabel();", true);
            //}
            //catch (System.Exception ex)
            //{
            //    UIManager.AdministrationManager.DiagnosticError(ex);
            //    return;
            //}


            try
            {
                DocsPaWR.FileDocumento fileRep = ProjectManager.reportFascette(UIManager.ProjectManager.getProjectInSession().codice, null);

                HttpContext.Current.Session["visualReportAlreadyDownloaded" + Session.SessionID] = null;
                FileManager.setSelectedFileReport(this.Page, fileRep, "../popup");
                if (fileRep != null)
                {
                    exportDatiSessionManager session = new exportDatiSessionManager();
                    session.SetSessionExportFile(fileRep);
                }
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return;
            }
        }
示例#2
0
 protected void DocumentImgPrintReceipt_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(Utils.InitConfigurationKeys.GetValue("0", DBKeys.FE_RICEVUTA_PROTOCOLLO_PDF.ToString())) && Utils.InitConfigurationKeys.GetValue("0", DBKeys.FE_RICEVUTA_PROTOCOLLO_PDF.ToString()) == "1")
         {
             ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "PrintReceiptPDF", "ajaxModalPopupPrintReceiptPdf();", true);
         }
         else
         {
             HttpContext.Current.Session["visualReportAlreadyDownloaded" + Session.SessionID] = null;
             DocsPaWR.FileDocumento fileRep = DocumentManager.StampaRicevutaProtocolloRtf();
             FileManager.setSelectedFileReport(this.Page, fileRep, "../popup");
             if (fileRep != null)
             {
                 exportDatiSessionManager session = new exportDatiSessionManager();
                 session.SetSessionExportFile(fileRep);
             }
         }
     }
     catch (System.Exception ex)
     {
         UIManager.AdministrationManager.DiagnosticError(ex);
         return;
     }
 }
示例#3
0
        public void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                Response.Expires = -1;

                if (!IsPostBack && !this.AlreadyDownloaded)
                {
                    //    string id = Session.SessionID;
                    //    DocsPaWR.FileDocumento theDoc = FileManager.getInstance(id).getReport(this);

                    //    Response.ContentType = theDoc.contentType;
                    //    Response.ContentType = "application/octet-stream";
                    //    Response.AddHeader("content-disposition", "attachment;filename=" + theDoc.name);
                    //    Response.AddHeader("content-lenght", theDoc.content.Length.ToString());
                    //    Response.BinaryWrite(theDoc.content);



                    DocsPaWR.FileDocumento file = new DocsPaWR.FileDocumento();

                    exportDatiSessionManager sessioneManager = new exportDatiSessionManager();
                    file = sessioneManager.GetSessionExportFile();
                    sessioneManager.ReleaseSessionExportFile();

                    if (file != null && file.content.Length > 0)
                    {
                        Response.ContentType = file.contentType;
                        Response.AddHeader("content-disposition", "inline;filename=" + file.fullName);
                        Response.AddHeader("content-lenght", file.content.Length.ToString());
                        if (this.IsApplet || this.IsSocket)
                        {
                            string base64String = System.Convert.ToBase64String(file.content, 0, file.content.Length);
                            Response.Write(base64String);
                        }
                        else
                        {
                            Response.BinaryWrite(file.content);
                            Response.Flush();
                            //Response.Close();
                            //Response.End();
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "parent.ajaxDialogModal('ErrorExportDati', 'warning', '');", true);
                    }



                    this.AlreadyDownloaded = true;
                }
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return;
            }
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                DocsPaWR.FileDocumento file = new DocsPaWR.FileDocumento();

                exportDatiSessionManager sessioneManager = new exportDatiSessionManager();
                file = sessioneManager.GetSessionExportFile();
                sessioneManager.ReleaseSessionExportFile();

                if (file != null && file.content.Length > 0)
                {
                    Response.ContentType = file.contentType;
                    Response.AddHeader("content-disposition", "inline;filename=" + file.fullName);
                    Response.AddHeader("content-lenght", file.content.Length.ToString());
                    if (this.IsApplet)
                    {
                        string base64String = System.Convert.ToBase64String(file.content, 0, file.content.Length);
                        Response.Write(base64String);
                    }
                    else
                    {
                        Response.BinaryWrite(file.content);
                        Response.Flush();
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "parent.ajaxDialogModal('ErrorExportDati', 'warning', '');", true);
                }
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "parent.ajaxDialogModal('ErrorExportDati', 'warning', '');", true);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                componentType = UserManager.getComponentType(Request.UserAgent);

                this.InitApplet();


                this.InitLanguage();
                string tipologia = "rtf";
                Response.Expires = -1;

                if (!IsPostBack && !this.AlreadyDownloaded)
                {
                    DocsPaWR.FileDocumento file = new DocsPaWR.FileDocumento();

                    exportDatiSessionManager sessioneManager = new exportDatiSessionManager();
                    file = sessioneManager.GetSessionExportFile();


                    if (file == null || file.content == null || file.content.Length == 0)
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "ajaxDialogModal('InfoExportDatiNoneFound', 'info', '');", true);
                        if (componentType == Constans.TYPE_APPLET)
                        {
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "openFile", "OpenFileApplet('" + tipologia + "');", true);
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "openFile", "OpenFileActiveX('" + tipologia + "');", true);
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(file.name) && FileManager.getEstensioneIntoP7M(file.name).ToUpper().Equals("PDF"))
                        {
                            tipologia = "PDF";
                        }
                        String script = "OpenFileApplet('" + tipologia + "');";
                        switch (componentType)
                        {
                        case Constans.TYPE_ACTIVEX:
                        case Constans.TYPE_SMARTCLIENT:
                            script = "OpenFileActiveX('" + tipologia + "');";
                            break;

                        case Constans.TYPE_SOCKET:
                            script = "OpenFileSocket('" + tipologia + "');";
                            break;

                        default:
                            script = "OpenFileApplet('" + tipologia + "');";
                            break;
                        }

                        ScriptManager.RegisterStartupScript(this, this.GetType(), "openFile", script, true);
                    }
                }
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return;
            }
        }