private void AddNewCalibrationEngineeringUnit(NodeView nodeView)
 {
     AddEditEngineeringUnitDialog dialog = new AddEditEngineeringUnitDialog();
     dialog.Show();
     dialog.Closed += (s1, e1) =>
     {
         if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
         {
             NodeView child = new NodeView(nodeView)
             {
                 Id = dialog.CalibrationEngineeringUnit.Id,
                 Name = dialog.CalibrationEngineeringUnit.Name,
                 Description = dialog.CalibrationEngineeringUnit.Description,
                 Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
                 Type = NodeType.EngineeeringUnitNode,
                 HasChildren = false,
                 SortField = dialog.CalibrationEngineeringUnit.Ordinal.ToString(),
             };
             if (nodeView.ChildrenLoaded)
             {
                 nodeView.Children.Add(child);
                 nodeView.Sort();
             }
         }
     };
 }
        private void EditCalibrationEngineeringUnit(NodeView nodeView)
        {
            AddEditEngineeringUnitDialog dialog = new AddEditEngineeringUnitDialog(nodeView.Id);
            dialog.Show();

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