Example #1
0
        /*
         *    private void frmAddOrder_Load(object sender, EventArgs e)
         *    {
         *        do
         *        {
         *            Random random = new Random();
         *            currentOrder.id = random.Next(0, 10000);
         *        } while (frmMain_parameter.orderlist.Exists(x => x.Id == currentOrder.id));
         *    }
         */
        private void btnDelOI_Click(object sender, EventArgs e)
        {
            OrderItem ClickedOrderItem = dgvOIofAddingOrder.CurrentRow.DataBoundItem as OrderItem;

            currentOrder.deleteOrderItem(ClickedOrderItem);
            OrderAddingbindingSource.DataSource = currentOrder.orderItemList;
            OrderAddingbindingSource.ResetBindings(false);
        }
Example #2
0
        private void btnAddOI_Click(object sender, EventArgs e)
        {
            frmAddOI form3 = new frmAddOI(new OrderItem());

            if (form3.ShowDialog() == DialogResult.OK)
            {
                currentOrder.addOrderItem(form3.CurrentOI);
                OrderAddingbindingSource.DataSource = currentOrder.orderItemList;
                OrderAddingbindingSource.ResetBindings(false);
            }
        }