Пример #1
0
 public void EditEducationalLevel(long id, string iconURI, EducationalLevelType levelType)
 {
     if (ComponentsCache != null && ComponentsCache.ContainsKey(id))
     {
         EducationalLevel level = ComponentsCache[id] as EducationalLevel;
         if (level != null)
         {
             level.Icon  = iconURI ?? level.Icon;
             level.Level = levelType;
             LogChange(level, ContentStatus.Edit);
         }
     }
 }
Пример #2
0
 public long AddEducationalLevel(long parentID, string iconURI, EducationalLevelType type)
 {
     if (ComponentsCache.ContainsKey(parentID)) //check for course
     {
         EducationalLevel level = (ComponentsCache[parentID] as Course).FindEducationLevel(type);
         if (level == null) //there is no existing edu level
         {
             long ID = GetID();
             level = ContentFactory.CreateCompositeComponent(ID, parentID, type, iconURI) as EducationalLevel;
             (ComponentsCache[parentID] as Course).Add(level);
             ComponentsCache[ID] = level;
             LogChange(level, ContentStatus.Add);
             return(ID);
         }
         return(0);
     }
     return(-1);
 }