Exemple #1
0
        protected string GetValueDescription(AuditEvent auditEvent, int valueTypeId, AuditEventValueTypeRepository auditEventValueTypeRepository, List <AuditEventValueConverter> valueConverters)
        {
            string          eventDescription = "";
            AuditEventValue auditEventValue  = auditEvent.GetValueByValueTypeId(valueTypeId);

            if (auditEventValue != null && auditEventValue.Value != null)
            {
                AuditEventValueType      auditEventValueType      = auditEventValueTypeRepository.GetByID(auditEventValue.TypeID);
                AuditEventValueConverter auditEventValueConverter = valueConverters.Find(current => current.Handles(auditEventValue.TypeID));
                if (auditEventValueConverter != null)   // Sanity check
                {
                    eventDescription = auditEventValueConverter.ValueConverter.Convert(auditEventValue.Value, auditEventValueType.Type, typeof(String)).ToString();
                }
            }
            return(eventDescription);
        }
        /// <summary>
        /// Posts message to MS Teams channel
        /// </summary>
        /// <param name="auditEvent"></param>
        /// <param name="auditEventType"></param>
        /// <param name="postMessageSettings"></param>
        public void PostMessage(AuditEvent auditEvent, AuditEventType auditEventType, MSTeamsPostMessageSettings postMessageSettings)
        {
            AuditEventValueTypeRepository auditEventValueTypeRepository = new AuditEventValueTypeRepository();

            //Get Message value
            AuditEventValue auditEventValueMessage              = auditEvent.GetValueByValueTypeId(AuditEventValueTypes.Message);
            AuditEventValue auditEventValueRunId                = auditEvent.GetValueByValueTypeId(AuditEventValueTypes.GamePlanRunID);
            AuditEventValue auditEventValueScenarioId           = auditEvent.GetValueByValueTypeId(AuditEventValueTypes.GamePlanScenarioID);
            AuditEventValue auditEventValueAutoBookId           = auditEvent.GetValueByValueTypeId(AuditEventValueTypes.GamePlanAutoBookID);
            AuditEventValue auditEventValuePipelineErrorMessage = auditEvent.GetValueByValueTypeId(AuditEventValueTypes.GamePlanPipelineEventErrorMessage);

            // Determine if sub event is set
            string subEvent = "";

            foreach (int valueTypeId in new int[] { AuditEventValueTypes.GamePlanPipelineEventID, AuditEventValueTypes.GamePlanAutoBookEventID })
            {
                subEvent = GetValueDescription(auditEvent, valueTypeId, auditEventValueTypeRepository, _valueConverters);
                if (!String.IsNullOrEmpty(subEvent))
                {
                    break;
                }
            }

            StringBuilder title = new StringBuilder(auditEventType.Description);

            if (!String.IsNullOrEmpty(subEvent))
            {
                title.Append(string.Format(" - {0}", subEvent));
            }

            // Set Run/Scenario details
            Run           run     = null;
            StringBuilder message = new StringBuilder(title.ToString());

            if (auditEventValueRunId != null || auditEventValueScenarioId != null)
            {
                using (var scope = _repositoryFactory.BeginRepositoryScope())
                {
                    var runRepository = scope.CreateRepository <IRunRepository>();
                    run = (auditEventValueRunId != null ? runRepository.Find((Guid)auditEventValueRunId.Value) : runRepository.FindByScenarioId((Guid)auditEventValueScenarioId.Value));

                    message.Append(message.Length == 0 ? "" : "; ");
                    message.Append(string.Format("Description: {0}; Run ID: {1}", run.Description, MSTeamsMessageFormatter.FormatHyperlink(run.Id.ToString(), WebLinkFactory.GetRunDetailsURL(_frontendUrl, run.Id))));

                    if (auditEventValueScenarioId != null)
                    {
                        message.Append(message.Length == 0 ? "" : "; ");
                        message.Append(string.Format("Scenario ID: {0}", MSTeamsMessageFormatter.FormatHyperlink(auditEventValueScenarioId.Value.ToString(), WebLinkFactory.GetOptimiserReportURL(_frontendUrl, run.Id, (Guid)auditEventValueScenarioId.Value))));
                    }
                }
            }

            // Set AutoBook details
            if (auditEventValueAutoBookId != null)
            {
                message.Append(message.Length == 0 ? "" : "; ");
                message.Append(string.Format("AutoBook ID: {0}", MSTeamsMessageFormatter.FormatHyperlink(auditEventValueAutoBookId.Value.ToString(), WebLinkFactory.GetAutoBookURL(_frontendUrl, (Guid)auditEventValueAutoBookId.Value))));
            }

            // Set pipeline error
            if (auditEventValuePipelineErrorMessage != null)
            {
                message.Append(message.Length == 0 ? "" : "; ");
                message.Append(string.Format("Error: {0}", auditEventValuePipelineErrorMessage.Value.ToString()));
            }

            // Set message
            if (auditEventValueMessage != null)
            {
                message.Append(message.Length == 0 ? "" : "; ");
                message.Append(string.Format("Message: {0}", auditEventValueMessage.Value.ToString()));
            }

            // Post message
            _msTeamsREST.PostSimpleMessage(postMessageSettings.Url, "", message.ToString());
        }
