示例#1
0
        public ComponentType UpdateComponentType(Guid accountId, UpdateComponentTypeData data)
        {
            var type = GetById(accountId, data.Id.Value);

            if (type.IsSystem)
            {
                throw new CantUpdateSystemObjectException();
            }
            if (string.IsNullOrEmpty(data.DisplayName) == false)
            {
                type.DisplayName = data.DisplayName;
            }
            if (string.IsNullOrEmpty(data.SystemName) == false)
            {
                type.SystemName = data.SystemName;
            }
            var accountdbContext = Context.GetAccountDbContext(accountId);

            accountdbContext.SaveChanges();
            return(type);
        }
示例#2
0
 public static UpdateComponentTypeRequestDtoData GetUpdateComponentTypeRequestDtoData(UpdateComponentTypeData data)
 {
     if (data == null)
     {
         return(null);
     }
     return(new UpdateComponentTypeRequestDtoData()
     {
         SystemName = data.SystemName,
         DisplayName = data.DisplayName,
         Id = data.Id
     });
 }