Beispiel #1
0
        public void SetWords()
        {
            cr = new Criterion();
            var w  = new Word("1");
            var w2 = new Word("2");

            cr.SetWords(new[] { w, w2 });

            Assert.IsTrue(cr.Words.Contains(w));
            Assert.IsTrue(cr.Words.Contains(w2));

            cr.SetWords(new[] { w });
            Assert.IsTrue(cr.Words.Contains(w));
            Assert.IsFalse(cr.Words.Contains(w2));
        }
Beispiel #2
0
        protected override void OnOk()
        {
            var opt = QueryEditor.GetOptions();

            criterion.Options       = loader.WriteOptions(opt);
            criterion.OptionsFormat = loader.Format;

            var words = opt.GetAllWords().ToArray();

            criterion.SetWords(words);

            (criterion as IEditableObject).EndEdit();

            if (AuthorityController.CurrentDoctor != null)
            {
                AuthorityController.CurrentDoctor.AddWords(words);
            }

            Session.DoSave(words);
            Session.DoSave(criterion);
        }