private void newPositionButton_Click(object sender, EventArgs e) { try { AddToOrderDTO position = new AddToOrderDTO { OrderIDKEY = _orderID, ItemIDKEY = Convert.ToInt32(ItemIDOrder.Text), Amount = Convert.ToInt32(AmountOrder.Text) }; _customer.AddPosition(position); ItemIDOrder.Clear(); AmountOrder.Clear(); } catch { MessageBox.Show("Invalid data"); } }