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.

105 lines
3.0 KiB
C#

using HighWayIot.Repository.domain;
using HighWayIot.Repository.service.Impl;
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 RFIDSocket
{
public partial class RFIDLog : Form
{
List<RFIDContent> rFIDContents = new List<RFIDContent>();
BaseContentServiceImpl sql = new BaseContentServiceImpl();
public RFIDLog()
{
InitializeComponent();
StartTime.Value = DateTime.Now.AddDays(-3);
List<string> list = new List<string>
{
"",
"NB",
"GR",
"MR"
};
ReadKind.DataSource = list;
Init();
}
private void Init()
{
rFIDContents = sql.GetContentInfos();
}
private void TimeSelect_Click(object sender, EventArgs e)
{
if (LogContent != null)
{
LogContent.DataSource = null;
LogContent.DataSource = LogControl.LogTimeSelect(rFIDContents, StartTime.Value, EndTime.Value);
}
}
private void ReadKindSelect_Click(object sender, EventArgs e)
{
if (LogContent != null)
{
LogContent.DataSource = null;
LogContent.DataSource = LogControl.LogReadKindSelect(rFIDContents, ReadKind.Text);
}
}
private void DeviceNoSelect_Click(object sender, EventArgs e)
{
if(!int.TryParse(DeviceNo.Text, out int no))
{
MessageBox.Show("设备编号格式不正确");
return;
}
if (LogContent != null)
{
LogContent.DataSource = null;
LogContent.DataSource = LogControl.LogDeviceNoSelect(rFIDContents, no);
}
}
private void ContentSelect_Click(object sender, EventArgs e)
{
if (LogContent != null)
{
LogContent.DataSource = null;
LogContent.DataSource = LogControl.LogContentSelect(rFIDContents, Content.Text);
}
}
private void SelectAll_Click(object sender, EventArgs e)
{
if (!int.TryParse(DeviceNo.Text, out int no))
{
MessageBox.Show("设备编号格式不正确");
return;
}
if (LogContent != null)
{
LogContent.DataSource = null;
LogContent.DataSource = LogControl.LogTimeSelect(
LogControl.LogReadKindSelect(
LogControl.LogDeviceNoSelect(
LogControl.LogContentSelect(rFIDContents,
Content.Text),
no),
ReadKind.Text),
StartTime.Value, EndTime.Value);
}
}
}
}