Пример #1
0
        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);
        }
Пример #2
0
        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);
        }