//Add orders private void btnSaveOrder_Click(object sender, EventArgs e) { try { APPORDERDAO.CreateOrder(Convert.ToInt32(txtProductID.Text), cmbUsernameId.Text, txtDate.Text); MessageBox.Show("Order added to HUGO!", "HUGO", MessageBoxButtons.OK, MessageBoxIcon.Information); actualizarControles(); } catch (Exception) { MessageBox.Show("Your order already exists"); } }
//Delete Order private void btnDeleteOrder_Click(object sender, EventArgs e) { try { if (MessageBox.Show("Are you sure you want to delete " + txtProductID.Text + "?", "HUGO", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { APPORDERDAO.delete(Convert.ToInt32(txtProductID.Text), cmbUsernameId.Text); MessageBox.Show("Delete success!", "HUGO", MessageBoxButtons.OK, MessageBoxIcon.Information); actualizarControles(); } } catch (Exception) { MessageBox.Show("Your didn't exists"); } }