private void dataGridViewPagingSumCtrl_CurrentPageIndexChanged(int index) { try { if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } if (this.para == null) { return; } para.PageIndex = index; SignRecordPage listPage = CommonGlobalCache.ServerProxy.GetSignRecordPage(para); //这里不用调初始化分页 this.BindingSource(listPage); } catch (Exception ee) { ShowError(ee); } finally { UnLockPage(); } }
private void BaseButton_search_Click(object sender, EventArgs e) { try { if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } para = new SignRecordPagePara() { EndDate = new Date(this.dateTimePicker_End.Value), StartDate = new Date(this.dateTimePicker_Start.Value), GuideID = ValidateUtil.CheckEmptyValue(this.guideComboBox1.SelectedValue), ShopID = ValidateUtil.CheckEmptyValue(this.skinComboBoxShopID.SelectedValue), PageIndex = 0, PageSize = this.dataGridViewPagingSumCtrl.PageSize, SignType = (SignType)this.skinComboBox_signType.SelectedValue, }; dataGridViewPagingSumCtrl.OrderPara = para; SignRecordPage listPage = CommonGlobalCache.ServerProxy.GetSignRecordPage(para); this.dataGridViewPagingSumCtrl.Initialize(listPage); BindingSource(listPage); } catch (Exception ex) { ShowError(ex); } finally { UnLockPage(); } }
private void BindingSource(SignRecordPage page) { if (page != null && page.SignRecords != null && page.SignRecords.Count > 0) { foreach (var item in page.SignRecords) { item.ShopName = CommonGlobalCache.GetShopName(item.ShopID); item.GuideName = CommonGlobalCache.GetUserName(item.GuideID); } } //this.dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(page?.SignRecords), null, page?.TotalEntityCount, page?.SignRecordSum); this.dataGridViewPagingSumCtrl.BindingDataSource(page?.SignRecords, null, page?.TotalEntityCount, page?.SignRecordSum); }