protected void btnShowTimes_Click(object sender, EventArgs e) { btnShowTimes.Enabled = false; if (btnShowTimes.Text.Equals("Show Real Times")) { grid.Columns[0].Visible = false; this.TABLE_NAME = "tblOper_d"; btnShowTimes.Text = "Edit Operations"; { ClassF calc = new ClassF(GetDirectory() + userDir); try { calc = new ClassF(GetDirectory() + userDir); calc.setGlobalVar(); calc.runsqlado("DELETE * FROM tblOper_d;"); calc.runsqlado("DELETE * FROM zstblerrors;"); calc.inOperRoutingPages = true; calc.MakeActualoper_all(); string errorMsg = calc.GetErrorMessage(); lblErrorRealTimesOper.Text = "Errors in calculating expressions in operation table:<br/>" + errorMsg; lblErrorRealTimesOper.Visible = !errorMsg.Trim().Equals(String.Empty); } catch (Exception ex) { logFiles.ErrorLog(ex); Master.ShowErrorMessage("An error has occured while calculating expressions."); } finally { calc.Close(); } } } else { grid.Columns[0].Visible = true; this.TABLE_NAME = "tbloper"; btnShowTimes.Text = "Show Real Times"; } this.SetData(); btnShowTimes.Enabled = true; }