IsTargetUsersOnlyFile Method
Parses the specified file to find out if the file contains promocodes or only target users.
Namespace: Microsoft.CommerceServer.Marketing
Assembly: Microsoft.CommerceServer.Marketing.CrossTierTypes (in Microsoft.CommerceServer.Marketing.CrossTierTypes.dll)
Syntax
'Declaration
Public Function IsTargetUsersOnlyFile ( _
filePath As String, _
usage As PromoCodeUsageOption _
) As Boolean
'Usage
Dim instance As PromoCodeDefinitionManager
Dim filePath As String
Dim usage As PromoCodeUsageOption
Dim returnValue As Boolean
returnValue = instance.IsTargetUsersOnlyFile(filePath, _
usage)
public bool IsTargetUsersOnlyFile(
string filePath,
PromoCodeUsageOption usage
)
public:
bool IsTargetUsersOnlyFile(
String^ filePath,
PromoCodeUsageOption usage
)
public function IsTargetUsersOnlyFile(
filePath : String,
usage : PromoCodeUsageOption
) : boolean
Parameters
- filePath
Type: System..::.String
Full path to the file containing the file to be parsed.
- usage
Type: Microsoft.CommerceServer.Marketing..::.PromoCodeUsageOption
Specifies the type of a promotion code definition.
Return Value
Type: System..::.Boolean
true if file contains only target users; otherwise false.
Exceptions
Exception | Condition |
---|---|
ImportFileFormatException | The format of an imported coupon file is invalid |
ArgumentException | filePath is an empty string |
ArgumentNullException | filePath is nullNothingnullptra null reference (Nothing in Visual Basic) |
FileNotFoundException | The specified file was not found |
DirectoryNotFoundException | The specified file path is invalid |
IOException | The specified path has an incorrect or invalid syntax |
Remarks
The enumeration value shall be one of the following:
Private - The usage limit is the total usage for each generated code, not a per-user usage.
Public - Contains a single code that any user may redeem.
Restricted - These promotion codes have a restriction that only the associated user may redeem the promo code.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
PromoCodeDefinitionManager Class