예제 #1
0
        public Subject load(string name, bool loadOnlySubjectAndTestNamesWithoutChilds,
                            bool loadAllQuestions)
        {
            Subject sub = new Subject();

            sub.Id = DataSetConverter.fromDsToSingle.toInt.convert(SqlLiteSimpleExecute.
                                                                   execute(queryConfigurator.getSubjectId(name)));
            sub.Name = EncryptWorker.getInstance().decrypt(name);
            int[] testIds = DataSetConverter.fromDsToBuf.toIntBuf.convert(SqlLiteSimpleExecute.
                                                                          execute(queryConfigurator.loadSubjectTestIds(sub.Id)));
            for (int i = 0; i < testIds.Length; i++)
            {
                sub.Tests.Add(testManipulator.load(testIds[i], loadAllQuestions,
                                                   loadOnlySubjectAndTestNamesWithoutChilds));
            }

            return(sub);
        }