Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. ARRRGGHGHH.... HEADACHE!!

ARRRGGHGHH.... HEADACHE!!

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Robert Collyer
    wrote on last edited by
    #1

    I have a BIG problem... I am really stuck on how to achieve this for aa hotel booking application. Here is a rate card for the hotel:- Jan 8th - March 31st Daily Rate = 19.00 Week Rate = 125.00 April 1st - June 30th Daily Rate = 20.00 Week Rate = 130.00 July 1st - Sept. 17th Daily Rate = 22.00 Week Rate = 140.00 Sept 18th - Dec 3rd Daily Rate = 20.00 Week Rate = 140.00 Dec 4th - Jan 7th Daily Rate = 21.00 Week Rate = 135.00 If someone stays for 10 days, they are charged a week rate and then 3 day rates... should someone stay for 14 days, they are charged 2 week rates, etc. If someone wants to stay 1 week and that stay overlaps rate periods ie, from dec 1st then they are charged the week rate as it is on their arrival day. If they were staying for 2 weeks from dec 1st, then the 1st week would be at one rate and the second week at a different rate. If someone was staying for 10 days for instance from dec 1st, then they would be charged 1 week @ 140.00 and 3 days at 21.00. I hope the above is understandable. If I know the start date and the end date, how the hell can work out the cost?? Any help would sure save me from buying more valium!! Rob

    J 1 Reply Last reply
    0
    • R Robert Collyer

      I have a BIG problem... I am really stuck on how to achieve this for aa hotel booking application. Here is a rate card for the hotel:- Jan 8th - March 31st Daily Rate = 19.00 Week Rate = 125.00 April 1st - June 30th Daily Rate = 20.00 Week Rate = 130.00 July 1st - Sept. 17th Daily Rate = 22.00 Week Rate = 140.00 Sept 18th - Dec 3rd Daily Rate = 20.00 Week Rate = 140.00 Dec 4th - Jan 7th Daily Rate = 21.00 Week Rate = 135.00 If someone stays for 10 days, they are charged a week rate and then 3 day rates... should someone stay for 14 days, they are charged 2 week rates, etc. If someone wants to stay 1 week and that stay overlaps rate periods ie, from dec 1st then they are charged the week rate as it is on their arrival day. If they were staying for 2 weeks from dec 1st, then the 1st week would be at one rate and the second week at a different rate. If someone was staying for 10 days for instance from dec 1st, then they would be charged 1 week @ 140.00 and 3 days at 21.00. I hope the above is understandable. If I know the start date and the end date, how the hell can work out the cost?? Any help would sure save me from buying more valium!! Rob

      J Offline
      J Offline
      jhaga
      wrote on last edited by
      #2

      I would make one function that returns the Daily Rate for any day in the year. Then another function that returns the Weekly Rate of any day in the year. Then the function that calculates how much to charge the customer could simply take the check-in date and then start calling the Daily Rate function for every day he stays and add it up. When he has stayed one week I would delete the sum and instead take the weekly rate etc.. jhaga CodeProject House, Paul Watson wrote: ...and the roar of John Simmons own personal Nascar in the garage. Meg flitting about taking photos.Chris having an heated arguement with Colin Davies and .S.Rod. over egian values. Nish manically typing *censur*. Duncan racing around after his pet *c.* Michael Martin and Bryce loudly yelling *c.* C.G. having a fit as Roger Wright loads up *c.* . Anna waving her *c.* and Deb scoffing chocolates in the corner. ...Good heavens!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups