design question

design question

Post by nic » Fri, 20 Dec 2002 07:18:40



Hi,
I'm building a web form that will contain multiple modules
per page. (i.e the form will consist of a number of ascx
files each containing one or more input boxes and dropdown
lists.  There will also be a seperate ascx page containing
a "submit" button.  (The design requirements need the
ability to move different sections of the form (i.e. the
modules) to different pages etc.)  The appearence of the
webpage will be that it is one form with input boxes.  In
reality the page will consist of one aspx page with a
number of imbedded ascx files.  My problem is how to input
the data into the database.  I'm thingking the submit
button will loop through the control collection for the
form.  It will add all input fields to a dictionary object
or something which will then be used to dynamically build
an insert/update sql statement.  In the past I have used
stored procedures to update the database, but since the
field names and values are dynamic that solution isn't
really viable.  I was curious if any of you had done
anything similar and had any words of advise or warning.

Thanks

 
 
 

design question

Post by Victor Garcia Aprea [MVP » Fri, 20 Dec 2002 11:56:16


Hi Nic,

Quote:>>>but since the field names and values are dynamic

Are you referring to the id of the inputboxes? You could explicity set them
instead of letting asp.net do so.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.


Quote:> Hi,
> I'm building a web form that will contain multiple modules
> per page. (i.e the form will consist of a number of ascx
> files each containing one or more input boxes and dropdown
> lists.  There will also be a seperate ascx page containing
> a "submit" button.  (The design requirements need the
> ability to move different sections of the form (i.e. the
> modules) to different pages etc.)  The appearence of the
> webpage will be that it is one form with input boxes.  In
> reality the page will consist of one aspx page with a
> number of imbedded ascx files.  My problem is how to input
> the data into the database.  I'm thingking the submit
> button will loop through the control collection for the
> form.  It will add all input fields to a dictionary object
> or something which will then be used to dynamically build
> an insert/update sql statement.  In the past I have used
> stored procedures to update the database, but since the
> field names and values are dynamic that solution isn't
> really viable.  I was curious if any of you had done
> anything similar and had any words of advise or warning.

> Thanks


 
 
 

design question

Post by nic » Sat, 21 Dec 2002 00:57:41


Thanks for the reply,
I will explicitly set the id of the inputboxes.  Each form
module (ascx page) will contain a small number of fields.  
For example, one ascx file might contain "user address
information" (address, city, state, zip etc).  The problem
is we don't necessarily want to always have that info on
the first page of a multi-step form.  Maybe one client
will want that info on the second page (combined with
other ascx modules.)  Each step might contain 2-4 modules
or ascx files.  This will make the process shorter but
since we can move the input groups to different sections,
I can't just write a procedure for each page to update the
database, since the input boxes on those pages could
change.  I need a general database update procedure that
can handle a group of fields. Essentially I want to treat
the page as a whole and not individual ascx files.

I just want to see what others think.  

>-----Original Message-----
>Hi Nic,

>>>>but since the field names and values are dynamic
>Are you referring to the id of the inputboxes? You could
explicity set them
>instead of letting asp.net do so.

>--
>Victor Garcia Aprea
>Microsoft MVP | ASP.NET
>To contact me remove 'NOSPAM'. Please post all questions
to the newsgroup
>and not by private mail.



>> Hi,
>> I'm building a web form that will contain multiple
modules
>> per page. (i.e the form will consist of a number of ascx
>> files each containing one or more input boxes and
dropdown
>> lists.  There will also be a seperate ascx page
containing
>> a "submit" button.  (The design requirements need the
>> ability to move different sections of the form (i.e. the
>> modules) to different pages etc.)  The appearence of the
>> webpage will be that it is one form with input boxes.  
In
>> reality the page will consist of one aspx page with a
>> number of imbedded ascx files.  My problem is how to
input
>> the data into the database.  I'm thingking the submit
>> button will loop through the control collection for the
>> form.  It will add all input fields to a dictionary
object
>> or something which will then be used to dynamically
build
>> an insert/update sql statement.  In the past I have used
>> stored procedures to update the database, but since the
>> field names and values are dynamic that solution isn't
>> really viable.  I was curious if any of you had done
>> anything similar and had any words of advise or warning.

>> Thanks

>.

 
 
 

design question

Post by David Yuan [MSF » Sat, 21 Dec 2002 15:02:16


Just a though. If you want to flexibility of moving .ascx controls to
different aspx pages, I guess you may need a general interface to expose
the data collected from the User's input for the .ascx controls. And you
may need a "Controller" object for the aspx page to gather all the data
from all the .ascx controls, and uses appropriate business Rules objects to
update the database.

There is a book on the archetecture of .NET appplication you may have
interest in:
http://microsoft.com/downloads/details.aspx?FamilyId=A08E4A09-7AE3-49...
-CC778A3BAB34&displaylang=en

David Yuan [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
"Got .Net?  http://www.gotdotnet.com".  

 
 
 

1. Software design question

First of all I know that this might not be the correct newsgroup to ask
this, but
then again I don't know of one that focuses on software design and this
group
is by far the one that I know of with so many that deals with software
design.

First let's setup the scene for my question. Imaging we have four diffrent
type
of business objects called Customer, Account, Product and Order. So far so
good. Now imagine an application that uses a treeview to select what objects
you want to view. Now here is where the 'tricky' part comes in. Each
business
object typ can be stored in a hierarchial structure i.e each business object
has
a folder in the treeview root with a corresponding name. So in short it
should
be possible to create child folders for the root and for existing child
folders.

The reason for this is simple. To be able to organize your data. For example
you might want to do something like this for your customers

Customers
    France
        Lyon
        Paris
    Sweden
        Gothenborg
        Stockholm

There is a database present to store business object data (of course
retrieved
by corresponding data access objects). So would you create some kind of
Folder class and Folders class and then store information about them in a
table, i.e using a flat hierarchy

    [Folders table]
    FolderID
    ParentID
    Name

And then have tables for your business objects

    [Customer table]
    CustomerID
    Name

    [Product table]
    ProductID
    Name

And then you could have a table that tells what object is in what folder

    [FolderContents table]
    FolderContentsID
    FolderID
    ObjectID

Of course some kind of Type column would be needed to avoid getting ID
number collisions for the ObjectID. I know the above tables a very crude
and that you most likly will collect data from various tabels for your
business
objects, but I think you get the point.

Also I need the design to be in the form of a hierachical object model so
that
I can support plugins. Something like this would be nice

Application.GetDefaultFolder(FolderType.Customers).Folders(1).Items(2).Name

I'm intressted in getting any information and suggestions you have on
designing
something like this. Thank you for taking the time to read this, and please
don't
hesitate to email me if you have any questions or ask them here for everyone
to
read.

--
Andreas H?kansson
Student of Software Engineering
andreas (at) selfinflicted.org

In a world in which we are all slaves to the laws of gravity,
I'm proud to be counted as one of the freedom fighters.

2. SQL SERVER DBA in WI...Locals or Nearby consultants only....F2F interview...

3. .NET Distributed Design Question

4. base for exponents

5. ADO DB connection management design question...

6. Compressors Comparison Test 6.2 (February 2002)

7. A design question about Connection

8. Group Adimistration with Cisco Secure

9. DataAdapter usage/design question

10. A simple ADO.NET and table design question

11. Design question when using LLBLGen data tier generator

12. Design question...

13. A Design Question for the Experts