示例#1
0
 private void UpdateNodeFromForm(PlanNode nodeToEdit)
 {
     nodeToEdit.Text = this.nameBox.Text;
     nodeToEdit.Currency = (string)currencyCombo.SelectedItem;
     nodeToEdit.ToolTipText = descriptionBox.Text;
     nodeToEdit.LocalCostInCents = (int)(localCostBox.Value * 100);
 }
示例#2
0
 public static DialogResult ShowDialog(PlanNode nodeToEdit)
 {
     EditPlanDialog dlg = new EditPlanDialog();
     dlg.UpdateFormFromNode(nodeToEdit);
     DialogResult result = dlg.ShowDialog();
     if (result == DialogResult.OK)
         dlg.UpdateNodeFromForm(nodeToEdit);
     return result;
 }
示例#3
0
 private void UpdateFormFromNode(PlanNode nodeToEdit)
 {
     this.nameBox.Text = nodeToEdit.Text;
     if (currencyCombo.Items.Contains(nodeToEdit.Currency))
         currencyCombo.SelectedItem = nodeToEdit.Currency;
     else
         currencyCombo.SelectedItem = CurrencyData.DefaultCurrency;
     descriptionBox.Text = nodeToEdit.ToolTipText;
     decimal cost = nodeToEdit.LocalCostInCents;
     localCostBox.Value = cost / 100;
 }
示例#4
0
 private void AddPlanNodeToTree(TreeNode parentNode, PlanNode node, bool editFirst)
 {
     if (editFirst)
     {
         DialogResult result = EditNode(node);
         if (result == System.Windows.Forms.DialogResult.OK)
         {
             AddNode(parentNode, node);
         }
     }
     else
     {
         PopulateNode(node);
         AddNode(parentNode, node);
     }
 }
示例#5
0
 private DialogResult EditNode(PlanNode nodeToEdit)
 {
     DialogResult result = EditPlanDialog.ShowDialog(nodeToEdit);
     if (result == System.Windows.Forms.DialogResult.OK)
     {
         PopulateNode(nodeToEdit);
         DisplayTotalCost();
     }
     return result;
 }
示例#6
0
 private void addNewItemToolStripMenuItem_Click(object sender, EventArgs e)
 {
     PlanNode newNode = new PlanNode();
     AddPlanNodeToTree(travelTree.SelectedNode,newNode,true);
 }
示例#7
0
 private void PopulateNode(PlanNode data)
 {
 }