private void menuNewBusiness_Click(object sender, EventArgs e) { Business rec = new Business(); BusinessProperties dlg = new BusinessProperties(rec); if (DialogResult.OK == dlg.ShowDialog(this)) { rec.Store(m_dbConnection); m_businessRecs[rec.BusinessName] = rec; TreeNode businessNode = treeManagement.Nodes.Add(rec.BusinessName); businessNode.Tag = "business"; TreeNode node = businessNode.Nodes.Add("Ledger"); node.Tag = "ledger"; node = businessNode.Nodes.Add("Mileage"); node.Tag = "mileage"; } }
private void menuBusinessProperties_Click(object sender, EventArgs e) { Business rec = m_businessRecs[treeManagement.SelectedNode.Text] as Business; BusinessProperties dlg = new BusinessProperties(rec); if (DialogResult.OK == dlg.ShowDialog(this)) { rec.Store(m_dbConnection); if (rec.BusinessName != treeManagement.SelectedNode.Text) { m_businessRecs.Remove(treeManagement.SelectedNode.Text); treeManagement.SelectedNode.Text = rec.BusinessName; m_businessRecs[treeManagement.SelectedNode.Text] = rec; } } }