示例#1
0
        //enter new cost
        private void btnEnterNewCosts_Click(object sender, EventArgs e)
        {
            ClsCosts lcCost = ClsCosts.NewCost(cbCostType.SelectedIndex);

            if (lcCost != null && lcCost.ViewEdit())
            {
                _Costs = lcCost;
                _Tour.CostList.Add(_Costs);
                updateDisplay();
            }
        }
示例#2
0
        //edit an existing cost
        private void btnEditCosts_Click(object sender, EventArgs e)
        {
            ClsCosts lcCost = (ClsCosts)lbCosts.SelectedItem;

            if (lcCost == null)
            {
                MessageBox.Show("There are no Costs to modify. Create one first", "Confirm", MessageBoxButtons.OK);
            }
            if (lcCost != null && lcCost.ViewEdit())
            {
                updateDisplay();
            }
        }
示例#3
0
        //delete a cost
        private void btnDeleteCosts_Click(object sender, EventArgs e)
        {
            ClsCosts _Cost = (ClsCosts)lbCosts.SelectedItem;

            if (_Cost == null)
            {
                MessageBox.Show("There are no Tours to delete. Create one first", "Confirm", MessageBoxButtons.OK);
            }
            if (MessageBox.Show("Are you sure?", "confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
            {
                _Tour.CostList.Remove(_Cost);
            }
            updateDisplay();
        }
示例#4
0
 //update display when form opens
 public bool ShowDialog(ClsCosts prCost)
 {
     _Costs = prCost;
     updateDisplay();
     return(ShowDialog() == DialogResult.OK);
 }