Ejemplo n.º 1
0
        public void AddReminder(int id, string subject, string userID)
        {
            //Prompt user for a new reminder or open existing
            RemindersDataset.ReminderTableRow reminder = null;
            dlgReminder dlg = null;

            if (HasReminder(id, userID))
            {
                reminder = (RemindersDataset.ReminderTableRow) this.mReminders.ReminderTable.Select("ID=" + id + " AND UserID='" + userID + "'")[0];
                dlg      = new dlgReminder(reminder);
                dlg.ShowDialog();
            }
            else
            {
                reminder         = this.mReminders.ReminderTable.NewReminderTableRow();
                reminder.ID      = id;
                reminder.Subject = subject;
                reminder.UserID  = userID;
                reminder.Message = "";
                reminder.Time    = DateTime.Now;
                dlg = new dlgReminder(reminder);
                if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    lock (this.mReminders) {
                        this.mReminders.ReminderTable.AddReminderTableRow(id, subject, userID, reminder.Time, reminder.Message);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public void AddReminder(int id,string subject, string userID) {
     //Prompt user for a new reminder or open existing
     RemindersDataset.ReminderTableRow reminder=null;
     dlgReminder dlg=null;
     if(HasReminder(id,userID)) {
         reminder = (RemindersDataset.ReminderTableRow)this.mReminders.ReminderTable.Select("ID=" + id + " AND UserID='" + userID + "'")[0];
         dlg = new dlgReminder(reminder);
         dlg.ShowDialog();
     }
     else {
         reminder = this.mReminders.ReminderTable.NewReminderTableRow();
         reminder.ID = id;
         reminder.Subject = subject;
         reminder.UserID = userID;
         reminder.Message = "";
         reminder.Time = DateTime.Now;
         dlg = new dlgReminder(reminder);
         if(dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
             lock(this.mReminders) {
                 this.mReminders.ReminderTable.AddReminderTableRow(id,subject,userID,reminder.Time,reminder.Message);
             }
         }
     }
 }