|
Home > Archive > Content Selection Framework > December 2004 > Order level discount
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Order level discount
|
|
| Sreeku_2002 2004-12-10, 2:46 am |
| Hi andy,
Thank you very much for the your immediate
responses on order level doicounts.As far as the question on evaluating
target groups the
requirement is as follows.The client wants to send direct mails to a a
list of users generated using the various conditions avilable in target
groups.Hence we are trying to make a list from a target group the code is
given below.
The problem is we have to pass each profile to the target expression
seperately for evaluation.there is no way to evaluate a group of users
againist a traget expression or target group.
------------------------------------------------------------
CommerceContext csContext = CommerceContext.Current;
objDebug = csContext.DebugContext;
Microsoft.CommerceServer.Runtime.Targeting.ExpressionEvaluator objexpr =
new
Microsoft.CommerceServer.Runtime.Targeting.ExpressionEvaluator(constr,objDebug);
ProfileContext profContext = CommerceContext.Current.ProfileSystem;
for(int i=0;i<dtProfiles.Rows.Count;i++)
{
bool flag = true;
for(int j=0;j<dtTargetExpr.Rows.Count;j++)
{
Profile prof =
profContext.GetProfile("logon_name",dtProfiles.Rows[i]["u_logon_name"].ToString(),"UserObject");
TargetingProfileCollection profcoll = new
TargetingProfileCollection();
profcoll.Add("UserObject",prof);
if((objexpr.Evaluate((int)dtTargetExpr.Rows[j]["ExprID"],profcoll).ToString()=="True")!=
(dtTargetExpr.Rows[j]["i_target_action"].ToString()=="2"))
{
flag = false;
}
objexpr.FlushCache();
}
if(flag)
{
objLib.AddUserToMailingList(oListID,dtProfiles.Rows[i]["u_email_address"].ToString(),dtProfiles.Rows[i]["g_user_id"].ToString(),
2, 1033, DBNull.Value);
}
}
------------------------------------------------------------
thanks and regards,
sreekanth
| |
| David Messner [MSFT] 2004-12-10, 5:50 pm |
| The thread seems to have been duplicated. Answered in a different post.
-djm
--
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2004 Microsoft Corporation. All rights
reserved.
--------------------
From: "Sreeku_2002" <sreeku_2002@yahoo.com>
Newsgroups: microsoft.public.commerceserver.campaigns_csf
Subject: Order level discount
Date: Thu, 09 Dec 2004 22:47:18 -0500
Organization: www.talkaboutsoftware.com
Message-ID:
< e2c4140149ba9b1b846d94fa42d7741d@localho
st.talkaboutsoftware.com>
X-Newsreader: www.talkaboutsoftware.com
Content-Type: text/plain;
X-Complaints-To: abuse@supernews.com
Lines: 55
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!new
sfeed1.ip.tiscali.net!news.glorb.com!tdsnet-transit!newspeer.tds.net!sn-xit-
03!sn-xit-08!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
Xref: cpmsftngxa10.phx.gbl
microsoft.public.commerceserver.campaigns_csf:2917
X-Tomcat-NG: microsoft.public.commerceserver.campaigns_csf
Hi andy,
Thank you very much for the your immediate
responses on order level doicounts.As far as the question on evaluating
target groups the
requirement is as follows.The client wants to send direct mails to a a
list of users generated using the various conditions avilable in target
groups.Hence we are trying to make a list from a target group the code is
given below.
The problem is we have to pass each profile to the target expression
seperately for evaluation.there is no way to evaluate a group of users
againist a traget expression or target group.
------------------------------------------------------------
CommerceContext csContext = CommerceContext.Current;
objDebug = csContext.DebugContext;
Microsoft.CommerceServer.Runtime.Targeting.ExpressionEvaluator objexpr =
new
Microsoft.CommerceServer.Runtime.Targeting.ExpressionEvaluator(constr,objDeb
ug);
ProfileContext profContext = CommerceContext.Current.ProfileSystem;
for(int i=0;i<dtProfiles.Rows.Count;i++)
{
bool flag = true;
for(int j=0;j<dtTargetExpr.Rows.Count;j++)
{
Profile prof =
profContext.GetProfile("logon_name",dtProfiles.Rows[i]["u_logon_name"].ToStr
ing(),"UserObject");
TargetingProfileCollection profcoll = new
TargetingProfileCollection();
profcoll.Add("UserObject",prof);
if((objexpr.Evaluate((int)dtTargetExpr.Rows[j]["ExprID"],profcoll).ToString(
)=="True")!=
(dtTargetExpr.Rows[j]["i_target_action"].ToString()=="2"))
{
flag = false;
}
objexpr.FlushCache();
}
if(flag)
{
objLib.AddUserToMailingList(oListID,dtProfiles.Rows[i]["u_email_address"].To
String(),dtProfiles.Rows[i]["g_user_id"].ToString(),
2, 1033, DBNull.Value);
}
}
------------------------------------------------------------
thanks and regards,
sreekanth
|
|
|
|
|