Example #1
0
 public static void Store(IOKBItem item)
 {
     if (item.Id == 0)
     {
         if (item is Platform)
         {
             item.Id = CallAdministrationService <long>(s => s.AddPlatform((Platform)item));
         }
         else if (item is AlgorithmClass)
         {
             item.Id = CallAdministrationService <long>(s => s.AddAlgorithmClass((AlgorithmClass)item));
         }
         else if (item is Algorithm)
         {
             item.Id = CallAdministrationService <long>(s => s.AddAlgorithm((Algorithm)item));
         }
         else if (item is ProblemClass)
         {
             item.Id = CallAdministrationService <long>(s => s.AddProblemClass((ProblemClass)item));
         }
         else if (item is Problem)
         {
             item.Id = CallAdministrationService <long>(s => s.AddProblem((Problem)item));
         }
     }
     else
     {
         if (item is Platform)
         {
             CallAdministrationService(s => s.UpdatePlatform((Platform)item));
         }
         else if (item is AlgorithmClass)
         {
             CallAdministrationService(s => s.UpdateAlgorithmClass((AlgorithmClass)item));
         }
         else if (item is Algorithm)
         {
             CallAdministrationService(s => s.UpdateAlgorithm((Algorithm)item));
         }
         else if (item is ProblemClass)
         {
             CallAdministrationService(s => s.UpdateProblemClass((ProblemClass)item));
         }
         else if (item is Problem)
         {
             CallAdministrationService(s => s.UpdateProblem((Problem)item));
         }
     }
 }
Example #2
0
 public static void Delete(IOKBItem item)
 {
     if (item is Platform)
     {
         CallAdministrationService(s => s.DeletePlatform(item.Id));
     }
     else if (item is AlgorithmClass)
     {
         CallAdministrationService(s => s.DeleteAlgorithmClass(item.Id));
     }
     else if (item is Algorithm)
     {
         CallAdministrationService(s => s.DeleteAlgorithm(item.Id));
     }
     else if (item is ProblemClass)
     {
         CallAdministrationService(s => s.DeleteProblemClass(item.Id));
     }
     else if (item is Problem)
     {
         CallAdministrationService(s => s.DeleteProblem(item.Id));
     }
     item.Id = 0;
 }