コード例 #1
0
 public void UpdateBusinessDescriptionAndFieldBehaviours(List <DDRecord> _ddRecordsWithUpdates)
 {
     foreach (var update in _ddRecordsWithUpdates)
     {
         var recordsToUpdate = FindMatchingRecordsForGivenUpdate(update);
         if (recordsToUpdate.Count == 0 &&
             (
                 ComponenUniqueNameMap.GridNameMap.ContainsKey(update.Section) ||
                 !string.IsNullOrEmpty(update.DataKey))
             )
         {
             recordsToUpdate.Add(new DDRecord()
             {
                 Id                  = _idProvider.GetNextAvailableId(),
                 ContextName         = update.ContextName,
                 DataKey             = string.IsNullOrEmpty(update.DataKey) ? null : update.DataKey,
                 ComponentUniqueName = string.IsNullOrEmpty(update.DataKey) ? ComponenUniqueNameMap.GridNameMap[update.Section] : string.Empty
             });
         }
         foreach (var foundRecord in recordsToUpdate)
         {
             if (string.IsNullOrEmpty(foundRecord.BusinessDescription))
             {
                 foundRecord.BusinessDescription = update.BusinessDescription;
             }
             if (string.IsNullOrEmpty(foundRecord.FieldBehaviour))
             {
                 foundRecord.FieldBehaviour = update.FieldBehaviour;
             }
             _resultDescriptions.AddRange(recordsToUpdate);
         }
     }
 }