private void AddNewPipeFluidCode(NodeView nodeView) { AddEditPipeFluidCodeDialog dialog = new AddEditPipeFluidCodeDialog(); dialog.Show(); dialog.Closed += (s1, e1) => { if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { PipeFluidCode pipeFluidCode = dialog.PipeFluidCode; NodeView child = new NodeView(nodeView) { Id = pipeFluidCode.Id, Name = pipeFluidCode.Name, Description = pipeFluidCode.Description, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png", Type = NodeType.PipeFluidCodeNode, HasChildren = false, SortField = pipeFluidCode.Name }; if (nodeView.ChildrenLoaded) { nodeView.Children.Add(child); nodeView.Sort(); } } }; }
private void EditPipeFluidCode(NodeView nodeView) { AddEditPipeFluidCodeDialog dialog = new AddEditPipeFluidCodeDialog(nodeView.Id); dialog.Show(); dialog.Closed += (s1, e1) => { if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { PipeFluidCode pipeFluidCode = dialog.PipeFluidCode; nodeView.Name = pipeFluidCode.Name; nodeView.Description = pipeFluidCode.Description; nodeView.SortField = pipeFluidCode.Name; nodeView.Sort(); } }; }