Example #1
0
 private void completionWizardPage1_PageValidating(object sender, DevExpress.XtraWizard.WizardPageValidatingEventArgs e)
 {
     if (chExibirArquivo.Checked)
     {
         FileManagerIts.OpenFromSystem(Path.GetDirectoryName(txtPathBackup.Text));
     }
 }
Example #2
0
        private void barBtnViewAttach_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (gridViewAnexos.IsSelectOneRowWarning())
            {
                var row = gridViewAnexos.GetFocusedRow <AnexoPackage>();

                if (row != null)
                {
                    //evita um nome duplicado
                    string file = FileManagerIts.GetTempFile(row.PathFile);
                    FileManagerIts.DeleteFile(file);
                    FileManagerIts.WriteBytesToFile(file, row.DataFile);

                    if (file.EndsWith(".sql"))
                    {
                        var high = new XFrmHighlighting(file, ScintillaNET.Lexer.Sql);
                        high.ShowDialog();

                        if (high.IsTextSave)
                        {
                            row.DataFile = FileManagerIts.GetBytesFromFile(file);
                        }
                    }
                    else
                    {
                        //deixe o sistema se virar
                        FileManagerIts.OpenFromSystem(file);
                    }
                }
            }
        }
Example #3
0
 private void completionWizardPage1_PageValidating(object sender, DevExpress.XtraWizard.WizardPageValidatingEventArgs e)
 {
     //inicia a aplicação
     if (chExibirArquivo.Checked)
     {
         FileManagerIts.OpenFromSystem(Path.Combine(txtInstallDir.Text, "ITE.Forms.exe"));
     }
 }
Example #4
0
        private static void showResultBuilder(StringBuilder sb)
        {
            Console.WriteLine(sb);
            var file = FileManagerIts.DeskTopPath + "\\out.txt";

            FileManagerIts.DeleteFile(file);
            FileManagerIts.AppendLines(file, sb.ToString());
            FileManagerIts.OpenFromSystem(file);
        }
Example #5
0
 private void groupControlLogo_DoubleClick(object sender, EventArgs e)
 {
     if (pictureFotoProduto.Image != null)
     {
         var img  = ImageUtilIts.GetBytesFromImage(pictureFotoProduto.Image);
         var path = Path.Combine(Path.GetTempPath(), Path.GetTempFileName() + ".jpg");
         FileManagerIts.WriteBytesToFile(path, img);
         FileManagerIts.OpenFromSystem(path);
     }
 }
Example #6
0
 private void lblFileName_Click(object sender, EventArgs e)
 {
     try
     {
         string path = this.picImagem.ImageLocation;
         FileManagerIts.OpenFromSystem(Path.GetDirectoryName(path));
         FileManagerIts.OpenFromSystem(path);
     }
     catch (Exception ex)
     {
         LoggerUtilIts.ShowExceptionMessage(ex);
     }
 }
Example #7
0
        private void exportar()
        {
            try
            {
                var excelFile = Path.Combine(FileManagerIts.DeskTopPath,
                                             @"Import-" + DateTime.Now.ToString("dd-MM-yyyy-HH-mm-ss") + ".xlsx");

                Console.WriteLine(excelFile);

                gridControl1.ExportToXlsx(excelFile);
                FileManagerIts.OpenFromSystem(excelFile);
            }
            catch
            {
                XMessageIts.Erro("Falha ao exportar!");
            }
        }
Example #8
0
        /// <summary>
        /// PDF nao fica muito bom
        /// </summary>
        /// <param name="bb"></param>
        public static void ShowBoletoPDF(BoletoBancario bb)
        {
            var bytes = bb.MontaBytesPDF();

            var path = Path.Combine(FileManagerIts.DeskTopPath, "Boleto-" + bb.Banco.Nome + ".pdf");


            for (int i = 1; File.Exists(path); i++)
            {
                path = Path.Combine(FileManagerIts.DeskTopPath, "Boleto-" + bb.Banco.Nome + "_" + i + ".pdf");
            }

            FileManagerIts.WriteBytesToFile(path, bytes);


            FileManagerIts.OpenFromSystem(path);
        }
