private void btnEditCost_Click(object sender, EventArgs e) { clsCost lcCost = (clsCost)lstCost.SelectedItem; if (lcCost != null && lcCost.ViewEdit()) { updateLabels(); } }
private void btnDelete_Click(object sender, EventArgs e) { clsCost lcCost = (clsCost)lstCost.SelectedItem; //cost currently selected if (lcCost != null && MessageBox.Show("This cost will be permanantly deleted, would you like to continue?", "Delete Costs", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { _TempTour.CostList.Remove(lcCost); updateLabels(); } }
//=====================Add, Edit, Delete Cost Usecases=============// private void btnAddCost_Click(object sender, EventArgs e) { clsCost lcCost = clsCost.newCost(cboCostType.SelectedIndex); if (lcCost != null && lcCost.ViewEdit()) { _TempTour.CostList.Add(lcCost); updateLabels(); } }
public bool ShowDialog(clsCost prCost) { _Cost = prCost; updateDisplay(); return(ShowDialog() == DialogResult.OK); }