예제 #1
0
        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";
            }
        }
예제 #2
0
        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;
                }
            }
        }