Exemple #1
0
        private void btnPesquisar_Click(object sender, EventArgs e)
        {
            backgroundWorker.RunWorkerAsync();

            telaProgresso = new TelaProgresso("Carregando vendas. Aguarde.", ProgressBarStyle.Marquee, ref backgroundWorker);
            telaProgresso.Show();
        }
        /// <summary>
        ///     Exporta para arquivo as listas.
        /// </summary>
        /// <param name="_tituloForm">Título da lista</param>
        /// <param name="_dataGridView">DataGridView que possui os dados</param>
        /// <param name="_headers">São os headers de campos fora do DGV</param>
        /// <param name="_headersData">São os dados dos headers fora do DGV</param>
        public void SalvarDocumento()
        {
            try
            {
                if (dataGridView.Rows.Count == 0) throw new DataGridViewNoRowException("A lista está vazia.");

                // define algumas propriedades da caixa salvar
                salvar.Title = "Exportar para Excel";
                salvar.Filter = "Arquivo do Excel *.xlsx | *.xlsx";
                var dialog = salvar.ShowDialog(); // mostra diálogo de salvar

                if (dialog == DialogResult.OK)
                {
                    // salva o arquivo
                    telaProgresso = new TelaProgresso("Escrevendo dados. Aguarde.", ProgressBarStyle.Marquee,
                        ref bgwExportaDocumento);

                    telaProgresso.Show();

                    bgwExportaDocumento.RunWorkerAsync();
                }
                else
                {
                    MessageBox.Show(Resources.operacao_cancelada);
                }
            }
            catch (DataGridViewNoRowException norow)
            {
                MessageBox.Show(norow.Message);
            }
        }
        private void TabelaCartoes_Load(object sender, EventArgs e)
        {
            telaProgresso = new TelaProgresso("Carregando cartões. Aguarde.", ProgressBarStyle.Marquee, ref backgroundWorker);
            telaProgresso.Show();

            dgvCartoes.AutoGenerateColumns = false;

            this.Text += " [" + vendaEnt.idVenda + "] [" + vendaEnt.LojaNome + "]";

            backgroundWorker.RunWorkerAsync();
        }
        private void TabelaProdutos_Load(object sender, EventArgs e)
        {
            telaProgresso = new TelaProgresso("Carregando produtos. Aguarde.", ProgressBarStyle.Marquee, ref backgroundWorker);
            telaProgresso.Show();

            dgvProdutos.AutoGenerateColumns = false;

            this.Text += " [" + vendaEnt.idVenda + "] [" + vendaEnt.LojaNome + "]";
            IList<Prod_Venda> Ilista = DAOProdVenda.ListarWhere("venda", vendaEnt, "loja", vendaEnt.loja);

            backgroundWorker.RunWorkerAsync();
        }
 private void abreTelaProgresso()
 {
     telaProgresso = new TelaProgresso("Carregando vendas. Aguarde.", ProgressBarStyle.Marquee, ref backgroundWorker);
     telaProgresso.Show();
 }
 private void abreTelaProgresso()
 {
     telaProgresso = new TelaProgresso("Carregando movimentação de estoque. Aguarde.", ProgressBarStyle.Marquee, ref backgroundWorker);
     telaProgresso.ShowDialog();
 }
Exemple #7
0
 private void abreTelaProgresso(String msg)
 {
     telaProgresso = new TelaProgresso(msg, ProgressBarStyle.Marquee, ref backgroundWorker);
     telaProgresso.ShowDialog();
 }
 private void AbreTelaProgresso()
 {
     telaProgresso = new TelaProgresso("Salvando venda. Aguarde.", ProgressBarStyle.Blocks, ref backgroundWorker);
     telaProgresso.Show();
 }