Example #1
0
 public static UserPreferences GetUserPreferences()
 {
     if (System.Web.HttpContext.Current.Request.Cookies["UserPref"] != null)
     {
         var             Cookie = System.Web.HttpContext.Current.Request.Cookies["UserPref"].Values;
         UserPreferences upObj  = new UserPreferences();
         upObj.SiteId     = Convert.ToInt32(AESStringCrypto.Decrypt(Cookie["SId"], passPhrase));
         upObj.DivisionId = Convert.ToInt32(AESStringCrypto.Decrypt(Cookie["DId"], passPhrase));
         return(upObj);
     }
     else
     {
         return(null);
     }
 }
Example #2
0
        public static string GetConnectionString()
        {
            if (System.Web.HttpContext.Current.Request.Cookies["DCS"] != null)
            {
                string Ct = (string)System.Web.HttpContext.Current.Request.Cookies["DCS"].Value;

                string Pt = AESStringCrypto.Decrypt(Ct, passPhrase);

                return(Pt);
            }
            else
            {
                return(string.Empty);
            }
        }