Exemple #3
0
        public MailMessage CreateEmail(AuditEvent auditEvent)
        {
            // Determine if we need to generate email
            EmailAuditEventSettings emailAuditEventSettings = _emailAuditEventSettingsList.Find(s => s.EventTypeId == auditEvent.EventTypeID);

            if (!Handles(auditEvent))
            {
                return(null);
            }

            AuditEventValueTypeRepository auditEventValueTypeRepository = new AuditEventValueTypeRepository();
            AuditEventType auditEventType = new AuditEventTypeRepository().GetByID(auditEvent.EventTypeID);

            // Determine if sub event is set
            string subEvent = "";

            foreach (int valueTypeId in new int[] { AuditEventValueTypes.GamePlanPipelineEventID, AuditEventValueTypes.GamePlanAutoBookEventID })
            {
                subEvent = GetValueDescription(auditEvent, valueTypeId, auditEventValueTypeRepository, _valueConverters);
                if (!String.IsNullOrEmpty(subEvent))
                {
                    break;
                }
            }

            MailMessage mail = new MailMessage();

            if (!String.IsNullOrEmpty(subEvent))   // Sub event indicated
            {
                mail.Subject = string.Format("[{0}] {1}: {2}: {3}", _environmentId, Globals.ProductName, auditEventType.Description, subEvent);
            }
            else
            {
                mail.Subject = string.Format("[{0}] {1}: {2}", _environmentId, Globals.ProductName, auditEventType.Description);
            }
            mail.Sender     = new MailAddress(emailAuditEventSettings.NotificationSettings.SenderAddress, emailAuditEventSettings.NotificationSettings.SenderAddress);
            mail.From       = new MailAddress(emailAuditEventSettings.NotificationSettings.SenderAddress, emailAuditEventSettings.NotificationSettings.SenderAddress);
            mail.Body       = GetBody(auditEvent, subEvent, _valueConverters, auditEventValueTypeRepository);
            mail.IsBodyHtml = mail.Body.ToLower().Contains("<html>") && (mail.Body.ToLower().Contains("<head>") || mail.Body.ToLower().Contains("<head/>"));

            // Check if specific email address indicated in audit event
            List <AuditEventValue> recipientAuditEventValues = new List <AuditEventValue>();
            AuditEventValue        recipientAuditEventValue  = auditEvent.GetValueByValueTypeId(AuditEventValueTypes.RecipientEmailAddress);

            if (recipientAuditEventValue != null)
            {
                recipientAuditEventValues.Add(recipientAuditEventValue);
            }
            if (recipientAuditEventValues.Count == 0)
            {
                for (int index = 0; index < emailAuditEventSettings.NotificationSettings.RecipientAddresses.Count; index++)
                {
                    mail.To.Add(new MailAddress(emailAuditEventSettings.NotificationSettings.RecipientAddresses[index], emailAuditEventSettings.NotificationSettings.RecipientAddresses[index]));
                }
            }
            else
            {
                foreach (AuditEventValue auditEventValue in recipientAuditEventValues)
                {
                    mail.To.Add(new MailAddress(auditEventValue.Value.ToString()));
                }
            }
            if (emailAuditEventSettings.NotificationSettings.CCAddresses != null)
            {
                emailAuditEventSettings.NotificationSettings.CCAddresses.ForEach(address => mail.CC.Add(new MailAddress(address, address)));
            }

            /*
             * foreach (AuditEventValue auditEventValue in auditEvent.Values.Where(item => item.TypeID == AuditEventValueTypes.EmailAttachment))
             * {
             *  mail.Attachments.Add(new Attachment(auditEventValue.Value.ToString()));
             * }
             */
            return(mail);
        }
