示例#1
0
        public static bool WritePassedTest(AnsweredQuestions answeredQuestions, People people)
        {
            var test = Api.GetElements<Test>(Parameters.Filter, "[Id]", Parameters.Equal, answeredQuestions.TestId).FirstOrDefault();

            if (test == null)
            {
                return false;
            }

            Api.FillElement(test);

            var passedTest = new PassedTest();

            for (var i = 0; i < test.Questions.Length; i++)
            {
                try
                {
                    passedTest.Replies[test.Questions[i]] = answeredQuestions.Replies[i] ?? "";
                }
                catch
                {
                    passedTest.Replies[test.Questions[i]] = "";
                }
            }

            passedTest.SetPeople(people);
            passedTest.SetTest(test);

            Api.ExecuteCommand(Parameters.Insert, passedTest);

            return true;
        }
示例#2
0
        public MainForm(People people, IDataBase db)
        {
            _passedTest = new PassedTest();
            _passedTest.SetPeople(people);

            _db = db;

            InitializeComponent();
        }
示例#3
0
        public static People[] GeneratePeoples(int peopleCount, string position)
        {
            var peoples = new People[peopleCount];

            for (var i = 0; i < peopleCount; i++)
            {
                peoples[i] = new People(Guid.NewGuid().ToString(), position);
            }

            return peoples;
        }
示例#4
0
 public void SetPeople(People people)
 {
     People = People ?? people;
 }