首页 > 代码库 > My Personal Messages

My Personal Messages

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