Exemple #4
0
        private DataTable GetValuesDataTable(AuditEvent auditEvent, AuditEventType auditEventType, string subEvent, AuditEventValueTypeRepository auditEventValueTypeRepository)
        {
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("Item", typeof(String));
            dataTable.Columns.Add("Value", typeof(String));

            // Add standard header
            AddValuesRow(dataTable, "Time", auditEvent.TimeCreated.ToString());
            AddValuesRow(dataTable, "Event ID", auditEvent.ID);
            AddValuesRow(dataTable, "Event", string.IsNullOrEmpty(subEvent) ? auditEventType.Description : string.Format("{0} - {1}", auditEventType.Description, subEvent));

            // Add other values
            HashSet <int> valueTypesDone = new HashSet <int>()
            {
                AuditEventValueTypes.GamePlanRunID, AuditEventValueTypes.GamePlanPipelineEventID, AuditEventValueTypes.GamePlanAutoBookEventID
            };

            foreach (AuditEventValue auditEventValue in auditEvent.Values)
            {
                if (!valueTypesDone.Contains(auditEventValue.TypeID))   // Ignore values done above
                {
                    AuditEventValueType auditEventValueType = auditEventValueTypeRepository.GetByID(auditEventValue.TypeID);
                    if (!auditEventValueType.Internal)
                    {
                        AuditEventValueConverter auditEventValueConverter = _valueConverters.Find(current => current.Handles(auditEventValue.TypeID));
                        if (auditEventValueConverter != null)
                        {
                            AddValuesRow(dataTable, auditEventValueType.Description, auditEventValueConverter.ValueConverter.Convert(auditEventValue.Value, auditEventValueType.Type, typeof(String)).ToString());
                        }
                        else
                        {
                            AddValuesRow(dataTable, auditEventValueType.Description, auditEventValue.Value.ToString());
                        }
                    }
                }
            }
            return(dataTable);
        }
