I'm new to asp.net. Please help me with some ideas about the design of databases and interface of the web site.
We are a public school district, I want to create a website for families to go on line to update their family and student's demographic information. Basically I put the students' infomation pulled from our student information system software on the web, the parents can log in on line to update it at the beginning of school year. After that, I will create some report and let secretary manually do the update to our student information system.
The demographic infor includes 3 parts,
1. family street address, city, state, zip
2 guardian1 primary phones,second phone, emails. primary phones,second phone
3, student date birth, gender. may have multiple students in one family
But how can I track which field parents changed, shall I do it in programming in the web form, or later when I create some kind of reports. For I only want to pull students with the fields that updated and give them to secretary to update manully, and I don't want to generate a full report and let them compare which field is changed and then update, it will take them too much time.
Thanks much in advance
Hello anncao,
> how can I track which field parents changed
the exact implementation depends on your programming skills, so i'll be starting from a basic approach, which should anyway be enough in your scenario:
1) The database: to each field should be associated a flag field (say bit type), telling wether the field has been changed or not (say "street" and "street_changed"); also another flag field should be associated to the record as a whole, to tell if *any* of the fields has been changed (say "rec_changed"). These flags should default to 0 (zero), and be set to 1 when needed.
2) The input form: before any rendering, you should store current field values, possibly in ViewState; after postback and before writing to the database, you should compare each field with its orginal stored value, and set its associated flag field to 1 if it has changed; also you should set the record-level flag in case *any* of the fields have changed. Please note that you will be writing to the database only flags set to 1, and be sure not to overwrite flags already set to 1 even in case in the current postback the user has not changed them...
3) The report: your final report should query the database and retrieve only those records where the record-level flag is set to 1; also, it should show changed fields somewhere marked (say red) in case their associated flag is set to 1 (or you could just show changed fields, or anything; "readability" is what matters here).
Hope this is clear enough. Btw, you could optimize on the flags and make them a single integer field where you work bit-wise level, but if this is too much complexity for you, just don't bother about it, as there's no relevant optimization at this level. Just make the code "readable" as well... ;)
-LV
Thank you very much, that's certainly a good idea. But I still feels hard. I'm new to asp.net, try to use visual web developer express to accomplish this, thinking use the 3 gridview for the 3 parts, and have a update button for each part. for student and family are in different tables.
Is there an easier way I can do it similarly in visual web developer.
or can i make a copy of the tables and then later to compare them? but don't know how to select those fields which are different? we only collect his at the beginning of school year.
Or can you suggest me a book that I can start with how to write those codes ?
I have some experience with VBA, but not asp.net.
Thanks
|||Ignore my previous message, I will go with the way you suggested.
For example I have a family table.if I want to do the way as you described at your posting, do I need to create an object data source, and where shall I write the comparing code?
Thanks
No comments:
Post a Comment