private void EditFinancialVarianceCode(NodeView nodeView)
        {
            AddEditIssueFinancialVarianceCodeDialog dialog = new AddEditIssueFinancialVarianceCodeDialog(CommonUtils.Operation.Update, nodeView.Id);
            dialog.Title = "Edit Variance Code";
            dialog.Show();

            dialog.Closed +=
                (s1, e1) =>
                {
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        nodeView.Name = dialog.SavedFinancialVarianceCode.Code.ToString();
                        nodeView.Description = dialog.SavedFinancialVarianceCode.Description.ToString();
                        nodeView.SortField = dialog.SavedFinancialVarianceCode.Ordinal.ToString();
                        nodeView.IsActive = dialog.SavedFinancialVarianceCode.IsActive;
                    }
                    nodeView.Parent.Sort(true);
                };
        }
        private void AddFinancialVarianceCode(NodeView nodeView)
        {
            AddEditIssueFinancialVarianceCodeDialog dialog = new AddEditIssueFinancialVarianceCodeDialog(CommonUtils.Operation.Add, nodeView.Id);
            dialog.Title = "Add Variance Code";
            dialog.Show();

            dialog.Show();
            dialog.Closed +=
                (s1, e1) =>
                {
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        NodeView child = new NodeView(nodeView)
                        {
                            Id = dialog.SavedFinancialVarianceCode.Id,
                            Name = dialog.SavedFinancialVarianceCode.Code,
                            Description = dialog.SavedFinancialVarianceCode.Description,
                            Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
                            Type = NodeType.FinancialVarianceCode,
                            HasChildren = false,
                            SortField = dialog.SavedFinancialVarianceCode.Ordinal.ToString(),
                            IsActive = dialog.SavedFinancialVarianceCode.IsActive
                        };

                        if (nodeView.ChildrenLoaded)
                        {
                            nodeView.Children.Add(child);
                        }
                        nodeView.Sort(true);
                    }
                };
        }