Ejemplo n.º 1
0
        public void update(Subject subject)
        {
            SqlLiteSimpleExecute.execute(queryConfigurator.updateSubjectName(
                                             subject.Id, EncryptWorker.getInstance().encrypt(subject.Name)));

            for (int i = 0; i < subject.Tests.Count; i++)
            {
                try
                {
                    testManipulator.update(subject.Tests.ElementAt(i), subject.Id);
                }
                catch (ObjectIsNotExistYet ex)
                {
                    testManipulator.create(subject.Tests.ElementAt(i), subject.Id);
                }
            }
        }
Ejemplo n.º 2
0
 public void updateTestInBD()
 {
     for (int i = 0; i < store.Count; i++)
     {
         for (int m = 0; m < store.ElementAt(i).Tests.Count; m++)
         {
             if (store.ElementAt(i).Tests.ElementAt(m).IsSelected)
             {
                 try
                 {
                     testManipulator.update(store.ElementAt(i).Tests.ElementAt(m),
                                            store.ElementAt(i).Id);
                 }
                 catch (ObjectIsNotExistYet ex)
                 {
                     testManipulator.create(store.ElementAt(i).Tests.ElementAt(m),
                                            store.ElementAt(i).Id);
                 }
                 return;
             }
         }
     }
 }