private void buttonDeleteDocument_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; try { var docDeleteId = System.Convert.ToInt32(textBoxDelete.Text); ArxGenericException canDelete = _manager.ARX_SECURITY.Dm_Profile_Can_Delete_Advanced(docDeleteId); if (canDelete.Exception != Security_Exception.Nothing) { MessageBox.Show(canDelete.ErrorMessage, "Delete document", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } _manager.ARX_DATI.Dm_Profile_Delete(docDeleteId); MessageBox.Show("Delete Ok!", "Delete", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception exception) { MessageBox.Show(exception.Message); } finally { Cursor = Cursors.Default; } }
private void buttonDeleteDocument_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; try { int docNumberScelto; //1) Chiedere all'utente quale docNumber modificare docNumberScelto = Int32.Parse(textBoxDelete.Text); //2) Controlliamo che l'eliminazione si possa effettuare ArxGenericException canDelete = _manager........(docNumberScelto); if (canDelete.Exception != Security_Exception.Nothing) { //C'è qualcosa che impedisce la sua cancellazione MessageBox.Show(canDelete.ErrorMessage, "Delete document", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } else { //Si può procedere _manager.ARX_DATI.Dm_Profile_Delete(docNumberScelto); MessageBox.Show("Delete Ok!", "Delete", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception exception) { MessageBox.Show(exception.Message); } finally { Cursor = Cursors.Default; } }