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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Need help with scheduling system

Need help with scheduling system

Scheduled Pinned Locked Moved C#
help
3 Posts 3 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.
  • T Offline
    T Offline
    Twyce
    wrote on last edited by
    #1

    i'm doing a scheduling system for booking venues.now i'm supposed to produce code that checks the availability of a venue and if the venue is not available it must suggest anothr slot within the schedule. please help me out with pieces of code that i can use in order for my programme to perform this function.

    S P 2 Replies Last reply
    0
    • T Twyce

      i'm doing a scheduling system for booking venues.now i'm supposed to produce code that checks the availability of a venue and if the venue is not available it must suggest anothr slot within the schedule. please help me out with pieces of code that i can use in order for my programme to perform this function.

      S Offline
      S Offline
      Simon P Stevens
      wrote on last edited by
      #2

      if(!venue.IsAvailable(requestedTime)) { DateTime newTime = venue.SuggestTime(); bool userAcceptedNewTime = false; while(!userAccepedNewTime) { userAcceptedNewTime = DisplayTimeSuggestion(newTime); } requestedTime = newTime; }

      Simon

      1 Reply Last reply
      0
      • T Twyce

        i'm doing a scheduling system for booking venues.now i'm supposed to produce code that checks the availability of a venue and if the venue is not available it must suggest anothr slot within the schedule. please help me out with pieces of code that i can use in order for my programme to perform this function.

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        Here you go:

        public DateTime FindBookableSlot(DateTime dtChosenSlot)
        {
        if (!BookSlot(dtChosenSlot))
        {
        return NextAvailableSlot(dtChosenSlot);
        }

        return dtChosenSlot;
        }

        Cunningly, BookSlot would book the slot, and NextAvailableSlot will book the next available slot and tell you when it is.

        Deja View - the feeling that you've seen this post before.

        My blog | My articles

        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