Esempio n. 1
0
 private void button3_Click(object sender, EventArgs e)
 {
     app.OrderDetails orderItem = itemsBindingSource.Current as app.OrderDetails;
     if (orderItem == null)
     {
         MessageBox.Show("请选择一个订单项进行删除");
         return;
     }
     CurrentOrder.RemoveItem(orderItem);
     itemsBindingSource.ResetBindings(false);
 }
Esempio n. 2
0
        private void EditItem()
        {
            app.OrderDetails orderItem = itemsBindingSource.Current as app.OrderDetails;  //选中itemsBindingSource.Current对象
            if (orderItem == null)
            {
                MessageBox.Show("请选择一个订单项进行修改");
                return;
            }
            FormItemsEdit formItemEdit = new FormItemsEdit(orderItem);

            if (formItemEdit.ShowDialog() == DialogResult.OK)
            {
                itemsBindingSource.ResetBindings(false);
            }
        }