Esempio n. 1
0
        private async Task RenameDetailAsync(DetailInTreeView selectedNodeTag)
        {
            // Renaming detail
            using (var renameDetailForm = new RenameDetailForm(_formsHelper))
            {
                if (renameDetailForm.ShowDialog() == DialogResult.OK)
                {
                    var newDetailName = renameDetailForm.EnteredName;

                    var selectedDetailId = selectedNodeTag.DetailId;

                    var updatedDetail = await _detailService
                                        .UpdateDetailNameAsync(selectedDetailId, newDetailName);

                    UpdateTreeViewNodesName(
                        treeView.Nodes,
                        updatedDetail.DetailId,
                        newDetailName);

                    ShowMessageDialog("Success renamed!");
                }
            }
        }