private void GetListQueryData() { try { this.Cursor = Cursors.WaitCursor; bsMain.EndEdit(); bool bResult = false; string strErr = string.Empty; GetQueryMain(); if (queryMain.StartTime != null && queryMain.EndTime != null) { if (queryMain.StartTime.ToDateTime().Date > queryMain.EndTime.ToDateTime().Date) { Common.Common_Func.ErrorMessage("开始日期不能大于结束日期", "查询失败"); return; } } ChensControl.DividPage clientPage = pageList.dDividPage; Common.Common_Func.GetServerPageFromClientPage(ref _serverMainPage, clientPage); bResult = Print_Func.GetStockBarcodeListByPage(ref lstMain, queryMain, ref _serverMainPage, ref strErr); Common.Common_Func.GetClientPageFromServerPage(_serverMainPage, ref clientPage); pageList.ShowPage(); dgvList.DataSource = lstMain; if (!bResult || !string.IsNullOrEmpty(strErr)) { Common.Common_Func.ErrorMessage(strErr, "查询失败"); } if (dgvList.DataSource == null || dgvList.Rows.Count <= 0) { } else { dgvList.EditMode = DataGridViewEditMode.EditOnKeystrokeOrF2; } } catch (Exception ex) { Common.Common_Func.ErrorMessage(ex.Message, "查询失败"); } finally { this.Cursor = Cursors.Default; cbxSelectAll.Checked = false; txtAreaNo.Focus(); } }