private void AddTypeClassification(NodeView nodeView)
        {
            AddIssueTypeClassificationDialog dialog = new AddIssueTypeClassificationDialog(nodeView.Id);
            dialog.Show();

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

                        var cacheMatch =
                            (from x in CMS.Cache.IssueTypeClassifications
                             where x.IssueClassificationId == dialog.IssueTypeClassification.IssueClassificationId
                             && x.IssueTypeId == dialog.IssueTypeClassification.IssueTypeId
                             select x).FirstOrDefault();

                        if (cacheMatch == null)
                        {
                            CMS.Cache.IssueTypeClassifications.Add(dialog.IssueTypeClassification);
                        }

                        if (nodeView.ChildrenLoaded)
                        {
                            nodeView.Children.Add(child);
                            nodeView.Sort(true);
                        }
                    }
                };
        }
        private void EditIssueTypeClassification(NodeView nodeView)
        {
            AddIssueTypeClassificationDialog dialog = new AddIssueTypeClassificationDialog(nodeView.Parent.Id, nodeView.Id);
            dialog.Title = "Edit Issue Type Classification";
            dialog.Show();

            dialog.Closed +=
                (s1, e1) =>
                {
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        nodeView.Id = dialog.IssueTypeClassification.Id;
                        nodeView.Name = dialog.IssueTypeClassification.IssueClassification.Name;
                        nodeView.Description = dialog.IssueTypeClassification.IssueClassification.Description;
                        nodeView.SortField = dialog.IssueTypeClassification.IssueClassification.Ordinal.ToString();
                        nodeView.Parent.Sort(false);

                        var cacheMatch = (from x in CMS.Cache.IssueTypeClassifications where x.Id == nodeView.Id select x).FirstOrDefault();

                        if (cacheMatch != null)
                        {
                            cacheMatch.IssueClassification.Name = dialog.IssueTypeClassification.IssueClassification.Name;
                            cacheMatch.IssueClassification.Ordinal = dialog.IssueTypeClassification.IssueClassification.Ordinal;
                        }
                    }

                };
        }