Beispiel #1
0
        //public static void PromptReminder()
        //{

        //}

        // Adds an alarm
        private void button1_Click(object sender, EventArgs e)
        {
            AlarmSetDialog dlg = new AlarmSetDialog();
            DialogResult   dr  = dlg.ShowDialog();

            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                alarmTime                = new DateTime(dlg.Year, dlg.Month, dlg.Day, dlg.Hour, dlg.Minute, dlg.Second);
                alarmTimeDisplay.Text    = alarmTime.ToLongTimeString();
                alarmLabel.Visible       = true;
                alarmTimeDisplay.Visible = true;
                bwAlarm.RunWorkerAsync();
            }
        }
Beispiel #2
0
 // Adds a reminder to the selected appointment
 private void btnReminder_Click(object sender, EventArgs e)
 {
     if (aptBook.SelectedItem == null)
     {
         MessageBox.Show("Please select a name in the appointment book to add a reminder for. ");
     }
     else
     {
         int            index = aptBook.SelectedIndex;
         AlarmSetDialog dlg   = new AlarmSetDialog();
         DialogResult   dr    = dlg.ShowDialog();
         if (dr == System.Windows.Forms.DialogResult.OK)
         {
             reminderTime = new DateTime(dlg.Year, dlg.Month, dlg.Day, dlg.Hour, dlg.Minute, dlg.Second);
             reminders.Insert(index, reminderTime);
             bwReminder.RunWorkerAsync();
         }
     }
 }