Exemple #1
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            if (_eventCurrentIndex >= 0)
            {
                EventList currentEvent =
                    _sourceEvents[_eventCurrentIndex];

                EventForm newEventForm = new EventForm();

                if (currentEvent.EventEditTag)
                {
                    newEventForm._isReadOnly = true;
                    //return;
                }

                newEventForm.Text     = string.Format(newEventForm.Text, "Edit");
                newEventForm._eventID = currentEvent.EventID;
                newEventForm.ShowDialog(this);
                if (newEventForm._eventList != null)
                {
                    bool deltag = _sourceEvents[_eventCurrentIndex].EventDeleteTag;
                    _sourceEvents[_eventCurrentIndex] = newEventForm._eventList;
                    _sourceEvents[_eventCurrentIndex].EventDeleteTag = deltag;
                }
                newEventForm.Dispose();
            }
        }
 private void dataGridViewEvents_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex != 6)
     {
         AssociatedEventList item      = _sourceEvent[e.RowIndex];
         EventForm           eventForm = new EventForm();
         eventForm._isReadOnly = true;
         eventForm._eventID    = item.EventID;
         eventForm.ShowDialog(this);
         eventForm.Dispose();
     }
 }
Exemple #3
0
        private void buttonNew_Click(object sender, EventArgs e)
        {
            EventForm newEventForm = new EventForm();

            newEventForm.Text = string.Format(newEventForm.Text, "Add");
            if (newEventForm.ShowDialog(this) == DialogResult.OK)
            {
                if (newEventForm._eventList != null)
                {
                    _sourceEvents.Add(newEventForm._eventList);
                    dataGridViewEvent.RowCount = _sourceEvents.Count;
                }
            }
            newEventForm.Dispose();
        }