示例#1
0
        private void postponeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BLIO.Log("Toolstrip option clicked: Postpone (" + rem.Id + ")");
            int minutes = RemindMePrompt.ShowMinutes("Select your postpone time", "(in minutes or in xhxxm format (1h20m) )");

            if (minutes <= 0)
            {
                BLIO.Log("Postponing reminder with " + minutes + " minutes DENIED.");
                return;
            }

            if (rem.PostponeDate == null)//No postpone yet, create it
            {
                rem.PostponeDate = Convert.ToDateTime(rem.Date.Split(',')[0]).AddMinutes(minutes).ToShortDateString() + " " + Convert.ToDateTime(rem.Date.Split(',')[0]).AddMinutes(minutes).ToShortTimeString();
            }
            else//Already a postponedate, add the time to that date
            {
                rem.PostponeDate = Convert.ToDateTime(rem.PostponeDate).AddMinutes(minutes).ToShortDateString() + " " + Convert.ToDateTime(rem.PostponeDate).AddMinutes(minutes).ToShortTimeString();
            }

            BLReminder.EditReminder(rem);//Push changes

            UCReminders.Instance.UpdateCurrentPage();

            new Thread(() =>
            {
                //Log an entry to the database, for data!
                BLOnlineDatabase.PostponeCount++;
            }).Start();
        }
示例#2
0
        private void postponeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int minutes = RemindMePrompt.ShowMinutes("Select your postpone time", "(in minutes or in xhxxm format (1h20m) )");

            if (rem.PostponeDate == null)//No postpone yet, create it
            {
                rem.PostponeDate = Convert.ToDateTime(rem.Date.Split(',')[0]).AddMinutes(minutes).ToString();
            }
            else//Already a postponedate, add the time to that date
            {
                rem.PostponeDate = Convert.ToDateTime(rem.PostponeDate).AddMinutes(minutes).ToString();
            }

            BLReminder.EditReminder(rem);//Push changes

            UCReminders.GetInstance().UpdateCurrentPage();
        }
        private void btnPostpone_Click(object sender, EventArgs e)
        {
            BLIO.Log("RemindMeMessageForm option clicked: Postpone (" + theReminder.Id + ")");
            isDialog = true;
            int minutes = RemindMePrompt.ShowMinutes("Select your postpone time", "(in minutes or in xhxxm format (1h20m) )");

            if (minutes <= 0)
            {
                BLIO.Log("Postponing reminder with " + minutes + " minutes DENIED.");
                return;
            }

            if (theReminder.PostponeDate == null)//No postpone yet, create it
            {
                theReminder.PostponeDate = Convert.ToDateTime(theReminder.Date.Split(',')[0]).AddMinutes(minutes).ToShortDateString() + " " + Convert.ToDateTime(theReminder.Date.Split(',')[0]).AddMinutes(minutes).ToShortTimeString();
            }
            else//Already a postponedate, add the time to that date
            {
                theReminder.PostponeDate = Convert.ToDateTime(theReminder.PostponeDate).AddMinutes(minutes).ToShortDateString() + " " + Convert.ToDateTime(theReminder.PostponeDate).AddMinutes(minutes).ToShortTimeString();
            }

            BLReminder.EditReminder(theReminder);//Push changes

            UCReminders.Instance.UpdateCurrentPage();

            new Thread(() =>
            {
                //Log an entry to the database, for data!
                try
                {
                    BLOnlineDatabase.PostponeCount++;
                }
                catch (ArgumentException ex)
                {
                    BLIO.Log("Exception at BLOnlineDatabase.PostponeCount++. -> " + ex.Message);
                    BLIO.WriteError(ex, ex.Message, true);
                }
            }).Start();

            btnPostpone.Enabled = false; //bypass bunifu bug
            this.Dispose();
        }