private void EditModel(NodeView nodeView)
        {
            var dialog = new AddEditModelDialog(nodeView.Id);
            dialog.Title = "Edit Model";
            dialog.Show();

            dialog.Closed +=
                (s1, e1) =>
                {
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        nodeView.Name = dialog.Model.Name;
                        nodeView.Description = dialog.Model.Description;
                        nodeView.SortField = dialog.Model.Ordinal.ToString();
                        nodeView.Parent.Sort();
                    }
                };
        }
        private void AddModel(NodeView nodeView)
        {
            var dialog = new AddEditModelDialog(nodeView.Id, (int)CommonUtils.EquipmentTypeCode.CONTR);
            dialog.Show();

            dialog.Closed +=
                (s1, e1) =>
                {
                    var parentNode = nodeView;
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        var child = new NodeView(parentNode)
                        {
                            Id = dialog.Model.Id,
                            Name = dialog.Model.Name,
                            Description = dialog.Model.Description,
                            Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
                            Type = NodeType.ModelNode,
                            HasChildren = false,
                            SortField = dialog.Model.Ordinal.ToString()
                        };
                        if (nodeView.ChildrenLoaded)
                        {
                            parentNode.Children.Add(child);
                            parentNode.Sort();
                        }
                    }
                };
        }