private void EditType(NodeView nodeView)
        {
            AddEditMobilePlantTypeDialog dialog = new AddEditMobilePlantTypeDialog(nodeView.Id);
            dialog.Title = "Edit Mobile Type";
            dialog.Show();

            dialog.Closed +=
                (s1, e1) =>
                    {
                        if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                        {
                            nodeView.Name = dialog.MobilePlantType.Name;
                            nodeView.Description = dialog.MobilePlantType.Description;
                            nodeView.SortField = dialog.MobilePlantType.Ordinal.ToString();
                            nodeView.IsActive = dialog.MobilePlantType.IsActive;
                        }
                        nodeView.Parent.Sort(true);
                    };
        }
        private void AddType(NodeView nodeView)
        {
            AddEditMobilePlantTypeDialog dialog = new AddEditMobilePlantTypeDialog();
            AddEditMobilePlantTypeModel addEditMobilePlantTypeModel = new AddEditMobilePlantTypeModel();
            addEditMobilePlantTypeModel.View = dialog;
            dialog.DataContext = addEditMobilePlantTypeModel;
            dialog.Show();

            dialog.Closed +=
                (s1, e1) =>
                {
                    NodeView parentNode = nodeView;
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {

                        NodeView child = new NodeView(parentNode)
                            {
                                Id = dialog.MobilePlantType.Id,
                                Name = dialog.MobilePlantType.Name,
                                Description = dialog.MobilePlantType.Description,
                                Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
                                Type = NodeType.MobilePlantTypeNode,
                                SortField = dialog.MobilePlantType.Ordinal.ToString(),
                                IsActive = dialog.MobilePlantType.IsActive,
                                HasChildren = true
                            };
                        parentNode.Children.Add(child);
                        nodeView.Sort(true);
                    }
                };
        }