Ejemplo n.º 1
0
      public static bool UpdateAuthorization(DefinitionDto dto, String name, List<String> FeaturesName)
      {
         var featureMap = FeatureAttributeService.GetFeaturePropertiesNameMap();
         List<int> values = FeaturesName.Select(n => featureMap.GetValue(n)).Where(n => n != 0).ToList();
         var authorizationMap = FeatureAttributeService.GetAuthorizationMap();
         FeatureAttributeService.UpdateAuthorizationNameMap(name, values);
         authorizationMap.Remove(dto.Value1);
         authorizationMap[name] = values;

         dto.Value1 = name;
         dto.Value2 = String.Join(",", values);
         return DefinitionDao.Update(dto);
      }
Ejemplo n.º 2
0
 public static bool UpdateCategory(DefinitionDto dto)
 {
    DefinitionDto oldDto = ListCategories.FirstOrDefault(n => n.DefinitionId == dto.DefinitionId);
    bool result = DefinitionDao.Update(dto);
    if (result)
    {
       if (oldDto != null)
          ListCategories.Remove(oldDto);
       ListCategories.Add(dto);
       ListCategories.OrderBy(n => n.DefinitionId);
    }
    return result;
 }