Esempio n. 1
0
        void frmScript_LoggingLinkClicked(string databaseInfo, string remoteEndPoint)
        {
            //database info expected int the format:   TLODDNO2\TLO_Clt1.TLO_002011#[01/17/2011 09:40:31.199]
            try
            {
                //MessageBox.Show(databaseInfo + "      " + remoteEndPoint);
                string   database  = databaseInfo.Split(new char[] { '#' })[0];
                string   timeStamp = databaseInfo.Split(new char[] { '#' })[1].Replace("[", "").Replace("]", "");
                DateTime submittedDate;
                if (!DateTime.TryParse(timeStamp, out submittedDate))
                {
                    MessageBox.Show(String.Format("Unable to determine build date with supplied Date/Time: {0}", timeStamp), "Sorry!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    log.Error(String.Format("Unable to get submittedDate with info: databaseInfo=\"{0}\"; remoteEndPoint=\"{1}\"", databaseInfo, remoteEndPoint));
                }

                string text = buildManager.GetSpecificDetailedDatabaseLog(remoteEndPoint, database, submittedDate);
                SqlSync.ScriptDisplayForm frmScript = new ScriptDisplayForm(text, "", "Detailed Log from " + database);
                frmScript.Show();
            }
            catch (Exception exe)
            {
                log.Error(String.Format("Unable to get detailed log with info: databaseInfo=\"{0}\"; remoteEndPoint=\"{1}\"", databaseInfo, remoteEndPoint), exe);
                MessageBox.Show("Something went wrong! Please check the application log for detail", "Whoops", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 void bg_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Result is string)
     {
         SqlSync.ScriptDisplayForm frmScript = new ScriptDisplayForm(e.Result.ToString(), "", "Sql Build Manager Application Log", SqlSync.Highlighting.SyntaxHightlightType.LogFile);
         frmScript.WordWrap          = false;
         frmScript.ScrollToEndOnLoad = true;
         frmScript.Show();
     }
     else if (e.Result is Exception)
     {
         MessageBox.Show("Sorry, there was an error trying to load the application log file", "Something went wrong", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 3
0
        private void viewRemoteServiceExecutableLogFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.SourceControl is DataGridView)
            {
                DataGridView dgvServerStatus = (DataGridView)this.SourceControl;
                if (dgvServerStatus.SelectedCells.Count == 0)
                {
                    return;
                }

                this.Cursor = Cursors.WaitCursor;
                //this.statGeneral.Text = "Retrieving Remote Service Executable log file...";
                //this.statProgBar.Style = ProgressBarStyle.Marquee;
                try
                {
                    string serverName     = string.Empty;
                    string remoteEndpoint = string.Empty;
                    string text           = string.Empty;
                    if (dgvServerStatus.Rows[dgvServerStatus.SelectedCells[0].RowIndex].DataBoundItem is ServerConfigData)
                    {
                        ServerConfigData server = (ServerConfigData)dgvServerStatus.Rows[dgvServerStatus.SelectedCells[0].RowIndex].DataBoundItem;
                        remoteEndpoint = server.ActiveServiceEndpoint;
                        serverName     = server.ServerName;
                    }
                    else if (dgvServerStatus.Rows[dgvServerStatus.SelectedCells[0].RowIndex].DataBoundItem is BuildRecord)
                    {
                        BuildRecord buildRec = (BuildRecord)dgvServerStatus.Rows[dgvServerStatus.SelectedCells[0].RowIndex].DataBoundItem;
                        remoteEndpoint = buildRec.RemoteEndPoint;
                        serverName     = buildRec.RemoteServerName;
                    }

                    text = buildManager.GetServiceLog(remoteEndpoint);
                    SqlSync.ScriptDisplayForm frmScript = new ScriptDisplayForm(text, serverName, "Service Executable Log from " + serverName, SqlSync.Highlighting.SyntaxHightlightType.LogFile);
                    frmScript.Show();
                }
                catch (Exception exe)
                {
                    MessageBox.Show("Sorry... There was an error attempting to retrieve the log file.\r\n " + exe.Message, "Problem!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                finally
                {
                    this.Cursor = Cursors.Default;
                    //this.statGeneral.Text = "Ready.";
                    //this.statProgBar.Style = ProgressBarStyle.Blocks;
                }
            }
        }
Esempio n. 4
0
        private void viewExecutionCommitsLogToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.SourceControl is DataGridView)
            {
                DataGridView dgvServerStatus = (DataGridView)this.SourceControl;
                if (dgvServerStatus.SelectedCells.Count == 0)
                {
                    return;
                }

                try
                {
                    string serverName     = string.Empty;
                    string text           = string.Empty;
                    string remoteEndpoint = string.Empty;
                    if (dgvServerStatus.Rows[dgvServerStatus.SelectedCells[0].RowIndex].DataBoundItem is ServerConfigData)
                    {
                        ServerConfigData server = (ServerConfigData)dgvServerStatus.Rows[dgvServerStatus.SelectedCells[0].RowIndex].DataBoundItem;
                        remoteEndpoint = server.ActiveServiceEndpoint;
                        text           = buildManager.GetCommitsLog(server.ActiveServiceEndpoint);
                        serverName     = server.ServerName;
                    }
                    else if (dgvServerStatus.Rows[dgvServerStatus.SelectedCells[0].RowIndex].DataBoundItem is BuildRecord)
                    {
                        BuildRecord buildRec = (BuildRecord)dgvServerStatus.Rows[dgvServerStatus.SelectedCells[0].RowIndex].DataBoundItem;
                        remoteEndpoint = buildRec.RemoteEndPoint;
                        text           = buildManager.GetSpecificSummaryLogFile(buildRec.RemoteEndPoint, SummaryLogType.Commits, buildRec.submissionDate);
                        serverName     = buildRec.RemoteServerName;
                    }

                    SqlSync.ScriptDisplayForm frmScript = new ScriptDisplayForm(text, serverName, "Commits Log from " + serverName, SqlSync.Highlighting.SyntaxHightlightType.RemoteServiceLog, remoteEndpoint);
                    frmScript.LoggingLinkClicked += new LoggingLinkClickedEventHandler(frmScript_LoggingLinkClicked);
                    frmScript.Show();
                }
                catch (System.ServiceModel.CommunicationObjectFaultedException comExe)
                {
                    MessageBox.Show("There was a communication issue retrieving the log file.\r\nTo try to clear the communication error, try closing this page and reopening. If that does not work, you may need to restart the service on the target remote execution server.\r\n\r\nError Message:\r\n" + comExe.Message, "Whoops!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Exception exe)
                {
                    MessageBox.Show("There was an issue retrieving the log file.\r\n" + exe.Message, "Whoops!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Esempio n. 5
0
        private void txtDetailedLogTarget_KeyDown(object sender, KeyEventArgs e)
        {
            if (this.SourceControl is DataGridView)
            {
                DataGridView dgvServerStatus = (DataGridView)this.SourceControl;

                if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Enter)
                {
                    if (dgvServerStatus.SelectedCells.Count == 0 || txtDetailedLogTarget.Text.Length == 0)
                    {
                        return;
                    }
                    try
                    {
                        string serverName = string.Empty;
                        string text       = string.Empty;
                        if (dgvServerStatus.Rows[dgvServerStatus.SelectedCells[0].RowIndex].DataBoundItem is ServerConfigData)
                        {
                            ServerConfigData server = (ServerConfigData)dgvServerStatus.Rows[dgvServerStatus.SelectedCells[0].RowIndex].DataBoundItem;
                            text       = buildManager.GetDetailedDatabaseLog(server.ActiveServiceEndpoint, txtDetailedLogTarget.Text);
                            serverName = server.ServerName;
                        }
                        else if (dgvServerStatus.Rows[dgvServerStatus.SelectedCells[0].RowIndex].DataBoundItem is BuildRecord)
                        {
                            BuildRecord buildRec = (BuildRecord)dgvServerStatus.Rows[dgvServerStatus.SelectedCells[0].RowIndex].DataBoundItem;
                            text       = buildManager.GetSpecificDetailedDatabaseLog(buildRec.RemoteEndPoint, txtDetailedLogTarget.Text, buildRec.submissionDate);
                            serverName = buildRec.RemoteServerName;
                        }

                        SqlSync.ScriptDisplayForm frmScript = new ScriptDisplayForm(text, serverName, "Detailed Log from " + txtDetailedLogTarget.Text);
                        frmScript.Show();

                        txtDetailedLogTarget.Text = string.Empty;
                    }
                    catch (Exception exe)
                    {
                        MessageBox.Show("There was an issue retrieving the log file.\r\n" + exe.Message, "Whoops!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }