private void OKButton_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(textBoxQuestionText.Text)) return; question = new Question(); question.Text = textBoxQuestionText.Text; question.QuizId = Test.QuizId; questionService.Questions.Add(question); var savingResult = questionService.SubmitChanges(); savingResult.Completed += new EventHandler(savingResult_Completed); }
public void OnMoveCommand(Question question) { if (SectionTo == null) return; var quizLoad = quizContext.Load(quizContext.GetQuizsForSectionQuery(SectionTo.SectionId)); quizLoad.Completed += new System.EventHandler(quizLoad_Completed); }
/// <summary> /// Устаревший метод для добавления новых объектов в набор EntitySet Questions. Взамен можно использовать метод .Add связанного свойства ObjectSet<T>. /// </summary> public void AddToQuestions(Question question) { base.AddObject("Questions", question); }
public bool CanMoveCommand(Question question) { return question != null && SectionTo != null; }
/// <summary> /// Создание нового объекта Question. /// </summary> /// <param name="questionId">Исходное значение свойства QuestionId.</param> /// <param name="quizId">Исходное значение свойства QuizId.</param> public static Question CreateQuestion(global::System.Int32 questionId, global::System.Int32 quizId) { Question question = new Question(); question.QuestionId = questionId; question.QuizId = quizId; return question; }