private void AddManufacturer(NodeView nodeView) { var dialog = new AddEditManufacturerDialog(CommonUtils.EquipmentTypeCode.CONTR); dialog.Show(); dialog.Closed += (s1, e1) => { var parentNode = nodeView; if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { var child = new NodeView(parentNode) { Id = dialog.Manufacturer.Id, Name = dialog.Manufacturer.Name, Description = dialog.Manufacturer.Description, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png", Type = NodeType.ManufacturerNode, HasChildren = true, SortField = dialog.Manufacturer.Ordinal.ToString() }; if (nodeView.ChildrenLoaded) { parentNode.Children.Add(child); parentNode.Sort(); } } }; }
private void EditManufacturer(NodeView nodeView) { var dialog = new AddEditManufacturerDialog(nodeView.Id, CommonUtils.EquipmentTypeCode.CONTR); dialog.Title = "Edit Manufacturer"; dialog.Show(); dialog.Closed += (s1, e1) => { if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { nodeView.Name = dialog.Manufacturer.Name; nodeView.Description = dialog.Manufacturer.Description; nodeView.SortField = dialog.Manufacturer.Ordinal.ToString(); nodeView.Parent.Sort(); } }; }