private void tsbGeraInserts_Click(object sender, EventArgs e) { try { if (txtTbDestino.Text.Trim() == string.Empty) { errorProvider1.SetError(txtTbDestino, "Insira o nome da Tabela Destino"); return; } else { errorProvider1.Clear(); } Application.DoEvents(); grpGerando.Visible = true; this.Cursor = Cursors.WaitCursor; frmInserts objFrm = new frmInserts(); objFrm.TimerInicio = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);; objFrm.Tabela = txtTbDestino.Text.Trim(); System.Threading.Thread.CurrentThread.CurrentCulture = alteraCulturaThread(true); objFrm.Inserts = generationInserts.InsertsFromQuery((DataTable)dgvResult.DataSource, txtTbDestino.Text); grpGerando.Visible = false; objFrm.ShowDialog(); } catch (Exception ex) { MessageBox.Show("Erro: " + ex.Message, "Migration", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Cursor = Cursors.Default; grpGerando.Visible = false; } }
private void tsbGeraInserts_Click(object sender, EventArgs e) { try { if (txtTbDestino.Text.Trim() == string.Empty) { errorProvider1.SetError(txtTbDestino, "Insira o nome da Tabela Destino"); return; } else errorProvider1.Clear(); Application.DoEvents(); grpGerando.Visible = true; this.Cursor = Cursors.WaitCursor; frmInserts objFrm = new frmInserts(); objFrm.TimerInicio = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); ; objFrm.Tabela = txtTbDestino.Text.Trim(); System.Threading.Thread.CurrentThread.CurrentCulture = alteraCulturaThread(true); objFrm.Inserts = generationInserts.InsertsFromQuery((DataTable)dgvResult.DataSource, txtTbDestino.Text); grpGerando.Visible = false; objFrm.ShowDialog(); } catch (Exception ex) { MessageBox.Show("Erro: " + ex.Message, "Migration", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Cursor = Cursors.Default; grpGerando.Visible = false; } }