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.
58 lines
1.8 KiB
C#
58 lines
1.8 KiB
C#
using HighWayIot.Repository.domain;
|
|
using HighWayIot.Repository.service;
|
|
using HighWayIot.Winform.Business;
|
|
using System;
|
|
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;
|
|
|
|
namespace HighWayIot.Winform.UserControlPages
|
|
{
|
|
public partial class OperateConfigPage : UserControl
|
|
{
|
|
private static SysLogService sysLogService = SysLogService.Instance;
|
|
|
|
private List<SysLogEntity> Lists;
|
|
|
|
public OperateConfigPage()
|
|
{
|
|
InitializeComponent();
|
|
Init();
|
|
}
|
|
|
|
private void Init()
|
|
{
|
|
LogDataGridView.AutoGenerateColumns = false;
|
|
SelectLogBeginTime.Value = DateTime.Now.AddMonths(-3);
|
|
Lists = sysLogService.GetLogInfos();
|
|
LogDataGridView.DataSource = null;
|
|
LogDataGridView.DataSource = Lists;
|
|
}
|
|
|
|
private void SelectRole_Click(object sender, EventArgs e)
|
|
{
|
|
List<SysLogEntity> list = sysLogService.GetLogInfos();
|
|
|
|
string logText = LogTextTextBox.Text.Trim();
|
|
string operatorName = OperatorNameTextBox.Text.Trim();
|
|
bool logTimeChecked = IsCheckByLogTime.Checked;
|
|
DateTime logBeginTime = SelectLogBeginTime.Value;
|
|
DateTime logEndTime = SelectLogEndTime.Value;
|
|
|
|
Lists = list.Where(x =>
|
|
(string.IsNullOrEmpty(logText) || x.Text.Contains(logText)) &&
|
|
(string.IsNullOrEmpty(operatorName) || x.Operator == operatorName) &&
|
|
(!logTimeChecked || (x.LogTime >= logBeginTime && x.LogTime <= logEndTime))
|
|
).ToList();
|
|
|
|
LogDataGridView.DataSource = null;
|
|
LogDataGridView.DataSource = Lists;
|
|
}
|
|
}
|
|
}
|