public static bool ModifyName(IBaseContext context, ref NameEntry nameEntry) { bool result; try { context.BeginUpdate(); using (var dlg = AppHost.ResolveDialog <INameEditDlg>()) { dlg.IName = nameEntry; result = AppHost.Instance.ShowModalX(dlg, false); } } finally { context.EndUpdate(); } return(result); }
public void DuplicateRecord() { GDMRecord original = GetSelectedRecordEx(); if (original == null || original.RecordType != GDMRecordType.rtIndividual) { return; } AppHost.StdDialogs.ShowWarning(LangMan.LS(LSID.LSID_DuplicateWarning)); GDMIndividualRecord target; try { fContext.BeginUpdate(); target = fContext.Tree.CreateIndividual(); target.Assign(original); NotifyRecord(target, RecordAction.raAdd); } finally { fContext.EndUpdate(); } RefreshLists(false); fView.SelectRecordByXRef(target.XRef); }