private void ExtractDesignsFromNode(TreeNode node) { try { ArrayList designs = new ArrayList(); if (node is CategoryNode) { GetDesignsFromCategoryNode((CategoryNode)node, ref designs); } else if (node is SubsectionNode) { GetDesignsFromSubsectionNode((SubsectionNode)node, ref designs); } else if (node is DesignNode) { designs.Add(((DesignNode)node).Design); } if (designs.Count > 0) { UOARBatchDataAdapter adapter = new UOARBatchDataAdapter(); adapter.ExportDesigns(designs, node.Text); } } catch (Exception ex) { MessageBox.Show("Export failed: \n" + ex.Message); } }
private void ImportUOARDesign_Click(object sender, System.EventArgs e) { Cursor.Current = Cursors.WaitCursor; UOARBatchDataAdapter adapter = new UOARBatchDataAdapter(); DateTime start = DateTime.Now; ArrayList designs = adapter.ImportDesigns(); HouseDesignData.BatchSaveNewDesigns(designs); Cursor.Current = Cursors.Default; if (designs.Count > 0) { DateTime end = DateTime.Now; string msg = string.Format("Successfully imported {0} designs for a total of {1:#,##0} items.", designs.Count, adapter.Count); MessageBox.Show(msg); } }