Galactix Home | Main Page | Class Hierarchy | Data Structures | Function List

IAvailability Interface Reference

The IAvailability object. More...

#include <tsssx.idl>

Inherits IDispatch.


Public Methods

HRESULT ToString ([out, retval] BSTR *pVal)
 Get a String representation of this object. More...

HRESULT ParentID ([out, retval] long *pVal)
 Get the ParentID property of this object as a long. More...

HRESULT AlwaysAvailable ([out, retval] BOOL *pVal)
 Get the AlwaysAvailable property of this object as a boolean. More...

HRESULT UseParent ([out, retval] BOOL *pVal)
 Get the UseParent property of this object as a boolean. More...

HRESULT getNumOfStartTimesOnDOW ([in] long lDOW,[out, retval] long *pVal)
 Get the number of start times on a day of the week. More...

HRESULT getNumOfExceptionsOnDOW ([in] long lDOW,[out, retval] long *pVal)
 Get the number of exceptions on a day of the week. More...

HRESULT getNumOfStartTimesOnDate ([in] DATE date,[out, retval] long *pVal)
 Get the number of start times on a specific date. More...

HRESULT getNumOfExceptionsOnDate ([in] DATE date,[out, retval] long *pVal)
 Get the number of exceptions on a specific date. More...

HRESULT getStartTimesOnDOW ([in] long lDOW,[out, retval] IStartTimeCollection **ppICollection)
 Get the collection of IStartTime's on a day of the week. More...

HRESULT getExceptionsOnDOW ([in] long lDOW,[out, retval] IStartTimeCollection **ppICollection)
 Get the collection of IStartTime exceptions on a day of the week. More...

HRESULT getStartTimesOnDate ([in] DATE date,[out, retval] IStartTimeCollection **ppICollection)
 Get the collection of IStartTime's on the specified date. More...

HRESULT getExceptionsOnDate ([in] DATE date,[out, retval] IStartTimeCollection **ppICollection)
 Get the collection of IStartTime exceptions on the specified date. More...

HRESULT getIsAvailableOnDate ([in] DATE date,[out, retval] BOOL *pfVal)
 Figure out if a certain date and time is available. More...


Detailed Description

The IAvailability object.

The IAvailability object represents all the start times for leagues, teams, and tournaments, and it also represents the available time blocks that a venue and official are available. The IStartTime object is used to represent both start times and available time blocks. Use the IAvailability's methods to get the IStartTime's on a certain day of the week, or a specific date. Methods are also provided to get the exceptions on a certain date.

Availability objects can be dependant upon other objects in the project. For example, by default a team's availability is dependant upon the league's availability. If the selected availability is dependant upon another, the getStartTimes methods will automatically go to the parent availability to get the start times or exceptions. To find out if this availability is dependant upon another, look at the UseParent property, or the ParentID property.

Program ID: TSSSX.Availability

Example:

    var oAvailability = team.Availability;
    var sDOW;

    // loop through all the days of the week
    for (i = 0; i < 7; i++)
    {
        switch (i)
        {
            case 0:     // sunday
                sDOW = "Sunday";
                break;
            case 1:     // monday
                sDOW = "Monday";
                break;
            case 2:     // tuesday
                sDOW = "Tuesday";
                break;
            case 3:     // wednesday
                sDOW = "Wednesday";
                break;
            case 4:     // thursday
                sDOW = "Thursday";
                break;
            case 5:     // friday
                sDOW = "Friday";
                break;
            case 6:     // saturday
                sDOW = "Saturday";
                break;
        }

        var eStartTimes = new Enumerator(oAvailability.getStartTimesOnDOW(i));
        Response.WriteLine("Start times on: " + sDOW);
        for (; !eStartTimes.atEnd(); eStartTimes.moveNext())
        {
            Response.WriteLine(eStartTimes.item());
        }
    }

See also:
IStartTime, ILeague, ITeam, IVenue, IOfficial


Member Function Documentation

HRESULT IAvailability::AlwaysAvailable [out, retval] BOOL *    pVal
 

Get the AlwaysAvailable property of this object as a boolean.

Returns:
Returns true if this object is always available, false otherwise.
Example:
    if (obj.Availability.AlwaysAvailable)
    {
        Response.WriteLine("The object " + obj.Name + " is always available for game play.");
    }

HRESULT IAvailability::ParentID [out, retval] long *    pVal
 

Get the ParentID property of this object as a long.

Retrieves the parent availability's ID if one is set. The parent ID will correspond to a ILeague, ITeam, IVenue, or IOfficial. To figure out what type of object the parent ID corresponds to, use the IProject::getObjectType method.

You may also use the UseParent property to determine if this ParentID property is valid.

Returns:
Returns the parent availability's ID, or -1 if there is no parent.
Example:
    if (obj.Availability.UseParent)
    {
        var iType = Project.getObjectType(obj.Availability.ParentID);
        var sType = "unknown";
        switch (iType)
        {
            case 1:     // an ILeague
                sType = "ILeague";
                break;
            case 2:     // an ITeam
                sType = "ITeam";
                break;
            case 3:     // an IVenue
                sType = "IVenue";
                break;
            case 4:     // an IOfficial
                sType = "IOfficial";
                break;
        }

        Response.Write("The parent is of type " + sType);
    }
See also:
IProject::getObjectType()

HRESULT IAvailability::ToString [out, retval] BSTR *    pVal
 

Get a String representation of this object.

Example:

    var sImplicit = "The object '" + obj + "' ToString property was called implicitly.";
    var sDirect = "The object '" + obj.ToString + "' ToString property was called directly.";

