Beispiel #1
0
 public void update(Unswer unswer)
 {
     if (DataSetConverter.fromDsToSingle.toInt.convert(
             SqlLiteSimpleExecute.execute(queryConfigurator.countOfObject(unswer.Id))) == 0)
     {
         throw new ObjectIsNotExistYet();
     }
     if (unswer.IsRight)
     {
         SqlLiteSimpleExecute.execute(queryConfigurator.updateUnswerContent(
                                          unswer.Id, EncryptWorker.getInstance().encrypt(unswer.Content)));
         SqlLiteSimpleExecute.execute(queryConfigurator.updateUnswerType(
                                          unswer.Id, DbObjects.rightUnswer));
     }
     else
     {
         SqlLiteSimpleExecute.execute(queryConfigurator.updateUnswerContent(
                                          unswer.Id, EncryptWorker.getInstance().encrypt(unswer.Content)));
         SqlLiteSimpleExecute.execute(queryConfigurator.updateUnswerType(
                                          unswer.Id, DbObjects.unswer));
     }
 }