示例#1
0
        public Boolean ShowDialog(ClsActivity prActivity)
        {
            _Activity = prActivity;
            UpdateDisplay();
            DialogResult result = ShowDialog();

            return(result == DialogResult.OK);
        }
示例#2
0
        private void EditActivity()
        {
            ClsActivity lcActivity = (ClsActivity)lstActivities.SelectedItem;

            if (lcActivity != null && lcActivity.ViewEdit())
            {
                UpdateDisplay();
            }
        }
示例#3
0
        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();
            }
        }
示例#4
0
        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();
            }
        }