Esempio n. 1
0
        private void Verificar_Registro()
        {
            CLS_Activos sel = new CLS_Activos();

            sel.Id_Activo = vId_Activo;
            sel.MtdSeleccionarActivoArchivoPDFXML();
            if (sel.Exito)
            {
                if (sel.Datos.Rows.Count == 0)
                {
                    CLS_Activos ins = new CLS_Activos();
                    ins.Id_Activo = vId_Activo;
                    ins.MtdInsertarActivoArchivoPDFXML();
                    if (!ins.Exito)
                    {
                        XtraMessageBox.Show(ins.Mensaje);
                    }
                }
                else
                {
                    txtNombreArchivoPDF.Text = sel.Datos.Rows[0]["NombreArchivoPDF"].ToString();
                    txtNombreArchivoXML.Text = sel.Datos.Rows[0]["NombreArchivoXML"].ToString();
                }
            }
            else
            {
                XtraMessageBox.Show(sel.Mensaje);
            }
        }
Esempio n. 2
0
        private void Frm_View_PDF_Shown(object sender, EventArgs e)
        {
            CLS_Activos sel = new CLS_Activos();

            sel.Id_Activo = Id_Activo;
            sel.MtdSeleccionarActivoArchivoPDFXML();
            if (sel.Exito)
            {
                if (sel.Datos.Rows.Count > 0 && sel.Datos.Rows[0]["ArchivoPDF"] != null)
                {
                    byte[] bytes = (byte[])sel.Datos.Rows[0]["ArchivoPDF"];

                    System.IO.File.WriteAllBytes(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\ViewPDF.pdf", bytes);
                    this.pdfViewer1.LoadDocument(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\ViewPDF.pdf");
                }
            }
        }
Esempio n. 3
0
        private void Frm_View_XML_Shown(object sender, EventArgs e)
        {
            CLS_Activos sel = new CLS_Activos();

            sel.Id_Activo = Id_Activo;
            sel.MtdSeleccionarActivoArchivoPDFXML();
            if (sel.Exito)
            {
                if (sel.Datos.Rows.Count > 0 && sel.Datos.Rows[0]["ArchivoXML"] != null)
                {
                    byte[] bytes = (byte[])sel.Datos.Rows[0]["ArchivoXML"];

                    System.IO.File.WriteAllBytes(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\ViewXML.xml", bytes);
                    webBrowser1.Navigate(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\ViewXML.xml");
                }
            }
        }