Beispiel #1
0
        /// <summary>
        /// call this when a user lands on the Referal Page
        /// </summary>
        /// <param name="context"></param>
        public static bool ProcessReferal(HttpContext context)
        {
            string DecryptString = (string)context.Items["encryptedparams"];

            DecryptString = DecryptString.Replace("xxyyxx12345", @"/");
            DecryptString = DecryptString.Replace("12345xxyyxx", @"\");

            //DecryptString = System.Web.HttpUtility.UrlDecode(DecryptString);
            Referral Refer = null;

            //try
            //{
            DecryptString = RijndaelEncryption.Decrypt(DecryptString);
            string[] Parts = DecryptString.Split(new char[] { ':' });

            ReferrerType RType      = (ReferrerType)Int32.Parse(Parts[0]);
            int          ID         = Int32.Parse(Parts[1]);
            string       ForwardURL = Parts[2];

            Refer = new Referral();
            Refer.ReferralType = (int)RType;

            if (Refer.ReferralType == (int)ReferrerType.CampaignID)
            {
                Refer.CampaignID       = ID;
                Refer.ReferrerMemberID = 0;
                Refer.ContactImportID  = 0;
            }
            else if (Refer.ReferralType == (int)ReferrerType.MemberID)
            {
                Refer.CampaignID       = 0;
                Refer.ReferrerMemberID = ID;
                Refer.ContactImportID  = 0;
            }
            else if (Refer.ReferralType == (int)ReferrerType.ContactImportID)
            {
                Refer.CampaignID       = 0;
                Refer.ReferrerMemberID = 0;
                Refer.ContactImportID  = ID;
            }

            Refer.Save();

            Refer.ForwardURL = ForwardURL;

            context.Session["Referral"] = Refer;
            context.Response.Redirect(Refer.ForwardURL);

            return(true);
            //}
            //catch { }

            //return false;
        }
Beispiel #2
0
        /// <summary>
        /// Obselete Method...
        /// </summary>
        /// <param name="RType"></param>
        /// <param name="ID"></param>
        /// <param name="ForwardURL"></param>
        /// <returns></returns>
        public static string Encrypt(ReferrerType RType, int ID, string ForwardURL)
        {
            string EncryptString = ((int)RType).ToString() + ":" + ID.ToString() + ":" + ForwardURL;

            EncryptString = RijndaelEncryption.Encrypt(EncryptString);

            //EncryptString = EncryptString.Substring(0, EncryptString.Length - 2);

            //EncryptString = System.Web.HttpUtility.UrlEncodeUnicode(EncryptString);

            return(EncryptString);
        }