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(); } } }