Exemple #5
0
        /// <summary>
        /// Returns email body. Email has header details (event type, event type etc) and table for each audit event value.
        /// </summary>
        /// <param name="auditEvent"></param>
        /// <returns></returns>
        private string GetBody(AuditEvent auditEvent, string subEvent, List <AuditEventValueConverter> valueConverters, AuditEventValueTypeRepository auditEventValueTypeRepository)
        {
            AuditEventType auditEventType = new AuditEventTypeRepository().GetByID(auditEvent.EventTypeID);
            StringBuilder  html           = new StringBuilder(string.Format("<html><head>{0}</head><body>", GetStyle()));

            html.Append("<table>");
            //html.Append("<tr><th>Item</th><th>Value</th></tr>");
            DataTable valuesDataTable = GetValuesDataTable(auditEvent, auditEventType, subEvent, auditEventValueTypeRepository);

            for (int rowIndex = 0; rowIndex < valuesDataTable.Rows.Count; rowIndex++)
            {
                html.Append(string.Format("<tr><td><B>{0}</B></td><td>{1}</td></tr>", valuesDataTable.Rows[rowIndex]["Item"].ToString(), valuesDataTable.Rows[rowIndex]["Value"].ToString()));
            }
            html.Append("</table>");
            html.Append("</body>");
            html.Append("</html>");
            return(html.ToString());
        }
        /// <summary>
        /// Posts message to MS Teams channel
        /// </summary>
        /// <param name="auditEvent"></param>
        /// <param name="auditEventType"></param>
        /// <param name="postMessageSettings"></param>
        public void PostMessage(AuditEvent auditEvent, AuditEventType auditEventType, MSTeamsPostMessageSettings postMessageSettings)
        {
            AuditEventValueTypeRepository auditEventValueTypeRepository = new AuditEventValueTypeRepository();

            //Get Message value
            AuditEventValue auditEventValueMessage    = auditEvent.GetValueByValueTypeId(AuditEventValueTypes.Message);
            AuditEventValue auditEventValueRunId      = auditEvent.GetValueByValueTypeId(AuditEventValueTypes.GamePlanRunID);
            AuditEventValue auditEventValueScenarioId = auditEvent.GetValueByValueTypeId(AuditEventValueTypes.GamePlanScenarioID);
            AuditEventValue auditEventValueAutoBookId = auditEvent.GetValueByValueTypeId(AuditEventValueTypes.GamePlanAutoBookID);

            // Determine if sub event is set
            string subEvent = "";

            foreach (int valueTypeId in new int[] { AuditEventValueTypes.GamePlanPipelineEventID, AuditEventValueTypes.GamePlanAutoBookEventID })
            {
                subEvent = GetValueDescription(auditEvent, valueTypeId, auditEventValueTypeRepository, _valueConverters);
                if (!String.IsNullOrEmpty(subEvent))
                {
                    break;
                }
            }

            List <string> detailsTextList = new List <string>();
            List <string> detailsUrlList  = new List <string>();

            StringBuilder title = new StringBuilder(auditEventType.Description);

            if (!String.IsNullOrEmpty(subEvent))
            {
                title.Append(string.Format(" - {0}", subEvent));
            }

            // Set Run/Scenario details
            Run           run     = null;
            StringBuilder message = new StringBuilder("");

            if (auditEventValueRunId != null || auditEventValueScenarioId != null)
            {
                using (var scope = _repositoryFactory.BeginRepositoryScope())
                {
                    var runRepository = scope.CreateRepository <IRunRepository>();
                    run = (auditEventValueRunId != null ? runRepository.Find((Guid)auditEventValueRunId.Value) : runRepository.FindByScenarioId((Guid)auditEventValueScenarioId.Value));

                    if (auditEventValueScenarioId == null)
                    {
                        // Set URL
                        detailsUrlList.Add(WebLinkFactory.GetRunDetailsURL(_frontendUrl, run.Id));
                        detailsTextList.Add("Run Details");
                    }
                    else
                    {
                        detailsUrlList.Add(WebLinkFactory.GetRunDetailsURL(_frontendUrl, run.Id));
                        detailsTextList.Add("Run Details");

                        // Set URL
                        detailsUrlList.Add(WebLinkFactory.GetOptimiserReportURL(_frontendUrl, run.Id, (Guid)auditEventValueScenarioId.Value));
                        detailsTextList.Add("Scenario Details");
                    }
                }
            }

            // Set AutoBook details
            if (auditEventValueAutoBookId != null)
            {
                detailsUrlList.Add(WebLinkFactory.GetAutoBookURL(_frontendUrl, (Guid)auditEventValueAutoBookId.Value));
                detailsTextList.Add("AutoBook Details");
            }

            DataTable dataTable = GetValuesDataTable(auditEvent, run, auditEventType, subEvent, auditEventValueTypeRepository, _valueConverters);

            foreach (DataRow dataRow in dataTable.Rows)
            {
                message.Append(message.Length == 0 ? "" : "; ");        //message.Append(message.Length == 0 ? "" : "<BR/>");
                message.Append(string.Format("{0}: {1}", dataRow[0].ToString(), dataRow[1].ToString()));
            }

            // Post message
            _msTeamsREST.PostMessageCard(postMessageSettings.Url, "Title", title.ToString(), message.ToString(), detailsTextList, detailsUrlList);
        }
