//Handler for when the enter button is clicked. private void btn_EnterClick(object sender, EventArgs e) { SetKeyEvents sk = GlobalVar.EVENTS; //Since there could be a selected row in the orderlist, the handler for the orderlist is disabled for this method. orderList.SelectionChanged -= this.btn_OrderListClick; sk.btn_EnterClick(sender, e, this); orderList.SelectionChanged += this.btn_OrderListClick; GlobalVar.DISCOUNT = false; }
//Handler for when an item button is clicked. private void btn_ItemClick(object sender, EventArgs e) { SetKeyEvents sk = GlobalVar.EVENTS; //Since there could be a selected row in the orderlist, the handler for the orderlist is disabled for this method. orderList.SelectionChanged -= this.btn_OrderListClick; sk.btn_ItemClick(sender, e, this); orderList.SelectionChanged += this.btn_OrderListClick; //Discount is defaulted to false and only changes when forced with the discount button or if the qty is 12 or higher. GlobalVar.DISCOUNT = false; }
//Handler for when the delete row button is clicked. private void btn_DeleteRow(object sender, EventArgs e) { if (!GlobalVar.CURRENT_ORDER.editable) { MessageBox.Show("This order is already complete and cannot be edited.", "Error: Deleting item from saved order"); return; } //Since there could be a selected row in the orderlist, the handler for the orderlist is disabled for this method. orderList.SelectionChanged -= btn_OrderListClick; SetKeyEvents sk = GlobalVar.EVENTS; sk.btn_DeleteRow(sender, e, this); orderList.SelectionChanged += btn_OrderListClick; }
//Handler for when a row in the order list is clicked. private void btn_OrderListClick(object sender, EventArgs e) { SetKeyEvents sk = GlobalVar.EVENTS; sk.btn_OrderListClick(sender, e, this); }