protected void BindOrderItemGrid() { IList <OrderItem> itemList = new List <OrderItem>(); foreach (OrderItem item in _order.Items) { switch (item.OrderItemType) { case OrderItemType.Tax: case OrderItemType.GiftCertificatePayment: break; default: itemList.Add(item); break; } } // SHOW TAXES IF SPECIFIED TaxInvoiceDisplay displayMode = TaxHelper.InvoiceDisplay; if (displayMode == TaxInvoiceDisplay.LineItem || displayMode == TaxInvoiceDisplay.LineItemRegistered) { foreach (OrderItem item in _order.Items) { if ((item.OrderItemType == OrderItemType.Tax)) { itemList.Add(item); } } } // SORT AND COMBINE ORDER COUPONS FOR DISPLAY itemList.Sort(new OrderItemComparer()); itemList = itemList.CombineOrderCoupons(); OrderItemGrid.DataSource = itemList; OrderItemGrid.DataBind(); }
public OrderAddForm(TextBox firstname, TextBox lastname, TextBox email, TextBox phone, ComboBox item, TextBox quantity, DataGrid items, Button add, Button submit) { this.FirstnameInput = firstname; this.FirstnameInput.TextChanged += InputChanged; this.LastnameInput = lastname; this.LastnameInput.TextChanged += InputChanged; this.EmailInput = email; this.EmailInput.TextChanged += InputChanged; this.PhoneInput = phone; this.PhoneInput.TextChanged += InputChanged; this.ItemInput = item; this.ItemInput.SelectionChanged += AddChanged; this.QuantityInput = quantity; this.QuantityInput.TextChanged += AddChanged; this.AddButton = add; this.AddButton.Click += AddItem; this.SubmitButton = submit; this.SubmitButton.Click += Submit; this.ItemGrid = new OrderItemGrid(items); Init(); }