protected async override void OnConfirmCommand() { try { switch (ActionType) { case ActionType.Add: Entity = await ApiClient.AddGoodtAsync(Entity); break; case ActionType.Edit: await ApiClient.UpdateGoodAsync(Entity.Id, Entity); await ApiClient.LockEntityAsync(Entity.Id, LockId, false, "Goods"); break; } DialogResult = true; if (Close != null) { Close.Invoke(); } } catch (Exception) { } }