GetAllCreditsFromPanelistBetween
Description
Gets all credits for a given panelist to/from/between dates
Signature
PanelistCredit[] GetAllCreditsFromPanelistBetween(string key, string panelId, int panelistId, DateTime fromDate, DateTime toDate, DatabaseType databaseType)
Parameters
Name | Data Type | Description |
---|---|---|
key |
string required |
The authentication key |
panelId |
string required |
The panel ID |
panelistId |
int required |
The panelist 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. |
Example
//***************************************************
//
// Get all credits from panelist to/from/between dates
//
//***************************************************
// Create instance of the webservice
PanelCredit panelCredit = new PanelCredit();
// 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 for a spesific panelist,
//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 for a spesific panelist
PanelistCredit[] allCreditsFromPanelistBetween1 = panelCredit.GetAllCreditsFromPanelistBetween(key, panelId, panelistId, fromDate, toDate, DatabaseType.Production);
//Example 2: How to get credits added to the panel for a spesific panelist,
// 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 for a spesific panelist
PanelistCredit[] allCreditsFromPanelistBetween2 = panelCredit.GetAllCreditsFromPanelistBetween(key, panelId, panelistId, fromDate, toDate, DatabaseType.Production);
//Example 3: How to get credits added to the panel for a spesific panelist
// 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 for a spesific panelist
PanelistCredit[] allCreditsFromPanelistBetween3 = panelCredit.GetAllCreditsFromPanelistBetween(key, panelId, panelistId, fromDate, toDate, DatabaseType.Production);