Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Issue Importing Promo Codes in CS 2007

2 views
Skip to first unread message

Steve Harclerode

unread,
Jul 1, 2009, 3:32:06 PM7/1/09
to

I'm using the C# snippet below in a Windows app I'm writing to import some
coupon numbers from a file. I edited the code to simplify it a bit. The code
runs okay with no exceptions.

After it runs, I notice that there is a new entry in the mktg_promocode_defn
table in the _marketing database, as I would expect. There is a field with a
batch status code in the table, i_pcdef_recent_batch_status. This is set to
4, which is the same as PromoCodeOperationStatusCode.Uploading.

I am able to generate random coupon numbers in a batch successfully, and
those entries have the batch status code set to "0", which is the same as
PromoCodeOperationStatusCode.Succeeded.

I don't see error messages for this in the Application Event Log. I have
verified that the SQL agent is running. Any ideas?

private void ImportCodes(string filename)
{
string marketingWebServiceUrl =
ConfigurationManager.AppSettings["MarketingUrl"];
// Create an instance of the Marketing System agent.
MarketingServiceAgent ma = new
MarketingServiceAgent(marketingWebServiceUrl);
marketingSystem = MarketingContext.Create(ma);

PromoCodeDefinition promo =
marketingSystem.PromoCodeDefinitions.NewPromoCodeDefinition(PromoCodeUsageOption.Private,
1);
promo.Name = "Test " + Guid.NewGuid().ToString();
promo.UsageLimit = 1;
promo.Save(true);
BatchInfo batchInfo = new BatchInfo();
batchInfo.BatchId =
marketingSystem.PromoCodeDefinitions.ImportCodes(promo.Id, "batch " +
promo.Id, filename);
}


--
My BizTalk blog:
http://stevestechnotes.blogspot.com/


Steve Harclerode

unread,
Jul 1, 2009, 5:53:52 PM7/1/09
to

Someone just pointed out to me that I had some extra stuff in the example.
Here's another try:

private void ImportCodes(string filename)
{
string marketingWebServiceUrl =
ConfigurationManager.AppSettings["MarketingUrl"];
// Create an instance of the Marketing System agent.
MarketingServiceAgent ma = new
MarketingServiceAgent(marketingWebServiceUrl);
marketingSystem = MarketingContext.Create(ma);

PromoCodeDefinition promo =
marketingSystem.PromoCodeDefinitions.NewPromoCodeDefinition(PromoCodeUsageOption.Private,
1);
promo.Name = "Test " + Guid.NewGuid().ToString();
promo.UsageLimit = 1;
promo.Save(true);

marketingSystem.PromoCodeDefinitions.ImportCodes(promo.Id,
"batch " + promo.Id, filename);
}

"Steve Harclerode" <Lizard....@hot.mail.com> wrote in message
news:eWGq0Ko%23JHA...@TK2MSFTNGP02.phx.gbl...


> I'm using the C# snippet below in a Windows app I'm writing to import some
> coupon numbers from a file. I edited the code to simplify it a bit. The
> code runs okay with no exceptions.
>
> After it runs, I notice that there is a new entry in the
> mktg_promocode_defn table in the _marketing database, as I would expect.
> There is a field with a batch status code in the table,
> i_pcdef_recent_batch_status. This is set to 4, which is the same as
> PromoCodeOperationStatusCode.Uploading.
>
> I am able to generate random coupon numbers in a batch successfully, and
> those entries have the batch status code set to "0", which is the same as
> PromoCodeOperationStatusCode.Succeeded.
>
> I don't see error messages for this in the Application Event Log. I have
> verified that the SQL agent is running. Any ideas?
>
>

0 new messages