Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textbox with R format
Message
De
07/07/2005 12:05:19
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01029824
Message ID:
01030004
Vues:
21
This message has been marked as a message which has helped to the initial question of the thread.
>>"If the phone is empty, we don't want a warning, but we don't want to save this record either."
>>Do not warn and do not proceed to save routine then (actually isn't that Save routine already doing these checks). I do something like this:
>>
>>
* myEditorButtons::SaveRecord
>>if .BeforeSave()
>> .Save()
>> .AfterSave()
>>endif
>>
I do not use GetFldState() and explicitly check my rules.
>>Cetin
>
>The problem is, what I'm working with a MereMortals framework. The form's save routine is basically like this:
>
>it calls Save method of the main biz object.
>
>The save routine of the biz object has:
>
>If the object changed (or any of its children/grandchildren changed) initiate the save method. First, check rules for this object and its children. Then if everything is fine, save itself, then loop through children and save them. If any of the children has a problem, rollback the whole transaction.
>
>So, I guess, I have to trick IsChanged method for this biz object. E.g. if it's new and empty, I have to return .f., e.g. the object is not changed. So, the record would not be saved.

Well mine similar but hands down when it's a framework that I don't know.

"So, I guess, I have to trick IsChanged method for this biz object. E.g. if it's new and empty, I have to return .f., e.g. the object is not changed. So, the record would not be saved."

Maybe you could do this:
scatter fields fieldlistthatusercoudledit name oBlank memo blank
scatter fields fieldlistthatusercoudledit name oCurrent memo
lIsChanged = !compobj(oBlank,oCurrent)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform