private void AddNewIssueMilestoneDelayType(NodeView nodeView)
        {
            AddEditIssueMilestoneDelayTypeDialog dialog = new AddEditIssueMilestoneDelayTypeDialog();
            dialog.Title = "Add new Issue Milestone Delay Type";

            AddEditIssueMilestoneDelayTypeModel model = new AddEditIssueMilestoneDelayTypeModel { View = dialog };
            dialog.DataContext = model;

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

                        if (nodeView.ChildrenLoaded)
                        {
                            nodeView.Children.Add(child);
                            nodeView.Sort();
                        }
                    }
                };
        }
        private void EditIssueMilestoneDelayType(NodeView nodeView)
        {
            AddEditIssueMilestoneDelayTypeDialog dialog = new AddEditIssueMilestoneDelayTypeDialog(nodeView.Id);
            dialog.Title = "Edit Issue Milestone Delay Type";

            dialog.Show();
            dialog.Closed +=
                (s1, e1) =>
                {
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        nodeView.Name = dialog.IssueMilestoneDelayType.Code;
                        nodeView.Description = dialog.IssueMilestoneDelayType.Description;
                        nodeView.SortField = dialog.IssueMilestoneDelayType.Ordinal.ToString();
                        nodeView.Parent.Sort();
                    }
                };
        }