Ejemplo n.º 1
0
        private void AddNewIssueActionType(NodeView nodeView)
        {
            AddEditIssueActionTypeDialog dialog = new AddEditIssueActionTypeDialog();
            dialog.DataContext = new AddEditIssueActionTypeModel { View = dialog };
            dialog.Show();

            dialog.Closed +=
                (s1, e1) =>
                {
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        NodeView child = new NodeView(nodeView)
                        {
                            Id = dialog.IssueActionType.Id,
                            Name = dialog.IssueActionType.Name,
                            Description = dialog.IssueActionType.Description,
                            Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
                            Type = NodeType.IssueActionTypeNode,
                            HasChildren = false,
                            SortField = dialog.IssueActionType.Ordinal.ToString()
                        };
                        if (nodeView.ChildrenLoaded)
                        {
                            nodeView.Children.Add(child);
                            nodeView.Sort();
                        }
                    }
                };
        }
Ejemplo n.º 2
0
 private void EditIssueActionType(NodeView nodeView)
 {
     AddEditIssueActionTypeDialog dialog = new AddEditIssueActionTypeDialog(nodeView.Id);
     dialog.Title = "Edit Issue Action Type";
     dialog.Show();
     dialog.Closed +=
         (s1, e1) =>
         {
             if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
             {
                 nodeView.Name = dialog.IssueActionType.Name;
                 nodeView.Description = dialog.IssueActionType.Description;
                 nodeView.SortField = dialog.IssueActionType.Ordinal.ToString();
                 nodeView.Parent.Sort();
             }
         };
 }