Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sort-of macro substitution but setting values
Message
De
22/08/2014 10:32:51
 
 
À
19/08/2014 16:48:46
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01606086
Message ID:
01606275
Vues:
61
Thanks to all who contributed. I didn't get to the other links and helpful hints but just worked with what you provided and got it working so I will review the other options/ideas when time allows.

For lurkers, here is what worked (all irrevelant code removed):
preUpdateFieldValues<Dummy.Entities.Dummy2.VehicleStatusEntity>(VHStatusResultSet, currentEntity => currentEntity.MVehicleKey = "RMKL" + Convert.ToString(currentEntity.MIDKey));
Example of vfp it replaces:
preUpdateFieldValues("m.vehkey='RMKL'+ALLTRIM(STR(m.vehi2)))")
Note: IBusinessResult is the interface for a collection of entities
       public Dummy.Entities.Interfaces.IBusinessResult preUpdateFieldValues<TEntityType>(Dummy.Entities.Interfaces.IBusinessResult entityList, Action<TEntityType> replacementFunction)
        {
            foreach (TEntityType currentEntity in entityList.Entities)
                    replacementFunction(currentEntity);
            return entityList;
        }
Example of vfp code it replaces: Replaces the below section (tcFldChgMacro) in preUpdateFieldValues.prg:
LPARAMETERS tcFldChgMacro
 ….
SCAN
       Scatter memvar memo
       If !Empty(tcFldChgMacro)
             &tcFldChgMacro
       Endif
       Gather memvar memo
ENDSCAN
…
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform