protected async Task AddContactAsync(UserContactRequest userContactRequest)
        {
            var userContact = await ApiClient.AddContactAsync(userContactRequest);

            if (userContact != null)
            {
                await FindAsync();
            }
        }
示例#2
0
        protected async override void OnConfirmCommand()
        {
            try
            {
                switch (ActionType)
                {
                case ActionType.Add:
                    Entity = await ApiClient.AddCompanyAsync(Entity);

                    ContactEntity.Company   = null;
                    ContactEntity.CompanyId = Entity.Id;
                    await ApiClient.AddContactAsync(ContactEntity);

                    break;

                case ActionType.Edit:
                    await ApiClient.UpdateComapnyAsync(Entity.Id, Entity);

                    await ApiClient.UpdateContactAsync(Entity.Id, ContactEntity);

                    await ApiClient.LockEntityAsync(Entity.Id, LockId, false, "Companies");

                    break;
                }

                DialogResult = true;

                if (Close != null)
                {
                    Close.Invoke();
                }
            }
            catch (Exception)
            {
            }
        }