码迷,mamicode.com
首页 > 其他好文 > 详细

My Personal Messages

时间:2014-08-25 13:22:14      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:des   http   os   io   cti   amp   sp   new   on   

public string ToPixelClickQueryString(bool appendAll = false)
{
StringBuilder sb = new StringBuilder();
if (this.R > 0 || appendAll) sb.Append("r=" + this.R).Append("&");
if (this.Rt > 0 || appendAll) sb.Append("rt=" + this.Rt).Append("&");
if (this.A > 0 || appendAll) sb.Append("a=" + this.A).Append("&");
if (this.Ls != 0 || appendAll) sb.Append("ls=" + this.Ls).Append("&");
if (this.Ri > 0 || appendAll) sb.Append("ri=" + this.Ri).Append("&");
if (this.C > 0 || appendAll) sb.Append("c=" + this.C).Append("&");
if (this.St != null || appendAll) sb.Append("st=" + (this.St ?? "")).Append("&");
if (this.Ss != null || appendAll) sb.Append("ss=" + (this.Ss ?? "")).Append("&");
if (this.Sp != null || appendAll) sb.Append("sp=" + (this.Sp ?? "")).Append("&");
if (this.Su != null || appendAll) sb.Append("su=" + HttpUtility.UrlEncode(this.Su ?? "")).Append("&");
if (this.Lt != null || appendAll) sb.Append("lt=" + (this.Lt ?? "")).Append("&");
if (this.Lu != null || appendAll) sb.Append("lu=" + HttpUtility.UrlEncode(this.Lu ?? "")).Append("&");
sb.Append("jumpurl=" + HttpUtility.UrlEncode(this.JumpUrl ?? "")).Append("&");
if (this.Cb != null || appendAll) sb.Append("cb=" + (this.Cb ?? ""));

return sb.ToString().TrimEnd(‘&‘);
}

public void SetTrackingValues(SourceType sourceType, SourceSection sourceSection, SourcePlacement sourcePlacement, LandingType landingType, int? sourceAffiliateId = null, long? coupleRegistryId = null, int? retailerId = null, string landingUrl = null, string sourceUrl = null, int landingSiteId = 0)
{
this.SetTrackingValues(sourceType.ToString(), sourceSection.ToString(), sourcePlacement.ToString(), landingType.ToDescription(), sourceAffiliateId, coupleRegistryId, retailerId, landingUrl, sourceUrl, landingSiteId);
}

public void SetTrackingValues(string sourceType, string sourceSection, string sourcePlacement, string landingType, int? sourceAffiliateId = null, long? coupleRegistryId = null, int? retailerId = null, string landingUrl = null, string sourceUrl = null, int landingSiteId = 0)
{
this.St = sourceType;
this.Ss = sourceSection;
this.Sp = sourcePlacement;
this.Lt = landingType;

if (landingUrl != null) this.WithLandingUrl(landingUrl);
if (sourceAffiliateId != null) this.WithSourceAffiliateId(sourceAffiliateId.Value);
if (coupleRegistryId != null) this.WithCoupleRegistryId(coupleRegistryId.Value);
if (retailerId != null) this.WithRetailerId(retailerId.Value);
if (sourceUrl != null) this.WithSourceUrl(sourceUrl);
if (landingSiteId != 0) this.WithLandingSiteId(landingSiteId);
}

My Personal Messages

标签:des   http   os   io   cti   amp   sp   new   on   

原文地址:http://www.cnblogs.com/mawenzhu/p/3934646.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!