RE: FN-FORUM: Coding Logic Problem
date posted 7th July 2007 21:15
STOP SENDING ME MESSAGES I DONT KNOW WHO YOU ARE BUT PLEASE! IVE ALREADY
ASKED NICELY AND U KEEP SENDING THIS!
>From: [EMAIL REMOVED]
>Reply-To: [EMAIL REMOVED]
>To: "FN-FORUM / [EMAIL REMOVED]
[EMAIL REMOVED]
>Subject: RE: FN-FORUM: Coding Logic Problem
>Date: 7 Jul 2007 20:11:40 -0000
>
>
>(I've not replied to the forum before, preferring to lurk :-), so apologies
>if this goes awry)
>
>Hi,
> On a first look only, I think I'd have things like
>
>accommodation, and its specific details, including type
>
>accomodationType, and, say, its price
>
>customers
>
>bookings
>id, accomId, customerId, start, end
>
>the most useful table could be something like
>accomodationBookings
>accomid, bookingID, dateBooked
>and fill this with the 7,14, whatever, daydates the accom is booked (as in
>when an entry is put into bookings and even though they should always be in
>blocks of 7 - at least you can pick up, say, the first 3 days of a month
>even if they are the last three days of a booking). Then you can select all
>the dates it's booked within your display range and use that to colour your
>table. So, a new accom would have no entries, past or future. This table
>would save you having to recalc everything from bookings every time you
>display the table.
>
>As I say, first look only. I'd want to see their 'business rules' before I
>really started coming up with tables and so on.
>
>Cheers,
>
>Richard Tait
>
>
>
>-----Original Message-----
>From: [EMAIL REMOVED] [EMAIL REMOVED] On Behalf Of Colin
>Shipton
>Sent: 07 July 2007 17:26
>To: FN-FORUM / [EMAIL REMOVED]
>Subject: FN-FORUM: Coding Logic Problem
>
>
>Afternoon Experts,
>
>I need some help with some logic which I have been banging my head against
>all day :(
>
>To give you a brief overview:
>
>A client of mine is hiring out a number of self-catering apartments on a
>weekly basis, I have created a yearly calendar split into the separate
>months and I have created 3 tables:
>
>CREATE TABLE [dbo].[accomodation](
> [id] [int] IDENTITY(1,1) PRIMARY KEY,
> [accomodation_name] [varchar](50)
>)
>
>CREATE TABLE [dbo].[price](
> [id] [int] IDENTITY(1,1) PRIMARY KEY,
> [accomodation_id] [int] NOT NULL,
> [year_number] [int] NOT NULL,
> [week_number] [tinyint] NOT NULL,
> [price_week] [money] NULL
>)
>
>CREATE TABLE [dbo].[booking](
> [id] [int] IDENTITY(1,1) NOT NULL,
> [accomodation_id] [int] NOT NULL,
> [date_start] [datetime] NOT NULL,
> [date_end] [datetime] NOT NULL
>)
>
>I have worked out the relevant logic to calculate the week numbers based
>upon the start and end dates of the booking, but what I can't work out is
>how to cater for multiple apartments where there may or may not be a
>booking
>plus the price for the apartment, just to give a further details
>
>There are 3 apartments with different prices for each apartment, on each
>day
>of the calendar I want to change the background of the cell depending upon
>whether each apartment has a booking or not, I have worked out the logic
>for
>whether there is a booking or not, but I can't work out the logic for
>whether each apartment has a booking or not, I don't want to hardcode
>variables etc. as I was this to be flexible as they will probably be buying
>more properties.
>
>I hope this makes sense, please feel free to ask any questions.
>
>Thanks in advance
>
>Colin
>
>
>
>
>
>--
>Freelancers, contractors earn more with Prosperity4
>Call 0870 870 4414 or visit www.prosperity4.com
>and benefit from Inland Revenue approved expenses today.
>
>To advertise here: http://www.freelancers.net/advertising.html
>
>
>--
>Freelancers, contractors earn more with Prosperity4
>Call 0870 870 4414 or visit www.prosperity4.com
>and benefit from Inland Revenue approved expenses today.
>
>To advertise here: http://www.freelancers.net/advertising.html
>
>