Example #1
0
        /// <summary>
        /// Ryan Taylor
        /// Created: 2021/02/26
        ///
        /// This method is used to call a window for creating jounral entries.
        /// </summary>
        /// <param name="_user">The userAccount object of the person logged in</param>
        ///<param name="journalName">The name the journal</param>
        ///<param name="_journalEntry"></param>
        ///<exception></exception>
        ///<returns>A window for creating a new journal entry</returns>
        private void btnAddJournalEntry_Click(object sender, RoutedEventArgs e)
        {
            purpose = "AddJournalEntry";
            var CreateJournalEntry = new WPFOtherWindow(_journalEntry, _user, journalName, purpose);

            CreateJournalEntry.ShowDialog();
            _journalUpdated = true;
            UpdateDGJournalEntries();
        }
Example #2
0
        /// <summary>
        /// Ryan Taylor
        /// Created: 2021/03/04
        ///
        /// This method is used to pass the selected journals information
        /// into the other window containing the WPFpCreateViewEditJouranlEntry.
        /// </summary>
        ///<param name="JournalEntry">The selected journal entry object</param>
        ///<param name="JournalName">The name the journal</param>
        ///<exception>if nothing is selected</exception>
        private void dgJournalEntries_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var selectedItem = (DataStorageModels.JournalEntry)dgJournalEntries.SelectedItem;

            if (selectedItem == null)
            {
                return;
            }
            _journalEntry = selectedItem;
            purpose       = "ViewEditJournalEntry";
            var ViewJournalEntry = new WPFOtherWindow(_journalEntry, purpose);

            ViewJournalEntry.ShowDialog();
        }
Example #3
0
        /// <summary>
        /// Ryan Taylor
        /// Created: 2021/03/04
        ///
        /// This method is used to give funtionality to the View button by having it
        /// pass the selected journals information into the other window containing
        /// the WPFpCreateViewEditJouranlEntry.
        /// </summary>
        ///<param name="JournalEntry">The selected journal entry object</param>
        ///<param name="JournalName">The name the journal</param>
        private void btnViewJournalEntry_Click(object sender, RoutedEventArgs e)
        {
            var selectedItem = (DataStorageModels.JournalEntry)dgJournalEntries.SelectedItem;

            if (selectedItem == null)
            {
                return;
            }
            _journalEntry = selectedItem;
            purpose       = "ViewEditJournalEntry";
            var ViewJournalEntry = new WPFOtherWindow(_journalEntry, purpose);

            ViewJournalEntry.ShowDialog();
            _journalUpdated = true;
            UpdateDGJournalEntries();
        }