HRESULT IAvailability::UseParent [out, retval] BOOL *    pVal
 

Get the UseParent property of this object as a boolean.

Returns:
Returns true if this availability is dependant upon another (and thus the ParentID property is valid), or false otherwise.
Example:
    if (obj.Availability.UseParent)
    {
        Response.WriteLine("This object is dependant upon the object with ID: " + 
            obj.Availability.ParentID);
    }

HRESULT IAvailability::getExceptionsOnDOW [in] long    lDOW,
[out,retval] IStartTimeCollection **    ppICollection
 

Get the collection of IStartTime exceptions on a day of the week.

Parameters:
lDOW  The Day of the Week. 0 = Sunday, 6 = Saturday.
Returns:
Returns a IStartTimeCollection of IStartTime exceptions on the specified day of the week.
Example:
    var eStartTimes = obj.Availability.getExceptionsOnDOW(3);
    for (; !eStartTimes.atEnd(); eStartTimes.moveNext())
    {
        oStartTime = eStartTimes.item();
        // do something with the IStartTime object
    }
See also:
IStartTime, IStartTimeCollection

HRESULT IAvailability::getExceptionsOnDate [in] DATE    date,
[out,retval] IStartTimeCollection **    ppICollection
 

Get the collection of IStartTime exceptions on the specified date.

Parameters:
date  The Date to get the exceptions for.
Returns:
Returns a IStartTimeCollection of IStartTime exceptions on the specified date.
Example:
    var today = new Date("8/15/2001");
    var eStartTimes = obj.Availability.getExceptionsOnDate(today);
    for (; !eStartTimes.atEnd(); eStartTimes.moveNext())
    {
        oStartTime = eStartTimes.item();
        // do something with the IStartTime object
    }
See also:
IStartTime, IStartTimeCollection

HRESULT IAvailability::getIsAvailableOnDate [in] DATE    date,
[out, retval] BOOL *    pfVal
 

Figure out if a certain date and time is available.

Parameters:
date  The Date and time to check.
Returns:
Returns true if available, false otherwise.
Example:
    var oGame = eGames.getGame(0);
    if (obj.Availability.getIsAvailableOnDate(oGame.StartTime))
    {
        // the object is available at this time
    }
    else
    {
        // the object is not available
    }

HRESULT IAvailability::getNumOfExceptionsOnDOW [in] long    lDOW,
[out,retval] long *    pVal
 

Get the number of exceptions on a day of the week.

Parameters:
lDOW  The Day of the Week. 0 = Sunday, 6 = Saturday.
Returns:
Returns the number of start time exceptions on the specified day of the week.
Example:
    Response.Write("There are " + obj.Availability.getNumOfExceptionsOnDOW(2) + 
        " exceptions which fall on Tuesday");

HRESULT IAvailability::getNumOfExceptionsOnDate [in] DATE    date,
[out,retval] long *    pVal
 

Get the number of exceptions on a specific date.

Parameters:
date  The date to get the number of exceptions for.
Returns:
Returns the number of start time exceptions on the specified date.
Example:
    var today = new Date("8/15/2001");
    Response.Write("There are " + obj.Availability.getNumOfExceptionsOnDate(today) + 
        " exceptions which fall on " + today);

HRESULT IAvailability::getNumOfStartTimesOnDOW [in] long    lDOW,
[out,retval] long *    pVal
 

Get the number of start times on a day of the week.

Parameters:
lDOW  The Day of the Week. 0 = Sunday, 6 = Saturday.
Returns:
Returns the number of start times on the specified day of the week.
Example:
    Response.Write("There are " + obj.Availability.getNumOfStartTimesOnDOW(2) + 
        " start times on Tuesdays");

HRESULT IAvailability::getNumOfStartTimesOnDate [in] DATE    date,
[out,retval] long *    pVal
 

Get the number of start times on a specific date.

Parameters:
date  The date to get the number of start times for.
Returns:
Returns the number of start times on the specified date.
Example:
    var today = new Date("8/15/2001");
    Response.Write("There are " + obj.Availability.getNumOfStartTimesOnDate(today) + 
        " start times on " + today);

HRESULT IAvailability::getStartTimesOnDOW [in] long    lDOW,
[out,retval] IStartTimeCollection **    ppICollection
 

Get the collection of IStartTime's on a day of the week.

Parameters:
lDOW  The Day of the Week. 0 = Sunday, 6 = Saturday.
Returns:
Returns a IStartTimeCollection of IStartTime's on the specified day of the week.
Example:
    var eStartTimes = obj.Availability.getStartTimesOnDOW(3);
    for (; !eStartTimes.atEnd(); eStartTimes.moveNext())
    {
        oStartTime = eStartTimes.item();
        // do something with the IStartTime object
    }
See also:
IStartTime, IStartTimeCollection

HRESULT IAvailability::getStartTimesOnDate [in] DATE    date,
[out,retval] IStartTimeCollection **    ppICollection
 

Get the collection of IStartTime's on the specified date.

Parameters:
date  The Date to get the start time for.
Returns:
Returns a IStartTimeCollection of IStartTime's on the specified date.
Example:
    var today = new Date("8/15/2001");
    var eStartTimes = obj.Availability.getStartTimesOnDate(today);
    for (; !eStartTimes.atEnd(); eStartTimes.moveNext())
    {
        oStartTime = eStartTimes.item();
        // do something with the IStartTime object
    }
See also:
IStartTime, IStartTimeCollection


Galactix Home | Main Page | Class Hierarchy | Data Structures | Function List

Copyright © 1996-2007, Galactix Software. All rights reserved.
Questions? Comments? Send email to support@galactix.com