Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 2nd, 2006, 07:52 AM
saf saf is offline
Authorized User
 
Join Date: Nov 2006
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Webshop Modification

I am trying to modify the Webshop described in Chapter 9 of Asp.net 2.0 instant results. I need to add a date field. I am creating a food order application so for example my category would be Wendy's, products would be french fries, hamburger, etc. and date of meal would be 11/6/2006. So I could have 2 dates in the system, each with Wendy's as the category with the same products. I was thinking I should add the date field to the category table and make category + date the unique field linking each product to a category and date but I'm not sure this is the best approach. Any thoughts would be greatly appreciated!

Thanks

  #2 (permalink)  
Old November 2nd, 2006, 05:54 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi saf,

I don't understand what you're asking exactly. Can you elaborate a little bit and maybe give some examples?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
  #3 (permalink)  
Old November 2nd, 2006, 07:48 PM
saf saf is offline
Authorized User
 
Join Date: Nov 2006
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK - here goes...
My question is more of a basic database design issue.

The main part of the site will be an order form where users will be ordering meals for certain days. Each Category/Date combination needs to be unique as you could order Chinese on 12/1 and/or on 12/4. For example, the main page will look something like this:

Friday, Dec 1
product price qty subtotal (product/price pulled from database, user enters qty)

Monday, Dec 4
product price qty subtotal

So I somehow need to incorporate the lunchdate into the database design. I guess I'm just not sure what table(s) to add the date field to and how to create the relationships so I minimize the corresonding changes to the application.
I hope I'm explaining myself better. Thank you!
  #4 (permalink)  
Old November 3rd, 2006, 04:46 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Yes, I understand it better now.

So, technically each dates makes a product unique. So, technically you would need to store the date with each product: Chinese on wednesday 10th is different from Chinese on the 11th.

But obviously, you don't want your users to create hundreds of different, but very alike items.

So, instead, I would store the dates in a separate table, like AvailableDate, and create a junction table between this table and the product table, for example: ProductAvailableDate.

Then in the CMS of the shop, a user can select multiple dates (with a Calendar and a GridView for example) that are applicable for a product.

Next, when you query for the relevant products, you can join the Product and the AvailableDate items so you get the relevant product / date combinations. Each product you add to List (Of Poduct) in the GetList method can have an AvailableDate property that you can show on the site.

Does this put you in the right direction? The chapter Appointment Booking Application has something similar. The CMS allows you to make booking objects available for certain days only. Then the bonus walkthrough of that chapter guides you through creating an exception day functionality, which is more or less the reverse of what you're trying to do.

Hope this helps,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
  #5 (permalink)  
Old November 3rd, 2006, 05:46 PM
saf saf is offline
Authorized User
 
Join Date: Nov 2006
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you! This definitely points me in the right direction. I'm new to asp.net and your guidance is greatly appreciated!

saf

  #6 (permalink)  
Old November 3rd, 2006, 07:49 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You're welcome.

Feel free to ask more questions if you need more guidance.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Instant Results Modification of webshop problems malex BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 March 8th, 2007 04:12 PM
Modification on records.....one by one. akshay_rangar ASP.NET 2.0 Basics 0 January 26th, 2007 12:57 PM
Webshop modification El Presidente BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 21 December 6th, 2006 03:14 PM
Kernal Modification!!HOW????? harsh_hot Linux 3 May 28th, 2006 09:23 PM
Installation package modification eelisMX Pro VB.NET 2002/2003 0 April 20th, 2005 03:34 AM



All times are GMT -4. The time now is 11:19 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.