Example #1
0
        private void btnSessionTriage_Click(object sender, EventArgs e)
        {
            string errMsg = string.Empty;

            try
            {
                string sessionId = cboSessionIds.Text;
                if (sessionId.Length == 8)
                {
                    rgvTriageData.Rows.Clear();
                    rgvPerformanceMarkers.Rows.Clear();

                    rtbErrorMessage.Text = string.Empty;
                    pbControlPanel.Image = null;
                    pbThumbnail.Image    = null;

                    DbAccess db = new DbAccess(GlobalSettings.Database);
                    using (DataLogContext dlContext = new DataLogContext(db.getConStrSQL()))
                    {
                        var myTriageData = TriageData.GetTriageDataBySessionId(dlContext, sessionId).ToList();
                        if (myTriageData.Any())
                        {
                            dtpStart.Value = myTriageData.First().TriageDateTime;
                            dtpEnd.Value   = myTriageData.Last().TriageDateTime;

                            triageDataListBindingSource.DataSource = myTriageData;
                            triageDataListBindingSource.ResetBindings(false);
                        }
                        else
                        {
                            errMsg = "TriageData does not contain data for the given session ID " + sessionId;
                        }
                    }
                    pbControlPanel.Image = null;
                    pbThumbnail.Image    = null;
                }
                else
                {
                    errMsg = "SessionId is not correctly formatted.";
                }
            }
            catch (Exception ex)
            {
                if (!string.IsNullOrEmpty(errMsg))
                {
                    log.Warn(errMsg);
                }
                else
                {
                    log.Warn(ex);
                    ShowErrorMessage(ex);
                }
            }
            if (!string.IsNullOrEmpty(errMsg))
            {
                MessageBox.Show(errMsg, @"Session ID", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #2
0
        private void RetrieveTriageData(string sessionId)
        {
            DbAccess db = new DbAccess(GlobalSettings.Database);

            using (DataLogContext dlContext = new DataLogContext(db.getConStrSQL()))
            {
                var myTriageData = TriageData.GetTriageDataBySessionId(dlContext, sessionId).ToList();
                _triageDataList = new TriageDataList();
                _triageDataList.AddRange(myTriageData);

                BindTriageDataGrid(_triageDataList);
                lblCountErrors.Text = $@"Error Count={myTriageData.Count}";
            }
            pbControlPanel.Image = null;
            pbThumbnail.Image    = null;
        }