public bool LoadCOSEReportByLogs(COSEReport report) { try { Visible = false; InitializeComunColumns(); InitializeCOSELogReportDGVComponents(); AddCOSELogReportColumns(); int count = 0; _propertyfield1.Text = report.Name; _propertyfield2.Text = report.Id.ToString(); _propertyfield3.Text = report.Type; _propertyfield4.Text = report.Date.ToLongDateString(); _propertyfield5.Text = report.Date.ToLongTimeString(); _propertyfield6.Text = ""; _propertyfield7.Text = ""; _propertyfield8.Text = ""; _propertyfield9.Text = report.FileName; _propertyfield10.Text = report.PathName; _propertyfield11.Text = ""; _propertyfield12.Text = ""; _propertyfield13.Text = ""; InitializeLBL(new int[] { 0, 1, 2, 3, 4, 8, 9 }, new string[] { "Name:", "ID:", "Type:", "Date Created:", "Time Created:", "File Name:", "File Location:" }); PadLabels(15); foreach (COSELog session in report.Sessions) { count = 0; foreach (COACLog log in session.Logs) { _reportDataGrid.Rows.Add(log.Id.ToString(), log.EventName, log.ExtraControls.ToString(), log.StartTime.ToLongTimeString(), log.EndTime.ToLongTimeString(), log.TotalTime.ToString(), log.TotalConsumption.ToString()); count++; } _reportDataGrid.Rows[_reportDataGrid.Rows.Count - count].DefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(150, 200, 160); } Visible = true; return(true); } catch (Exception e) { MessageLogManager.LogMessage(e.Message + e.Data + "\n" + e.InnerException + "\n" + e.Source); return(false); } }
public bool LoadCOSEReportBySession(COSEReport report) { try { Visible = false; InitializeComunColumns(); InitializeCOSESessionReportDGVComponents(); AddCOSESessionReportColumns(); _propertyfield1.Text = report.Name; _propertyfield2.Text = report.Id.ToString(); _propertyfield3.Text = report.Type; _propertyfield4.Text = report.Date.ToLongDateString(); _propertyfield5.Text = report.Date.ToLongTimeString(); _propertyfield6.Text = ""; _propertyfield7.Text = ""; _propertyfield8.Text = ""; _propertyfield9.Text = report.FileName; _propertyfield10.Text = report.PathName; _propertyfield11.Text = ""; _propertyfield12.Text = ""; _propertyfield13.Text = ""; InitializeLBL(new int[] { 0, 1, 2, 3, 4, 8, 9 }, new string[] { "Name:", "ID:", "Type:", "Date Created:", "Time Created:", "File Name:", "File Location:" }); PadLabels(15); foreach (COSELog session in report.Sessions) { _reportDataGrid.Rows.Add(session.Id.ToString(), session.ClientId.ToString(), session.StartTime.ToString(), session.EndTime.ToString(), session.TotalTime.ToString(), session.TotalConsumption.ToString()); } Visible = true; return(true); } catch (Exception e) { MessageLogManager.LogMessage(e.Message + e.Data + "\n" + e.InnerException + "\n" + e.Source); return(false); } }