Esempio n. 1
0
 public string ToPublicDetailString()
 {
     if (String.IsNullOrEmpty(_strCardNumber) || _strCardNumber.Length < 4)
     {
         return(_objCardType.ToString());
     }
     return(_objCardType.ToString() + " *" + StringFunctions.Right(_strCardNumber, 4));
 }
Esempio n. 2
0
 private string GetCardNumberHash()
 {
     if (_strCardNumber.Length > 4)
     {
         return("**** " + StringFunctions.Right(_strCardNumber, 4));
     }
     else
     {
         return(_strCardNumber);
     }
 }
Esempio n. 3
0
        public static FileInfo CompileClientScript(System.Web.UI.ScriptManager objScriptManager)
        {
            _objLog.Clear();
            ArrayList objScripts        = new ArrayList();
            string    strBody           = String.Empty;
            string    strNoCompressBody = String.Empty;
            string    strHeader         = "/*DO NOT REMOVE!! THIS CODE IS USED FOR VERSION CHECKING::: <HASH>";
            string    strPage           = GetPageKey(objScriptManager);
            string    strTargetFolder   = objScriptManager.Page.MapPath("Scripts/Compiled/");
            string    strTargetFile     = strTargetFolder + strPage + ".js";



            foreach (System.Web.UI.ScriptReference objRef in objScriptManager.Scripts)
            {
                string strFile = objScriptManager.Page.MapPath(objRef.Path);
                strHeader += objRef.Path + ":" + GetHashString(strFile) + ":" + IsCompressed(objRef) + ",";

                if (AlwaysCompress)
                {
                    strBody += File.ReadAllText(strFile) + "\r\n\r\n";
                }
                else
                {
                    if (!IsCompressed(objRef))
                    {
                        strNoCompressBody += File.ReadAllText(strFile) + "\r\n\r\n";
                    }
                    else
                    {
                        strBody += File.ReadAllText(strFile) + "\r\n\r\n";
                    }
                }
            }
            if (StringFunctions.Right(strHeader, 1) == ",")
            {
                strHeader = StringFunctions.Shave(strHeader, 1); //Remove last comma
            }
            strHeader += "</HASH>*/";

            //Compression DISABLED 7/2014 for being buggy!!!
            //strBody = General.Utilities.Web.Compression.WebCompress(strBody, General.Utilities.Web.Compression.EnumContentType.Javascript);
            strBody = strNoCompressBody + strBody;
            //_objLog.Write(General.Utilities.Web.Compression.Log.ToString() + StringFunctions.NewLine);
            if (!System.IO.Directory.Exists(strTargetFolder))
            {
                Directory.CreateDirectory(strTargetFolder);
            }
            FileStream   objStream = new FileStream(strTargetFile, FileMode.Create);
            StreamWriter objWriter = new StreamWriter(objStream);

            objWriter.Write(strHeader);
            objWriter.Write(strBody);
            objWriter.Close();
            objWriter.Dispose();
            objStream.Close();
            objStream.Dispose();

            try
            {
                //General.Debugging.Report.SendDebug("Compiling Javascript File: " + strTargetFile, Log.ToString());
            }
            catch { }

            return(new FileInfo(strTargetFile));
        }