CRVM-redis-6/client/LogForm.cs

53 lines
1.6 KiB
C#
Raw Normal View History

2025-11-07 02:02:31 +08:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CRVM.CIDExcuter;
namespace CRVM
{
public partial class LogForm : Form
{
string[] columnArrayCoilInfo = { "序号", "时间", "内容", "用户名" };
int[] columnArrayCoilInfoWidth = { 100, 150, 440, 100 };
public LogForm()
{
InitializeComponent();
}
private void btn_SearchByDate_Click(object sender, EventArgs e)
{
DataTable data = DbHelper.GetInstance("").GetLogInfoByDate(date_Start.Value, date_End.Value);
dataGrid_logInfo.DataSource = data;
ResetCoilInfoDataGridView(dataGrid_logInfo);
}
private void LogForm_Load(object sender, EventArgs e)
{
date_Start.Value = DateTime.Now.AddDays(-7);
date_End.Value = DateTime.Now.AddDays(1);
DataTable data = DbHelper.GetInstance("").GetLogInfoByDate(date_Start.Value, date_End.Value);
dataGrid_logInfo.DataSource = data;
ResetCoilInfoDataGridView(dataGrid_logInfo);
}
private void ResetCoilInfoDataGridView(DataGridView dgv)
{
for (int i = 0; i < dgv.Columns.Count; i++)
{
dgv.Columns[i].HeaderText = columnArrayCoilInfo[i];
dgv.Columns[i].Name = columnArrayCoilInfo[i];
dgv.Columns[i].Width = columnArrayCoilInfoWidth[i];
dgv.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
}
}
}
}