Exemple #1
0
        private async void InitializeSessionFields()
        {
            TitleBox.Text = currentSession.Title;
            BeginDatePicker.SelectedDate = currentSession.BeginDate;
            EndDatePicker.SelectedDate   = currentSession.EndDate;
            ChairmanBox.Text             = (await authCore.GetAccountByIdAsync(currentSession.ChairId)).Login;
            DescriptionBox.Text          = currentSession.Description;
            lastSelectedRoom             = await roomCore.GetRoomByIdAsync(currentSession.RoomId);

            SpecialSessionCheck.IsEnabled = false;
            Refresh_Click(null, null);
            Title = "Edit session";
            AddSessionButton.Content = "Submit";
        }
Exemple #2
0
 private async void LoadData()
 {
     ReviewerLabel.Content = (await core.GetAccountByIdAsync(currentReview.ReviewerId)).Name;
     TitleLabel.Content    = currentReview.Title;
     GradeLabel.Content    = currentReview.Grade;
     CommentBox.Text       = currentReview.Comment;
 }
Exemple #3
0
        private async void DisplayMessages(List <MessageDTO> conversation, int targetId, bool forced = false)
        {
            /*
             * if there is new message , load and if there is no previously loaded msgs , also load
             *
             */
            if (Convert.ToBoolean(await core.HasNewMessages()) || !targeted_conversation.ContainsKey(targetId) || forced)
            {
                if (conversation == null || conversation.Count() == 0)
                {
                    chatBlock.Text = "Your conversation is empty. Say Hi!";
                }
                else
                {
                    string chat_content_buffer = "";
                    foreach (var message in conversation)
                    {
                        String author;
                        if (message.SenderId == UserCredentials.Account.AccountId)
                        {
                            author = "You";
                        }
                        else
                        {
                            AccountDTO receiver_account = await authcore.GetAccountByIdAsync(message.ReceiverId);

                            author = receiver_account.Name;
                        }
                        String msg = message.Date.ToString() + ", " + author + " : " + message.Content + "\n\n";
                        chat_content_buffer = chat_content_buffer + msg;
                    }
                    chatBlock.Text = chat_content_buffer;
                }

                targeted_conversation[targetId] = chatBlock.Text;
            }
            else
            {
                String result;
                targeted_conversation.TryGetValue(targetId, out result);
                if (result != null)
                {
                    chatBlock.Text = result;
                }
            }
        }
Exemple #4
0
 private async void InitializeEditFields()
 {
     TitleBox.Text = currentTask.Title;
     RoleEmployeeBox.SelectedValue = currentTask.EmployeeId;
     DescriptionBox.Text           = currentTask.Description;
     BeginDatePicker.SelectedDate  = currentTask.BeginDate;
     EndDatePicker.SelectedDate    = currentTask.EndDate;
     ManagerLabel.Content          = (await authCore.GetAccountByIdAsync(currentTask.ManagerId)).AccountId;
     SubmitButton.Content          = "Save";
     Title = "Edit Task";
 }
 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");
     }
 }