/// <summary>
        ///
        /// </summary>
        /// <param name="noteText"></param>
        private async void WriteNote(string noteText)
        {
            NoteRequest noteReq = new NoteRequest()
            {
                Id       = 2,
                NoteText = noteText
            };//"{\"Id\": 3,\"NoteText\": \"" + noteText + "\"}";

            ServiceManager noteManager    = new ServiceManager(new Uri(note_base_uri));
            bool           successfulCall = await noteManager.CallPOSTService <NoteRequest>(noteReq);

            if (successfulCall)
            {
                ShowPopupMessage(string.Format("Note successfully updated!\rSet to: {0}", noteText), "Note Update");
            }
            else
            {
                ShowPopupMessage("Note was not able to be updated at this time.", "Note Update");
            }

            UpdateCurrentNoteDisplay();
            NewNoteTextBox.Text = "";

            //Remind the user to set a note every day! <3
            NotificationManager.ScheduleNotification("Don't forget to update your daily Note!", DateTime.Now.AddDays(1), NotificationType.Toast);
            //TODO: Pull schedule info from config
        }
        /// <summary>
        /// Updates note settings
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveSettingsButton_Click(object sender, RoutedEventArgs e)
        {
            int    refreshValue   = int.Parse(RefreshActiveNotesTextBox.Text);
            string timeOptionsVal = ((ComboBoxItem)TimeOptions.SelectedItem).Content.ToString(); //TimeOptions.SelectedValue.ToString();

            NoteSettingsRequest noteSetReq = new NoteSettingsRequest()
            {
                Id = 1,
                NoteRefreshInterval = ConstructTimeSpan(timeOptionsVal, refreshValue).ToString(),
                NumberOfActiveNotes = int.Parse(ActiveNotesTextBox.Text)
            };

            ServiceManager noteSettingsMgr = new ServiceManager(AppConfiguration.NoteSettingsURI);
            var            x = noteSettingsMgr.CallPOSTService <NoteSettingsRequest>(noteSetReq);
        }
Example #3
0
        /// <summary>
        /// Updates note settings
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveSettingsButton_Click(object sender, RoutedEventArgs e)
        {
            int refreshValue = int.Parse(RefreshActiveNotesTextBox.Text);
            string timeOptionsVal = ((ComboBoxItem)TimeOptions.SelectedItem).Content.ToString(); //TimeOptions.SelectedValue.ToString();
            
            NoteSettingsRequest noteSetReq = new NoteSettingsRequest()
            {
                Id = 1,
                NoteRefreshInterval = ConstructTimeSpan(timeOptionsVal,refreshValue).ToString(),
                NumberOfActiveNotes = int.Parse(ActiveNotesTextBox.Text)
            };

            ServiceManager noteSettingsMgr = new ServiceManager(AppConfiguration.NoteSettingsURI);
            var x = noteSettingsMgr.CallPOSTService<NoteSettingsRequest>(noteSetReq);
        }
Example #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="noteText"></param>
        private async void WriteNote(string noteText)
        {
            NoteRequest noteReq = new NoteRequest()
            {
                Id = 2,
                NoteText = noteText
            };//"{\"Id\": 3,\"NoteText\": \"" + noteText + "\"}";

            ServiceManager noteManager = new ServiceManager(new Uri(note_base_uri));
            bool successfulCall = await noteManager.CallPOSTService<NoteRequest>(noteReq);

            if (successfulCall)
                ShowPopupMessage(string.Format("Note successfully updated!\rSet to: {0}", noteText), "Note Update");
            else
                ShowPopupMessage("Note was not able to be updated at this time.", "Note Update");

            UpdateCurrentNoteDisplay();
            NewNoteTextBox.Text = "";

            //Remind the user to set a note every day! <3
            NotificationManager.ScheduleNotification("Don't forget to update your daily Note!", DateTime.Now.AddDays(1), NotificationType.Toast);
            //TODO: Pull schedule info from config
        }