Пример #1
0
        private int PageChange(int pageIndex, int pageSize)
        {
            _firstIndex = (pageIndex - 1) * pageSize + 1;

            var warehouseBLL = new PutInWarehouseBLL();
            int totalCount;
            CResult <List <WebPutInWarehouseRecord> > result;

            // if (_isPutinOrWarehouseCheck == true)
            // {
            // dgvPutinRecord.Columns["PrintTwoCode"].Visible = false;
            // result = warehouseBLL.GetPutInWarehouseInfo(out totalCount, txtSearchKey.Text.Trim(), pageIndex, pageSize, _currentOrderBy,
            //   _ascding, searchStartTime.Value, searchEndTime.Value);
            //  }
            //  else if (_isPutinOrWarehouseCheck == false & (MainForm.CurrentUserRoles.Contains(PermissionEnum.系统管理员.ToString())))
            //  {
            //if (MainForm.CurrentUserRoles.Contains(PermissionEnum.系统管理员.ToString()))
            //{
            //  result = warehouseBLL.GetWarehouseInfoList(out totalCount, txtSearchKey.Text.Trim(), pageIndex, pageSize, _currentOrderBy, _ascding
            //  , searchStartTime.Value, searchEndTime.Value);



            //  }

            // dgvPutinRecord.DataSource = result.Data;

            // return totalCount;

            //if (_isPutinOrWarehouseCheck == false & (MainForm.CurrentUserRoles.Contains(PermissionEnum.系统管理员.ToString())))
            if (_isPutinOrWarehouseCheck == false)

            {
                result = warehouseBLL.GetWarehouseInfoList(out totalCount, txtSearchKey.Text.Trim(), pageIndex, pageSize, _currentOrderBy, _ascding
                                                           , searchStartTime.Value, searchEndTime.Value);
            }
            else
            {
                dgvPutinRecord.Columns["PrintTwoCode"].Visible = false;
                result = warehouseBLL.GetPutInWarehouseInfo(out totalCount, txtSearchKey.Text.Trim(), pageIndex, pageSize, _currentOrderBy,
                                                            _ascding, searchStartTime.Value, searchEndTime.Value);
            }

            dgvPutinRecord.DataSource = result.Data;

            return(totalCount);
        }