private void newButton_Click(object sender, EventArgs e)
        {
            int?     localSupplierId = null;
            Supplier supplier;

            var selectedNode = suppliersTreeView.SelectedNode;

            if (selectedNode != null)
            {
                localSupplierId = int.Parse(selectedNode.Name);
            }

            if (localSupplierId.HasValue)
            {
                supplier = new Supplier {
                    ParentSupplierId = localSupplierId.Value
                }
            }
            ;
            else
            {
                supplier = new Supplier();
            }

            using (var supplierEditor = new SupplierEditor(supplier))
            {
                var result = supplierEditor.ShowDialog(this);
                if (result == DialogResult.OK)
                {
                    BuildTree();
                }
            }
        }
        private void productTypesTreeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            var localProductTypeId = int.Parse(e.Node.Name);

            using (var supplierEditor = new SupplierEditor(localProductTypeId))
            {
                var result = supplierEditor.ShowDialog(this);
                if (result == DialogResult.OK)
                {
                    BuildTree();
                }
            }
        }