private void DeleteClientAdd() { try { if (MessageBox.Show("Are you sure you want to PERMANENTLY delete the Client's Location details?", "Delete Client Location?", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { SelectedClientAdd.DeleteAddress(); ClientAddCollection.Remove(SelectedClientAdd); MessageBox.Show("Thank you! The Client's Location details have been deleted!", "Delete Client Location?", MessageBoxButton.OK, MessageBoxImage.Information); } else { return; } } catch (Exception ex) { MessageBox.Show("An Error Occured, The Client Location Details have not been deleted. Please Contact your System Administrator.", "Delete Client Location?" + ex.Message); } }
private void SaveClientAdd() { if (SelectedClientAdd.ClientID == 0) { SelectedClientAdd.InsertAddress(PassedClientId); } else { SelectedClientAdd.UpdateAddress(); } // System.Windows.MessageBox.Show("Update Address"); //if (SelectedClientAdd.ClientID == 0) //{ // try // { // SelectedClientAdd.InsertAddress(PassedClientId); // MessageBox.Show("Thank you! The new Client's Location details have been added to the Database.", "Add Client Location", MessageBoxButton.OK, MessageBoxImage.Information); // } // catch (Exception) // { // MessageBox.Show("Something Went Wrong, But we Dont know what! Client Location details was not added to the database"); // } //} //else //{ // try // { // SelectedClientAdd.UpdateAddress(); // MessageBox.Show("The Client's Location details have been updated in the Database.", "Update Client Location?", MessageBoxButton.OK, MessageBoxImage.Information); // } // catch (Exception ex) // { // MessageBox.Show("An Error Occured, The Client Location Details were not updated. Please Contact your System Administrator.", "Update Client Location?" + ex.Message); // } //} }