Exemplo n.º 1
0
        /// <summary>
        /// Update PID, First name, Last name eachtime different PID is changed in list
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataContext = _advbDb;
            string date = listBoxIntakeDate.SelectedItem?.ToString();
            string pid  = textBlockPid.Text;

            _advbDb.SetIntakeDate(date);

            _advbDb.Advp(@"select", pid, date);
        }
        /// <summary>
        /// update button for lower half of window
        /// includes a message box to help reduce crashes
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonUpdateADVP_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            /// Message box to make sure date (from bottom half) is selected
            /// or that correct update button is pushed
            if (listBoxAptDate.SelectedItem != null)
            {
                string date = listBoxAptDate.SelectedItem?.ToString();
                string pid  = textBlockPid.Text;

                _wocDb.Advp(@"update", pid, date);
            }
            else
            {
                string            message = "A date to store this information on is not selected. \n";
                string            caption = "Please choose a date and try again.";
                MessageBoxButtons buttons = MessageBoxButtons.OK;
                System.Windows.Forms.MessageBox.Show(message, caption, buttons);
            }
        }