Exemple #7
0
        public MailMessage CreateEmail(AuditEvent auditEvent)
        {
            // Determine if we need to generate email
            if (!Handles(auditEvent))
            {
                return(null);
            }

            using (var scope = _repositoryFactory.BeginRepositoryScope())
            {
                EmailAuditEventSettings emailAuditEventSettings = _emailAuditEventSettingsList.Find(s => s.EventTypeId == auditEvent.EventTypeID);

                AuditEventValueTypeRepository auditEventValueTypeRepository = new AuditEventValueTypeRepository();

                // Determine if sub event is set
                string subEvent = "";
                foreach (int valueTypeId in new int[] { AuditEventValueTypes.GamePlanPipelineEventID, AuditEventValueTypes.GamePlanAutoBookEventID })
                {
                    subEvent = GetValueDescription(auditEvent, valueTypeId, auditEventValueTypeRepository, _valueConverters);
                    if (!String.IsNullOrEmpty(subEvent))
                    {
                        break;
                    }
                }

                // Get run details, check if specific scenario specified
                var             runRepository             = scope.CreateRepository <IRunRepository>();
                AuditEventValue runIdAuditEventValue      = auditEvent.GetValueByValueTypeId(AuditEventValueTypes.GamePlanRunID);
                AuditEventValue scenarioIdAuditEventValue = auditEvent.GetValueByValueTypeId(AuditEventValueTypes.GamePlanScenarioID);
                Run             run = runRepository.Find((Guid)runIdAuditEventValue.Value);

                AuditEventType auditEventType = new AuditEventTypeRepository().GetByID(auditEvent.EventTypeID);
                MailMessage    mail           = new MailMessage();
                if (!String.IsNullOrEmpty(subEvent))   // No pipeline event
                {
                    mail.Subject = string.Format("[{0}] {1}: {2}: {3}", _environmentId, Globals.ProductName, auditEventType.Description, subEvent);
                }
                else
                {
                    mail.Subject = string.Format("[{0}] {1}: {2}", _environmentId, Globals.ProductName, auditEventType.Description);
                }

                // Indicate if run failed in subject, bit of a hack as we have to check the message string
                if (auditEvent.EventTypeID == AuditEventTypes.GamePlanRunCompleted)
                {
                    string message = GetValueDescription(auditEvent, AuditEventValueTypes.Message, auditEventValueTypeRepository, _valueConverters);
                    if (!String.IsNullOrEmpty(message) && message.ToLower().Contains("errors"))
                    {
                        mail.Subject = mail.Subject + string.Format(" ({0})", message);
                    }
                }

                // Load scenarios
                var scenarioRepository = scope.CreateRepository <IScenarioRepository>();

                var             scenarioIds = run.Scenarios.Select(e => e.Id).Distinct().ToArray();
                List <Scenario> scenarios   = scenarioRepository.FindByIds(scenarioIds).ToList();

                mail.Sender = new MailAddress(emailAuditEventSettings.NotificationSettings.SenderAddress, emailAuditEventSettings.NotificationSettings.SenderAddress);
                mail.From   = new MailAddress(emailAuditEventSettings.NotificationSettings.SenderAddress, emailAuditEventSettings.NotificationSettings.SenderAddress);
                mail.Body   = scenarioIdAuditEventValue == null?GetBody(auditEvent, auditEventType, run, scenarios, subEvent, auditEventValueTypeRepository) : GetBody(auditEvent, auditEventType, run, (Guid)scenarioIdAuditEventValue.Value, scenarios.First(s => s.Id == (Guid)scenarioIdAuditEventValue.Value), subEvent, auditEventValueTypeRepository);

                mail.IsBodyHtml = mail.Body.ToLower().Contains("<html>") && (mail.Body.ToLower().Contains("<head>") || mail.Body.ToLower().Contains("<head/>"));

                // Check if specific email address indicated in audit event

                List <AuditEventValue> recipientAuditEventValues = new List <AuditEventValue>();
                AuditEventValue        recipientAuditEventValue  = auditEvent.GetValueByValueTypeId(AuditEventValueTypes.RecipientEmailAddress);
                if (recipientAuditEventValue != null)
                {
                    recipientAuditEventValues.Add(recipientAuditEventValue);
                }
                if (recipientAuditEventValues.Count == 0)
                {
                    for (int index = 0; index < emailAuditEventSettings.NotificationSettings.RecipientAddresses.Count; index++)
                    {
                        mail.To.Add(new MailAddress(emailAuditEventSettings.NotificationSettings.RecipientAddresses[index], emailAuditEventSettings.NotificationSettings.RecipientAddresses[index]));
                    }
                }
                else
                {
                    foreach (AuditEventValue auditEventValue in recipientAuditEventValues)
                    {
                        mail.To.Add(new MailAddress(auditEventValue.Value.ToString()));
                    }
                }
                if (emailAuditEventSettings.NotificationSettings.CCAddresses != null)
                {
                    emailAuditEventSettings.NotificationSettings.CCAddresses.ForEach(address => mail.CC.Add(new MailAddress(address, address)));
                }

                /*
                 * foreach (AuditEventValue auditEventValue in auditEvent.Values.Where(item => item.TypeID == AuditEventValueTypes.EmailAttachment))
                 * {
                 *  mail.Attachments.Add(new Attachment(auditEventValue.Value.ToString()));
                 * }
                 */
                return(mail);
            }
        }
