Exemplo n.º 1
0
        private void GetDetailsQueryData()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                bool   bResult = false;
                string strErr  = string.Empty;
                GetQueryDetails();

                ChensControl.DividPage clientPage = pageDetail.dDividPage;
                Common.Common_Func.GetServerPageFromClientPage(ref _serverDetailsPage, clientPage);
                bResult = Basic_Func.GetHouseListByPage(ref lstDetails, queryDetails, ref _serverDetailsPage, ref strErr);
                Common.Common_Func.GetClientPageFromServerPage(_serverDetailsPage, ref clientPage);
                pageDetail.ShowPage();
                dgvDetail.DataSource = lstDetails;

                if (!bResult || !string.IsNullOrEmpty(strErr))
                {
                    Common.Common_Func.ErrorMessage(strErr, "查询失败");
                }
            }
            catch (Exception ex)
            {
                Common.Common_Func.ErrorMessage(ex.Message, "查询失败");
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Exemplo n.º 2
0
        private void GetListQueryData()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                bsMain.EndEdit();

                bool   bResult = false;
                string strErr  = string.Empty;
                GetQueryMain();

                ChensControl.DividPage clientPage = pageList.dDividPage;
                Common.Common_Func.GetServerPageFromClientPage(ref _serverMainPage, clientPage);
                bResult = Basic_Func.GetHouseListByPage(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)
                {
                    lstDetails           = new List <AreaInfo>();
                    dgvDetail.DataSource = lstDetails;
                    return;
                }
                else
                {
                    //dgvList.CurrentCell = dgvList[0, 0];
                    pageDetail.dDividPage.CurrentPageNumber = 1;
                    GetDetailsQueryData();
                }
            }
            catch (Exception ex)
            {
                Common.Common_Func.ErrorMessage(ex.Message, "查询失败");
            }
            finally
            {
                this.Cursor = Cursors.Default;
                txtWarehouseNo.Focus();
            }
        }