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

60 lines
1.5 KiB
C#

1 week ago
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.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RfidWeb.Frm
{
public partial class FromAlarmLog : UserControl
{
private AlarmLogService logService = new AlarmLogService();
public FromAlarmLog()
{
InitializeComponent();
Init();
}
private void Init()
{
this.dataGridView1.AutoGenerateColumns = false;
ucPagerControl21.PageModel = PageModel.PageCount;
ucPagerControl21.PageIndex = 1;
ucPagerControl21.PageSize = 20;
}
private void Replace()
{
ucPagerControl21.PageIndex = 1;
ucPagerControl21_ShowSourceChanged(new object());
}
private void ucPagerControl21_ShowSourceChanged(object currentSource)
{
string key = textBoxSel.Text;
int index = ucPagerControl21.PageIndex;
var page = logService.GetPagedList(index, ucPagerControl21.PageSize, key, -1);
ucPagerControl21.PageCount = page.TotalPages;
this.dataGridView1.DataSource = page.Items;
}
private void ucBtnSelect_BtnClick(object sender, EventArgs e)
{
Replace();
}
}
}