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/FormAlarm.cs

79 lines
2.3 KiB
C#

1 month ago
using DB.Dto;
using DB.Service;
using HZH_Controls.Controls;
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 RfidWeb.Frm
{
public partial class FormAlarm : UserControl
{
private UserDto OlduserDto;
private PointLogService PointLogService = new PointLogService();
public FormAlarm()
{
InitializeComponent();
OlduserDto = UserManager.GetUser();
Init();
}
private void Init()
{
List<DataGridViewColumnEntity> lstCulumns = new List<DataGridViewColumnEntity>
{
new DataGridViewColumnEntity() { DataField = "PointName", HeadText = "名称", Width = 90, WidthType = SizeType.Absolute },
new DataGridViewColumnEntity() { DataField = "Msg", HeadText = "异常内容", Width = 700, WidthType = SizeType.Absolute },
};
ucDataGridViewContent.AutoScroll = false;
this.ucDataGridViewContent.Columns = lstCulumns;
this.ucDataGridViewContent.IsShowCheckBox = true;
ucPagerControl21.PageModel = PageModel.PageCount;
ucPagerControl21.PageIndex = 1;
ucPagerControl21.PageSize = 20;
}
private void ucPagerControl21_ShowSourceChanged(object currentSource)
{
string key = this.textBoxSel.Text.Trim();
var index = ucPagerControl21.PageIndex;
var page = PointLogService.GetPagedList(index, ucPagerControl21.PageSize,key);
ucPagerControl21.PageCount = page.Totals.ToInt();
this.ucDataGridViewContent.DataSource = page.DataList;
var dataGridViewRows = ucDataGridViewContent.SelectRows;
foreach (var row in dataGridViewRows)
{
if (row.IsChecked)
{
row.IsChecked = false;
}
}
}
private void ucBtnSelect_BtnClick(object sender, EventArgs e)
{
ucPagerControl21.PageIndex = 1;
ucPagerControl21_ShowSourceChanged(new object());
}
}
}