예제 #1
0
 public AddNewQuestion(Problem problem1, Problem problem2)
 {
     InitializeComponent();
     problem1Label.Text = problem1.ShortName;
     problem2Label.Text = problem2.ShortName;
     _problem1 = problem1;
     _problem2 = problem2;
 }
 public ProblemQuestionRelationship(Problem problem, Question question, int possibleAnswersCount, int negativeAnswersCount)
     : base(DataBaseContext.Session)
 {
     _problem = problem;
     _question = question;
     PossibleAnswersCount = possibleAnswersCount;
     NegativeAnswersCount = negativeAnswersCount;
 }
예제 #3
0
 private void RefreshQuestions(Problem problem)
 {
     questionsListBox.Items.Clear();
     if (problem == null)
         return;
     List<Question> allQuestions = DataBaseContext.Questions.ToList();
     Question[] neededQuestions = (from question in allQuestions
         let flag =
             question.Relationships.All(relationship => relationship.Problem.ShortName != problem.ShortName)
         where flag
         select question).ToArray();
     questionsListBox.DataSource=neededQuestions;
     questionsListBox.DisplayMember = "QuestionText";
 }
예제 #4
0
 public ProblemRatio(Problem problem)
 {
     Problem = problem;
     Ratio = 0;
 }
 public ProblemQuestionRelationship(Problem problem, Question question)
     : this(problem, question, 0, 0)
 {
 }
 public ProblemFoundEventArgs(Problem problem)
 {
     Problem = problem;
 }
예제 #7
0
 public static void UpdateProblem(Problem problem, bool isInscreaseDetectCount = false)
 {
     if (isInscreaseDetectCount)
     {
         problem.DetectedCount++;
     }
     _session.Save(problem);
 }
예제 #8
0
 public static void CreateProblem(Problem problem)
 {
     _problems.Add(problem);
     _session.Save(_problems);
     Debug.Print("Problem {0} saved", problem.ShortName);
 }