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; }
public MainForm(People people, IDataBase db) { _passedTest = new PassedTest(); _passedTest.SetPeople(people); _db = db; InitializeComponent(); }
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; }
public void SetPeople(People people) { People = People ?? people; }