GetAllCreditsFromPanelBetween

Description

Gets all credits for a given panel to/from/between dates

Signature
PanelistCredit[] GetAllCreditsFromPanelBetween(string key, string panelId, DateTime fromDate, DateTime toDate, DatabaseType databaseType)

Parameters

Name Data Type Description

key

string required

The authentication key

panelId

string required

The panel ID

fromDate

DateTime required

Specifies the from DateTime (including) when the credit was added. If you do not want to use from date, use DateTime.MinValue. The parameter will then be ignored in the whereclause.

toDate

DateTime required

Specifies the to DateTime (including) when the credit was added. If you do not want to use from date, use DateTime.MinValue. The parameter will then be ignored in the whereclause.

databaseType

DatabaseType required

Production or Test.

Response

Data Type Description

A collection of credits.

Example

//***************************************************
//
// Get all credits from panel to/from/between dates
//
//***************************************************

// Create instance of the webservice
PanelCreditSoapClient panelCredit = new PanelCreditSoapClient();

// NOTE: Credits will not be available if the respondent has not completed the spesific survey


//Example 1: How to get credits added to the panel between yesterday and seven days back

// Set fromDate to seven days back from today
fromDate = DateTime.Now.Subtract(new TimeSpan(7,0,0,0));

// Set toDate to yesterday
toDate = DateTime.Now.Subtract(new TimeSpan(1,0,0,0));

// Get credits from panel
PanelistCredit[] allCreditsFromPanelBetween1 = panelCredit.GetAllCreditsFromPanelBetween(key, panelId, fromDate, toDate, DatabaseType.Production);



//Example 2: How to get credits added to the panel from last seven days

// Set fromDate to seven days back from today
fromDate = DateTime.Now.Subtract(new TimeSpan(7,0,0,0));

// Set toDate to MaxValue
toDate = DateTime.MaxValue;

// Get credits from panel
PanelistCredit[] allCreditsFromPanelBetween2 = panelCredit.GetAllCreditsFromPanelBetween(key, panelId, fromDate, toDate, DatabaseType.Production);



//Example 3: How to get credits added to the panel up to last seven days

// Set fromDate to MinValue
fromDate = DateTime.MinValue;

// Set toDate to to seven days back from today
toDate = DateTime.Now.Subtract(new TimeSpan(7,0,0,0));

// Get credits from panel
PanelistCredit[] allCreditsFromPanelBetween3 = panelCredit.GetAllCreditsFromPanelBetween(key, panelId, fromDate, toDate, DatabaseType.Production);