public ProgressInfo(long id, SySal.DAQSystem.Drivers.TaskProgressInfo progrinfo) { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // IDText.Text = id.ToString(); StartTimeText.Text = progrinfo.StartTime.ToShortTimeString(); EndTimeText.Text = progrinfo.FinishTime.ToShortTimeString(); ProgressText.Text = progrinfo.Progress.ToString(System.Globalization.CultureInfo.InvariantCulture); CompletedText.Text = progrinfo.Complete ? "Yes" : "No"; ExitExceptionText.Text = progrinfo.ExitException; CustomInfoText.Text = (progrinfo.CustomInfo == null) ? "" : progrinfo.CustomInfo; }
private void OnBatchList_DblClick(object sender, System.EventArgs e) { try { long selectedid = 0; lock (BatchManagerList) { if (BatchManagerList.SelectedItems.Count != 1) { return; } selectedid = Convert.ToInt64(BatchManagerList.SelectedItems[0].Tag); } if (ScratchDirText.Text.Length == 0) { if (Conn == null) { Conn = new SySal.OperaDb.OperaDbConnection(Credentials.DBServer, Credentials.DBUserName, Credentials.DBPassword); Conn.Open(); } ScratchDirText.Text = new SySal.OperaDb.OperaDbCommand("SELECT VALUE FROM OPERA.LZ_SITEVARS WHERE NAME = 'ScratchDir'", Conn, null).ExecuteScalar().ToString(); } if (!ScratchDirText.Text.EndsWith(@"\")) { ScratchDirText.Text += @"\"; } System.Diagnostics.Process.Start(ScratchDirText.Text + selectedid + "_progress.htm"); } catch (Exception x) { MessageBox.Show("Can't retrieve progress page path because of the following error:\r\n" + x.ToString(), "DB connection error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } return; #if false // TODO: Find a way to deserialize CustomInfo XML elements... SySal.DAQSystem.Drivers.TaskProgressInfo progrinfo = null; long selectedid = 0; lock (BatchManagerList) { if (BatchManagerList.SelectedItems.Count != 1) { return; } selectedid = Convert.ToInt64(BatchManagerList.SelectedItems[0].Tag); try { progrinfo = BMSrv.GetProgressInfo(selectedid); } catch (Exception x) { MessageBox.Show(x.ToString(), x.Message, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } if (progrinfo != null) { ProgressInfo progrdlg = new ProgressInfo(selectedid, progrinfo); progrdlg.ShowDialog(); progrdlg.Dispose(); } #endif }