Lost Password?


Go Back   CodeCall Programming Forum > Software Development > General Programming

General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-31-2007, 05:25 AM
jhenry2808's Avatar   
jhenry2808 jhenry2808 is offline
Newbie
 
Join Date: Oct 2007
Location: Hanoi
Posts: 5
Rep Power: 0
jhenry2808 is on a distinguished road
Send a message via Yahoo to jhenry2808
Default Question about db design & webpage implementation

Hello,

I have a question regards to ASP.NET 2.0

I'm developing a travel website, using a SQL Server 2000 database. This database contains COMPANIES table, which stores all travel company info.

Now, I would like to store some extra info for some kinds of travel companies (not all companies), for ex only for tour operators, hotels and travel agents.

I intend to design the database like this:

COMPANIES (id, name, ...)
TOUR_OPERATORS (id, company_id, ...)
HOTELS (id, company_id, ...)
TRAVEL_AGENTS (id, company_id, ...)

Each tour operators, hotels and travel agents has all properties from COMPANIES table (company_id is foreign key)

and some specific properties.

Now I have to build a listing page, a search page, and a detailed page for all companies.

I would like to know if there is a better solution to design the database and how to build the listing, search and detailed pages. Do I have to build 3 different pages for each type of companies or should I use only 1 page and use "if/else" there?

Thank you very much.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 10-31-2007, 07:46 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,199
Last Blog:
Ext JS or Ext GWT
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

Looks like a good database design. When you say they will contain "ALL" information of the other tables you mean you will be using a join or a view to show that data correct?

If it were me I would create one search page that would allow you to specify what you were searching. For example, you could include a get or post variable (that was retrieved from an option/select box) that contained a number. If number=1 then search this, 2 this. Instead of if statements I suggest using switch/case though.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-31-2007, 09:41 PM
jhenry2808's Avatar   
jhenry2808 jhenry2808 is offline
Newbie
 
Join Date: Oct 2007
Location: Hanoi
Posts: 5
Rep Power: 0
jhenry2808 is on a distinguished road
Send a message via Yahoo to jhenry2808
Default

Thank you very much for your answer

Yes, I do think that it's a good solution if there aren't many kinds of companies. If I want to add some more types, for ex Resorts, Airlines, Restaurants ... it will be a problem to handle pages, for ex visible / invisible controls, displaying fields, a lot of switch/case, heavy page load ...

Then, I would like to know if building different pages for each types of companies is a possible solution? Or is there any other solution for this situation?

I would appreciate any answer.

And I would like to express my warmest greeting to forum codecall.net, I think I will use this forum to improve my knowledge and contribute more to community.

Sorry for my English, too
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-01-2007, 07:48 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,199
Last Blog:
Ext JS or Ext GWT
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

It sounds like your project may grow fairly large. You might want to build a base page and then add modules for each type of company. Your main page may work like this:

Code:
switch
   case "AirCompany":
                  doAir;
                  break;

   case "Train":
                 doTrain;
                  break;
And then your modules (which you have already included):

Code:
function doTrain ()
{
            // Code.....
           if (number == 1)
                   ......
}
But of course there are many ways to do this and whatever you feel comfortable with is the correct way.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 11-01-2007, 07:57 PM
Kaabi's Avatar   
Kaabi Kaabi is offline
Programming God
 
Join Date: Jul 2006
Posts: 884
Rep Power: 14
Kaabi is on a distinguished road
Default

I don't know much about the database portion of that, but I think it's interesting how you're making a travel website.
__________________
Cheap Airsoft Guns

If you are looking for high-quality, yet cheap, airsoft guns, then check out MrAirsoft.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What Programs do you use for web design TVDinner Website Design 113 07-17-2008 12:14 PM
Tables or DIVs for webpage design... Johnnyboy Website Design 4 11-11-2007 11:02 AM
mysql/php backbone implementation question for an online cash/gambling game ISee PHP Forum 0 10-30-2007 09:53 AM
Change design to make more $ Montecarlo Website Design 11 07-13-2006 01:05 PM


All times are GMT -5. The time now is 02:02 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 97%

Ads