private void Bind(int page) { // First get all of the items in the order OrderItemFinder finder = new OrderItemFinder { OrderId = CurrentOrderId }; List <OrderItem> items = OrderItem.FindMany(finder); // Filter out those assets that are not accessible by the current user var validItems = (from item in items where EntitySecurityManager.CanViewAssetInfo(CurrentUser, item.Asset) select item); // Get the asset count int total = validItems.Count(); // Set the page size SessionInfo.Current.UserSessionInfo.DownloadManagerPageSize = PageSize; // Bind the asset list to relevant page OrderItemsRepeater.DataSource = items; OrderItemsRepeater.DataBind(); // Setup the top pager TopPager.CurrentPage = page; TopPager.PageSize = PageSize; TopPager.ItemCount = total; TopPager.CalculatePageCount(); // Setup the bottom pager BottomPager.CurrentPage = TopPager.CurrentPage; BottomPager.PageSize = TopPager.PageSize; BottomPager.ItemCount = TopPager.ItemCount; BottomPager.CalculatePageCount(); // Setup page variables CurrentPage = page; AssetCount = total; TotalPages = TopPager.PageCount; // Toggle no results panel OrderDetailsPanel.Visible = (items.Count > 0); EmptyOrderPanel.Visible = (items.Count == 0); }
protected void Page_Load(object sender, EventArgs e) { User user = AbleContext.Current.User; // SHOW SHIPPING INFORMATION if (user.Basket.Shipments.Count > 0) { Address shippingAddress = user.Basket.Shipments[0].Address; ShippingAddress.Text = shippingAddress.ToString(); ShippingAddressPanel.Visible = true; } else { ShippingAddressPanel.Visible = false; } // SHOW BILLING INFORMATION BillingAddress.Text = AbleContext.Current.User.PrimaryAddress.ToString(); OrderItemsRepeater.DataSource = GetBasketItems(); OrderItemsRepeater.DataBind(); }