Example #9
0
        private void barBtnVisualizarAnexo_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (gridView1.IsSelectOneRowWarning())
            {
                var row = gridView1.GetFocusedRow <AnexoLancamento>();

                if (row != null)
                {
                    //evita um nome duplicado
                    string file = FileManagerIts.GetTempFile(row.PathFile);
                    FileManagerIts.DeleteFile(file);
                    FileManagerIts.WriteBytesToFile(file, row.DataFile);
                    FileManagerIts.OpenFromSystem(file);

                    this._temps.Add(file);
                }
            }
        }
Example #10
0
        private void barBtnExportarPdf_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (gridView1.IsEmpty)
            {
                XMessageIts.Mensagem("Nada a exportar !");
            }
            else
            {
                if (gridView1.DataSource != null)
                {
                    string pdfName = "export_cambio_pdf" + DataUtil.ToDateSql();
                    string pdf     = Path.Combine(FileManagerIts.DeskTopPath, pdfName) + ".pdf";
                    FileManagerIts.DeleteFile(pdf);

                    gridControl1.ExportToPdf(pdf);
                    FileManagerIts.OpenFromSystem(pdf);
                }
            }
        }
Example #11
0
        /// <summary>
        /// Exportar os dados para uma planilha .xlsx localizada no Desktop
        ///
        /// O metodo de exportação pertence ao gridControl
        /// </summary>
        /// <param name="gridView"></param>
        public static void ExportXlsxDirect(this GridView gridView)
        {
            if (gridView.IsEmpty)
            {
                XMessageIts.Mensagem("Nada a exportar !");
            }
            else
            {
                if (gridView.DataSource != null)
                {
                    string excelName = "ExportExcel-" + DataUtil.ToDateSql();
                    string excel     = Path.Combine(FileManagerIts.DeskTopPath, excelName) + ".xlsx";
                    FileManagerIts.DeleteFile(excel);

                    gridView.ExportToXlsx(excel);
                    FileManagerIts.OpenFromSystem(excel);
                }
            }
        }
        private void barBtnExport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (gridViewLancamentos.IsEmpty)
            {
                XMessageIts.Mensagem("Nada a exportar !");
            }
            else
            {
                string excelName = "Lançamentos_export_" + DataUtil.ToDateSql();
                string excel     = Path.Combine(FileManagerIts.DeskTopPath, excelName) + ".xlsx";

                if (File.Exists(excel))
                {
                    excel = FileManagerIts.GetTempFileFromDir(excel);
                }

                gridControlLancamentos.ExportToXlsx(excel);
                FileManagerIts.OpenFromSystem(excel);
            }
        }
Example #13
0
        /// <summary>
        /// Exportar os dados para uma planilha .xlsx, para o local informado.
        /// </summary>
        /// <param name="gridView"></param>
        public static void ExportXlsxToDisk(this GridView gridView)
        {
            if (gridView.IsEmpty)
            {
                XMessageIts.Mensagem("Nada a exportar !");
            }
            else
            {
                var save = new SaveFileDialog
                {
                    Title    = @"Exportar dados para o excel",
                    FileName = "ExcelExport.xlsx",
                    Filter   = FileManagerIts.DocumentFilterExcel
                };

                if (save.ShowDialog() == DialogResult.OK)
                {
                    string pathExcel = save.FileName;
                    if (pathExcel != null)
                    {
                        if (!pathExcel.EndsWith(".xlsx"))
                        {
                            pathExcel = pathExcel + ".xlsx";
                        }

                        gridView.ExportToXlsx(pathExcel);

                        FileManagerIts.OpenFromSystem(pathExcel);
                    }
                    else
                    {
                        XMessageIts.Advertencia("Falha no caminho do arquivo .xlsx.", "Operação cancelada!");
                    }
                }
            }
        }