protected void LoadItems(bool fromDb) { if (!HasEditPermission) { dgBids.Columns[dgBids.Columns.Count - 1].Visible = false; } DateTime from = new DateTime(), to = new DateTime(); DateTime.TryParse(dpSearchCreateDateFrom.Value.ToString(), out from); DateTime.TryParse(dpSearchCreateDateTo.Value.ToString(), out to); Int64 _BidId = -1; if (txtBidNumber.Text != "") { Int64.TryParse(txtBidNumber.Text, out _BidId); } if (fromDb) { // au = BidController.GetUntakenBidsTempForCampaign(filterSearch, from, to, txtSearchPhone.Text, txtCustomerId.Text, _BidId, txtCityName.Text); au = BidController.GetUntakenBids(filterSearch, from, to, txtSearchPhone.Text, txtCustomerId.Text, _BidId, txtCityName.Text); ViewState["au"] = au; } dgBids.VirtualItemCount = au.Count; if (dgBids.VirtualItemCount == 0) { phHasItems.Visible = false; phHasNoItems.Visible = true; lblNoItems.Text = BidString.GetText(@"MessageNoBidsFound"); } else { phHasItems.Visible = true; phHasNoItems.Visible = false; if (dgBids.PageSize * dgBids.CurrentPageIndex > dgBids.VirtualItemCount) { dgBids.CurrentPageIndex = 0; hfCurrentPageIndex_dgBids.Value = dgBids.CurrentPageIndex.ToString(); } if (filterSearch == null) { //lblSumAbandonedBidsWithOffers.Text = au.Count(b => b.OfferNum > 0 && b.OrderDate == (DateTime?)null && b.EndDate < DateTime.Now).ToString(); //lblSumAbandonedBidsWithOutOffers.Text = au.Count(b => b.OfferNum == 0 && b.OrderDate == (DateTime?)null && b.EndDate < DateTime.Now).ToString(); //lblSumActiveBids.Text = au.Count(b => b.EndDate >= DateTime.Now).ToString(); //lblSumPurchaseBids.Text = au.Count(b => b.OrderDate != (DateTime?)null).ToString(); } else { dgBids.VirtualItemCount = au.Count(); } // List<BidUI> app_users = BidController.GetUntakenBids(filterSearch, from, to, txtSearchPhone.Text, txtCustomerId.Text, _BidId, txtCityName.Text, dgBids.PageSize, dgBids.CurrentPageIndex); BindList(au); } }