private void btnAddOrder_Click(object sender, EventArgs e) { if (Utility.isValidCustName(txtCustomerName.Text) && Utility.isValidPhoneNo(txtPhoneNo.Text)) { ; int saleID = Sale.getNextID(); Sale sale = new Sale(saleID, txtCustomerName.Text, txtPhoneNo.Text, totalPrice); sale.insertSale(); SaleItem.insertSaleItems(cart, saleID); MessageBox.Show("Confirming order completion!", "Confirmation", MessageBoxButtons.OK); this.Close(); parent.Show(); } else { MessageBox.Show("Invalid credentials entered", "Error"); } }