You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CaiQie/RfidWeb/Frm/UserAlarmShow.cs

68 lines
1.7 KiB
C#

1 week ago
using DB.Entity;
using HZH_Controls.Controls;
using HZH_Controls.Forms;
using NewLife.Caching;
using NewLife.Reflection;
using NewLife.Threading;
using System;
2 weeks ago
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
1 week ago
using DB.Service;
using Tool;
using Tool.Model;
2 weeks ago
namespace RfidWeb.Frm
{
public partial class UserAlarmShow : UserControl
{
1 week ago
private TimerX _timer;
private HimAlarmManager himAlarmManager = new HimAlarmManager();
2 weeks ago
public UserAlarmShow()
{
InitializeComponent();
1 week ago
_timer = new TimerX(TimeState, null, 1000, 1200);
}
void TimeState(Object state)
{
var dataTime = DateTime.Now;
List< GridViewData > lsList=new List< GridViewData >();
var list = himAlarmManager.GetList();
foreach (var keyValuePair in list)
{
lsList.Add(new GridViewData()
{
AlartTime = keyValuePair.Value.ToString("MM-dd HH:mm:ss"),
Msg = keyValuePair.Key
});
}
this.Invoke(() =>
{
int currentFirstVisibleRowIndex = dataGridView1.FirstDisplayedScrollingRowIndex;
this.dataGridView1.DataSource=lsList;
if (currentFirstVisibleRowIndex > 0)
{
dataGridView1.FirstDisplayedScrollingRowIndex = currentFirstVisibleRowIndex;
}
1 week ago
});
// ThreadPoolX.QueueUserWorkItem(UpdateLog);
}
1 week ago
2 weeks ago
}
}