private void OnPermit(string tamplate) { string msg; try { tamplategrid = new TamplateGrid(tamplate); CreateGrid(tamplategrid.arr_columns); splitContainer1.Panel1.Enabled = false; iRow = 0; toolStripProgressBarData.Value = 0; toolStripStatusLabelPC.Text = ""; toolStripStatusLabelRow.Text = ""; toolStripStatusLabelTime.Text = ""; splitContainer1.Panel1.Enabled = false; // read_param(); process = new StatmetProc(clWork, param, true); if (process.ShowDialog() == DialogResult.Cancel) { splitContainer1.Panel1.Enabled = true; toolStripStatusLabelTime.Text = "canceled"; } else { string s = process.sTime; toolStripStatusLabelTime.Text = s; table = process.oData as DataTable; iRow = table.Rows.Count; if (iRow > 0) { dataGridViewBT.Rows.Add(iRow); backgroundWorkerGrid.RunWorkerAsync(); } else { splitContainer1.Panel1.Enabled = true; on_print(); } //splitContainer1.Panel1.Enabled = true; } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
private void buttonPermit_Click(object sender, EventArgs e) { try { read_param(); //dataGridViewValid.Rows.Clear(); dataGridViewValid.DataSource = null; iRow = 0; toolStripProgressBarData.Value = 0; toolStripStatusLabelPC.Text = ""; toolStripStatusLabelRow.Text = ""; toolStripStatusLabelTime.Text = ""; panel1.Enabled = false; process = new StatmetProc(clWork, param, true); if (process.ShowDialog() == DialogResult.Cancel) { panel1.Enabled = true; toolStripStatusLabelTime.Text = "canceled"; } else { string s = process.sTime; toolStripStatusLabelTime.Text = s; table = process.oData as DataTable; iRow = table.Rows.Count; //ListCompareBPRound_Averpcall clC = new ListCompareBPRound_Averpcall(); //list.Sort(clC); if (iRow > 0) { dataGridViewValid.DataSource = table; //dataGridViewValid.Rows.Add(iRow); //backgroundWorkerGrid.RunWorkerAsync(); } // else // { // on_print(); complete(); // } on_print(); panel1.Enabled = true; } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }