Beispiel #1
0
        public virtual IEnumerable Identify(PXAdapter adapter)
        {
            if (Groups.View.Answer == WebDialogResult.None)
            {
                PXLongOperation.StartOperation(this, () =>
                {
                    var person = Api.IdentifyPerson(adapter.CommandArguments, adapter.Get <PersonGroup>().FirstOrDefault().Name);
                    if (person != null)
                    {
                        Groups.Ask("Person identification", $"{person.Name} has been identified successfully!", MessageButtons.OK);
                        return;
                    }

                    Groups.Ask("Person identification", "Failed to identify any person.", MessageButtons.OK);
                });
            }
            else
            {
                Groups.ClearDialog();
            }

            return(adapter.Get());
        }