//Update private void buttonClUpdate_Click(object sender, EventArgs e) { DialogResult ans = MessageBox.Show("Are you sure you want to update the Client information?", "Update Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (ans == DialogResult.Yes) { ClientDA.Update(createClient()); } ClientDA.List(listViewSales); UpdateComboBoxes(); }
//Delete private void buttonClDel_Click(object sender, EventArgs e) { DialogResult ans = MessageBox.Show("Are you sure you want to delete the Client information?", "Delete Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (ans == DialogResult.Yes) { if (OrderDA.SearchByClientID(Convert.ToInt32(textBoxClID.Text)) != null) { MessageBox.Show("This client has open orders in the system, please verify the orders before deleting this client.", "ALERT!"); return; } ClientDA.Delete(Convert.ToInt32(textBoxClID.Text)); ClientDA.List(listViewSales); UpdateComboBoxes(); } }
//List private void buttonClList_Click(object sender, EventArgs e) { ClientDA.List(listViewSales); }