private async void FillPresentationBoxes()
 {
     try
     {
         IdLabel.Content          = presentation.PresentationId;
         TitleLabel.Content       = presentation.Title;
         DescriptionBox.Text      = presentation.Description;
         PresenterLabel.Content   = (await authCore.GetAccountByIdAsync(presentation.PresenterId)).Login;
         ArticleLabel.Content     = (await articleCore.GetArticleByIdAsync(presentation.ArticleId)).Topic;
         GradeLabel.Content       = presentation.Grade.HasValue ? presentation.Grade.Value.ToString() : "-";
         SessionTypeLabel.Content = presentation.SpecialSessionId.HasValue ? "Special session:" : "Session:";
         SessionLabel.Content     = presentation.SessionId.HasValue ?
                                    (await sessionCore.GetSessionByIdAsync(presentation.SessionId.Value)).SessionDesc
             : presentation.SpecialSessionId.HasValue
             ? (await sessionCore.GetSpecialSessionByIdAsync(presentation.SpecialSessionId.Value)).SpecialSessionDesc
             : "-";
     }
     catch
     {
         MessageBox.Show("Something went wrong while loading information");
     }
 }
Example #2
0
        private async void EditArticles_Click(object sender, RoutedEventArgs e)
        {
            if (ArticleDataGrid.SelectedIndex >= 0)
            {
                var article = await articleCore.GetArticleByIdAsync(((ArticleDTO)ArticleDataGrid.SelectedItem).ArticleId);

                ArticleDetails newArticleDetailsWindow = new ArticleDetails(article);
                newArticleDetailsWindow.ShowDialog();
            }
            else
            {
                MessageBox.Show("Choose article first");
            }
        }