Exemple #8
0
        /// <summary>
        /// Returns email body. Email has header details (event type, event type etc) and table for each audit event value.
        /// </summary>
        /// <param name="auditEvent"></param>
        /// <returns></returns>
        private string GetBody(AuditEvent auditEvent, AuditEventType auditEventType, Run run, Guid scenarioId, Scenario scenario, string pipelineEvent, AuditEventValueTypeRepository auditEventValueTypeRepository)
        {
            StringBuilder text = new StringBuilder("<table>");
            //text.Append("<tr><th>Item</th><th>Value</th></tr>");
            DataTable valuesDataTable = GetValuesDataTable(auditEvent, run, auditEventType, pipelineEvent, auditEventValueTypeRepository);

            for (int rowIndex = 0; rowIndex < valuesDataTable.Rows.Count; rowIndex++)
            {
                text.Append(string.Format("<tr><td><B>{0}</B></td><td>{1}</td></tr>", valuesDataTable.Rows[rowIndex]["Item"].ToString(), valuesDataTable.Rows[rowIndex]["Value"].ToString()));
            }
            text.Append("</table><BR/>");

            text.Append("<B>Scenario</B><BR/><table>");
            text.Append("<tr><th>Scenario ID</th><th>Passes</th><th>Started</th><th>Completed</th><th>Status</th></tr>");
            foreach (var runScenario in run.Scenarios.Where(s => s.Id == scenarioId))
            {
                string scenarioUrl = string.Format(@"{0}/#/optimizer-report/{1}/{2}", _frontendUrl, run.Id, runScenario.Id);
                text.Append(string.Format("<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td></tr>", CreateHTMLLink(runScenario.Id.ToString(), scenarioUrl), scenario.Passes.Count,
                                          (runScenario.StartedDateTime == null ? "n/a" : runScenario.StartedDateTime.Value.ToString()),
                                          (runScenario.CompletedDateTime == null ? "n/a" : runScenario.CompletedDateTime.Value.ToString()),
                                          runScenario.Status.ToString()));
            }
            text.Append("</table>");
            return(string.Format("<html><head>{0}</head><body>{1}</body></html>", GetStyle(), text.ToString()));
        }
Exemple #9
0
        private DataTable GetValuesDataTable(AuditEvent auditEvent, Run run, AuditEventType auditEventType, string subEvent, AuditEventValueTypeRepository auditEventValueTypeRepository)
        {
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("Item", typeof(String));
            dataTable.Columns.Add("Value", typeof(String));

            string runUrl = string.Format(@"{0}/#/manage-runs", _frontendUrl);

            // Add standard header
            AddValuesRow(dataTable, "Time", auditEvent.TimeCreated.ToString());
            AddValuesRow(dataTable, "Event ID", auditEvent.ID);
            AddValuesRow(dataTable, "Event", string.IsNullOrEmpty(subEvent) ? auditEventType.Description : string.Format("{0} - {1}", auditEventType.Description, subEvent));

            // Add values from Run ID
            AddValuesRow(dataTable, "Run ID", CreateHTMLLink(run.Id.ToString(), runUrl));
            AddValuesRow(dataTable, "Description", run.Description);
            AddValuesRow(dataTable, "Date Range", string.Format("{0} - {1}", run.StartDate.ToString(), run.EndDate.ToString()));
            AddValuesRow(dataTable, "Created", run.CreatedDateTime.ToString());
            AddValuesRow(dataTable, "Executed", run.ExecuteStartedDateTime == null ? "n/a" : run.ExecuteStartedDateTime.Value.ToString());
            if (run.CompletedScenarios.Count == run.Scenarios.Count && run.LastScenarioCompletedDateTime != null)
            {
                AddValuesRow(dataTable, "Completed", run.LastScenarioCompletedDateTime.Value.ToString());
            }

            // Add other values
            HashSet <int> valueTypesDone = new HashSet <int>()
            {
                AuditEventValueTypes.GamePlanRunID, AuditEventValueTypes.GamePlanPipelineEventID, AuditEventValueTypes.GamePlanAutoBookEventID
            };

            foreach (AuditEventValue auditEventValue in auditEvent.Values)
            {
                if (!valueTypesDone.Contains(auditEventValue.TypeID))   // Ignore values done above
                {
                    AuditEventValueType auditEventValueType = auditEventValueTypeRepository.GetByID(auditEventValue.TypeID);
                    if (!auditEventValueType.Internal)
                    {
                        AuditEventValueConverter auditEventValueConverter = _valueConverters.Find(current => current.Handles(auditEventValue.TypeID));
                        if (auditEventValueConverter != null)
                        {
                            AddValuesRow(dataTable, auditEventValueType.Description, auditEventValueConverter.ValueConverter.Convert(auditEventValue.Value, auditEventValueType.Type, typeof(String)).ToString());
                        }
                        else
                        {
                            AddValuesRow(dataTable, auditEventValueType.Description, auditEventValue.Value.ToString());
                        }
                    }
                }
            }
            return(dataTable);
        }