private void AddNewNote() { try { SecurityTools.CheckForAccess(SecurityGroups.ModifyDevice); using (var updateTypePrompt = new UpdateTypeForm(this, true)) { if (updateTypePrompt.ShowDialog(this) == DialogResult.OK) { if (!ConcurrencyCheck()) { RefreshData(); } else { UpdateDevice(updateTypePrompt.UpdateInfo); } } else { RefreshData(); } } } catch (Exception ex) { ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod()); } }
private void AcceptChanges() { try { if (!FieldsValid()) { OtherFunctions.Message("Some required fields are missing or invalid. Please check and fill all highlighted fields.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, "Missing Data", this); return; } using (UpdateTypeForm updateTypePrompt = new UpdateTypeForm(this)) { if (updateTypePrompt.ShowDialog(this) == DialogResult.OK) { if (!ConcurrencyCheck()) { CancelModify(); return; } else { UpdateDevice(updateTypePrompt.UpdateInfo); } } else { CancelModify(); } } } catch (Exception ex) { ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod()); } }