Exemplo n.º 1
0
 public void create(Unswer unswer, int questionId)
 {
     if (unswer.IsRight)
     {
         SqlLiteSimpleExecute.execute(queryConfigurator.createUnswer(questionId));
         unswer.Id = DataSetConverter.fromDsToSingle.toInt.convert(SqlLiteSimpleExecute.
                                                                   execute(queryConfigurator.getObjectIdInDevelopStatus(DbTypes.unswer)));
         SqlLiteSimpleExecute.execute(queryConfigurator.setUnswerContent(unswer.Id,
                                                                         EncryptWorker.getInstance().encrypt(unswer.Content)));
         SqlLiteSimpleExecute.execute(queryConfigurator.setUnswerType(unswer.Id,
                                                                      UnswerTypes.rightUnswer));
     }
     else
     {
         SqlLiteSimpleExecute.execute(queryConfigurator.createUnswer(questionId));
         unswer.Id = DataSetConverter.fromDsToSingle.toInt.convert(SqlLiteSimpleExecute.
                                                                   execute(queryConfigurator.getObjectIdInDevelopStatus(DbTypes.unswer)));
         SqlLiteSimpleExecute.execute(queryConfigurator.setUnswerContent(unswer.Id,
                                                                         EncryptWorker.getInstance().encrypt(unswer.Content)));
         SqlLiteSimpleExecute.execute(queryConfigurator.setUnswerType(unswer.Id,
                                                                      UnswerTypes.unswer));
     }
     SqlLiteSimpleExecute.execute(queryConfigurator.setApproveStatusToObject(
                                      DbTypes.unswer));
 }