protected override void OnConfirmCommand() { try { switch (ActionType) { case ActionType.Add: ApiClient.AddDocumentNumberDefinitionAsync(Entity).Wait(); break; case ActionType.Edit: ApiClient.UpdateDocumentNumberDefinitionsAsync(Entity.Id, Entity).Wait(); break; } DialogResult = true; if (Close != null) { Close.Invoke(); } } catch (Exception e) { WindowHandler.WindowHandlerInstance.ShowMessage(e.Message, this.GetType().Name, UnityContainer); } }