/// <summary> /// Add a new time zone component /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event arguments</param> private void btnAdd_Click(object sender, EventArgs e) { using (VTimeZoneDlg dlg = new VTimeZoneDlg()) { if (dlg.ShowDialog() == DialogResult.OK) { VTimeZone tz = new VTimeZone(); dlg.GetValues(tz); VCalendar.TimeZones.Add(tz); wasModified = true; LoadGridWithItems(); } } }
/// <summary> /// Edit a time zone component /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event arguments</param> private void btnEdit_Click(object sender, EventArgs e) { if (dgvCalendar.CurrentCellAddress.Y == -1) { MessageBox.Show("Please select an item to edit", "No Item", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } using (VTimeZoneDlg dlg = new VTimeZoneDlg()) { string timeZoneId = (string)dgvCalendar[0, dgvCalendar.CurrentCellAddress.Y].Value; dlg.SetValues(VCalendar.TimeZones[timeZoneId]); if (dlg.ShowDialog() == DialogResult.OK) { dlg.GetValues(VCalendar.TimeZones[timeZoneId]); wasModified = true; LoadGridWithItems(); } } }
/// <summary> /// Edit a time zone component /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event arguments</param> private void btnEdit_Click(object sender, EventArgs e) { if(dgvCalendar.CurrentCellAddress.Y == -1) { MessageBox.Show("Please select an item to edit", "No Item", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } using(VTimeZoneDlg dlg = new VTimeZoneDlg()) { string timeZoneId = (string)dgvCalendar[0, dgvCalendar.CurrentCellAddress.Y].Value; dlg.SetValues(VCalendar.TimeZones[timeZoneId]); if(dlg.ShowDialog() == DialogResult.OK) { dlg.GetValues(VCalendar.TimeZones[timeZoneId]); wasModified = true; LoadGridWithItems(); } } }
/// <summary> /// Add a new time zone component /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event arguments</param> private void btnAdd_Click(object sender, EventArgs e) { using(VTimeZoneDlg dlg = new VTimeZoneDlg()) { if(dlg.ShowDialog() == DialogResult.OK) { VTimeZone tz = new VTimeZone(); dlg.GetValues(tz); VCalendar.TimeZones.Add(tz); wasModified = true; LoadGridWithItems(); } } }