コード例 #1
0
        private void AddNewIssueType(NodeView nodeView)
        {
            AddEditIssueTypeDialog dialog = new AddEditIssueTypeDialog();
            dialog.DataContext = new AddEditTypeModel { View = dialog };
            dialog.Show();

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

                        NodeView issueTypeClassifications = new NodeView(null) { Name = "Issue Type Classifications", HasChildren = true, Type = NodeType.IssueTypeClassifications, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
                        NodeView issueSubTypes = new NodeView(null) { Name = "Issue Sub Types", HasChildren = true, Type = NodeType.IssueSubTypes_UnderIssueType, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };

                        child.Children.Add(issueTypeClassifications);
                        child.Children.Add(issueSubTypes);

                        if (nodeView.ChildrenLoaded)
                        {
                            nodeView.Children.Add(child);
                            nodeView.Sort();
                        }
                    }
                };
        }
コード例 #2
0
        private void EditType(NodeView nodeView)
        {
            AddEditIssueTypeDialog dialog = new AddEditIssueTypeDialog(nodeView.Id);
            dialog.Title = "Edit Issue Type";

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