Пример #1
0
        private void DeleteOrderItemButton_Click(object sender, EventArgs e)
        {
            Order_Service orderserv = new Order_Service();  //deletes selected order item

            if (EditView.SelectedItems.Count > 0)
            {
                orderserv.DeleteOrderItem(int.Parse(EditView.SelectedItems[0].SubItems[1].Text));
                Messagelabel.Text = "Deleted Order item with ID " + EditView.SelectedItems[0].SubItems[1].Text;
                orderserv.AdjustStock(int.Parse(EditView.SelectedItems[0].SubItems[2].Text), int.Parse((EditView.SelectedItems[0].SubItems[3].Text)), "+");
                FillOrderViewByOrderID(orderId);
            }
            else
            {
                Messagelabel.Text = "No item selected!";
            }
        }