Exemple #1
0
        private void LoadOrderData()
        {
            bool isDelivered = this.radioButtonDeliveredOrders.Checked;

            OrderCount = EbayTransactionDAL.GetOrdersCount(isDelivered);
            int orderPageCnt = OrderCount / OrderPageSize + 1;

            if (CurrentOrderPage < 1)
            {
                CurrentOrderPage = 1;
            }
            else if (CurrentOrderPage > orderPageCnt)
            {
                CurrentOrderPage = orderPageCnt;
            }

            this.buttonOrderFirstPage.Enabled = true;
            this.buttonOrderLastPage.Enabled  = true;
            this.buttonOrderPrevPage.Enabled  = true;
            this.buttonOrderNextPage.Enabled  = true;

            if (CurrentOrderPage == 1)
            {
                this.buttonOrderFirstPage.Enabled = false;
                this.buttonOrderPrevPage.Enabled  = false;
            }

            if (CurrentOrderPage == orderPageCnt)
            {
                this.buttonOrderLastPage.Enabled = false;
                this.buttonOrderNextPage.Enabled = false;
            }

            this.labelOrderPage.Text = string.Format("{0} / {1}", CurrentOrderPage, orderPageCnt);

            AllOrdersCacheTable = EbayTransactionDAL.GetPagedOrders(CurrentOrderPage, OrderPageSize, isShowingPendingOrders);
            this.dataGridViewAllOrders.DataSource = AllOrdersCacheTable;
        }