Esempio n. 1
0
        /// <summary>
        /// Created by: Stenner
        /// Date: 3/25/16
        /// </summary>
        /// <remarks>
        /// Updated by: Chris Sheehan
        /// Date: 4/28/16
        /// </remarks>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void submit_Click(object sender, RoutedEventArgs e)
        {
            // save and submit to database
            if (this.title.Text == "" || this.title.Text == null || this.description.Text == "" || this.description.Text == null)
            {
                MessageBox.Show("Please fill out both fields before submitting.");
            }
            else
            {
                Title       = this.title.Text;
                Description = this.description.Text;

                AdminExpertRequestsManager myAdminExpertRequestsManager = new AdminExpertRequestsManager(CurrentUser);

                try
                {
                    myAdminExpertRequestsManager.AddExpertApplication(Title, Description, userID, Time);
                }
                catch (Exception)
                {
                    MessageBox.Show("Record not updated.  Please fill in all fields.");
                }
                finally
                {
                    MessageBox.Show("Your request has been submitted.  Thank you.");
                    this.NavigationService.Navigate(new HomePages.ViewBlog(CurrentUser));
                }
            }
        }