public Boolean ShowDialog(ClsActivity prActivity) { _Activity = prActivity; UpdateDisplay(); DialogResult result = ShowDialog(); return(result == DialogResult.OK); }
private void EditActivity() { ClsActivity lcActivity = (ClsActivity)lstActivities.SelectedItem; if (lcActivity != null && lcActivity.ViewEdit()) { UpdateDisplay(); } }
private void btnDelete_Click(object sender, EventArgs e) { ClsActivity lcActivity = (ClsActivity)lstActivities.SelectedItem; if (lcActivity != null && DialogResult.Yes == MessageBox.Show("Are you sure you want to delete the selected Activity?", "Delete Activity", MessageBoxButtons.YesNo)) { _Vehicle.ActivityList.Remove(lcActivity); UpdateDisplay(); } }
private void btnAdd_Click(object sender, EventArgs e) { ClsActivity lcActivity = ClsActivity.NewActivity(cbActivityChoice.SelectedIndex); if (lcActivity != null && lcActivity.ViewEdit()) { _Vehicle.ActivityList.Add(lcActivity); DisplayHireCost(); UpdateDisplay(); } }