FrmExceptionMsg.cs
2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace OnlineStore.AssemblyLine
{
internal partial class FrmExceptionMsg : FrmBase
{
public FrmExceptionMsg()
{
InitializeComponent();
}
private void FrmTrayInfo_Load(object sender, EventArgs e)
{
loadMsg();
}
private void loadMsg()
{
try
{
List<ExceptionMsg> msgList = ExceptionMsgManager.getList();
dataGridView1.Rows.Clear();
foreach (ExceptionMsg msg in msgList)
{
try
{
if (msg == null)
{
continue;
}
DataGridViewRow row = new DataGridViewRow();
row.CreateCells(dataGridView1);
row.Cells[Column_Module.Index].Value = msg.module;
row.Cells[Column_Name.Index].Value = msg.name;
row.Cells[Column_Time.Index].Value = msg.updateTime.ToString("yyyy-MM-dd HH:mm:ss");
row.Cells[Column_Msg.Index].Value = msg.message;
dataGridView1.Rows.Add(row);
}
catch (Exception ex) { LogUtil.error("FrmExceptionMsg loadMsg error:" + ex.ToString()); }
}
}
catch (Exception ex) { LogUtil.error("FrmExceptionMsg loadMsg error:" + ex.ToString()); }
}
private void btnUpdate_Click(object sender, EventArgs e)
{
loadMsg();
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
private void FrmTrayInfo_SizeChanged(object sender, EventArgs e)
{
this.Left = Screen.PrimaryScreen.Bounds.Width / 2 - this.Width / 2;//桌面的宽度的一半减去自身宽的的一半
this.Top = Screen.PrimaryScreen.Bounds.Height / 2 - this.Height / 2;//桌面的高度的一半减去自身高度的一半
}
}
}