|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
Lists = sysLogService.GetLogInfos();
|
|
|
|
|
LogDataGridView.DataSource = null;
|
|
|
|
|
LogDataGridView.DataSource = Lists;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SelectRole_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
List<SysLogEntity> list = sysLogService.GetLogInfos();
|
|
|
|
|
|
|
|
|
|
int? p1 = GeneralUtils.StringNullOrToInt(P1TextBox.Text);
|
|
|
|
|
int? p2 = GeneralUtils.StringNullOrToInt(P2TextBox.Text);
|
|
|
|
|
int? p3 = GeneralUtils.StringNullOrToInt(P3TextBox.Text);
|
|
|
|
|
|
|
|
|
|
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) &&
|
|
|
|
|
(!p1.HasValue || x.P1 == p1.Value) &&
|
|
|
|
|
(!p2.HasValue || x.P2 == p2.Value) &&
|
|
|
|
|
(!p3.HasValue || x.P3 == p3.Value) &&
|
|
|
|
|
(!logTimeChecked || (x.LogTime >= logBeginTime && x.LogTime <= logEndTime))
|
|
|
|
|
).ToList();
|
|
|
|
|
|
|
|
|
|
LogDataGridView.DataSource = null;
|
|
|
|
|
LogDataGridView.DataSource = Lists;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|