Ejemplo n.º 1
0
        private void EditDocumentLocation(NodeView nodeView)
        {
            AddEditDocumentLocationDialog dialog = new AddEditDocumentLocationDialog(nodeView.Id);
            dialog.Title = "Edit Document Location";
            dialog.Show();

            dialog.Closed +=
                (s1, e1) =>
                {
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        nodeView.Name = dialog.DocumentLocation.Name;
                        nodeView.Description = dialog.DocumentLocation.Description;
                        nodeView.IsActive = dialog.DocumentLocation.IsActive;
                        nodeView.SortField = dialog.DocumentLocation.Name;
                        nodeView.Parent.Sort(true);
                    }
                };
        }
Ejemplo n.º 2
0
        private void AddNewDocumentLocation(NodeView nodeView)
        {
            AddEditDocumentLocationDialog dialog = new AddEditDocumentLocationDialog();
            dialog.Show();

            dialog.Closed +=
                (s1, e1) =>
                {
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        NodeView child = new NodeView(nodeView)
                        {
                            Id = dialog.DocumentLocation.Id,
                            Name = dialog.DocumentLocation.Name,
                            Description = dialog.DocumentLocation.Description,
                            Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
                            Type = NodeType.DocumentLocationNode,
                            IsActive = dialog.DocumentLocation.IsActive,
                            SortField = dialog.DocumentLocation.Name,
                            HasChildren = false
                        };
                        if (nodeView.ChildrenLoaded)
                        {
                            nodeView.Children.Add(child);
                            nodeView.Sort(true);
                        }

                    }
                };
        }