Exemplo n.º 1
0
        public static string zFormatForID(object Expression, int maxLengthB)
        {
            string str = "";

            try
            {
                str = ExCast.zCStr(Expression);
                if (string.IsNullOrEmpty(str))
                {
                    return("");
                }
                if (maxLengthB == 0)
                {
                    return("");
                }
                if (ExCast.IsNumeric(str) == false)
                {
                    return(str);
                }

                string str0 = "";
                for (int i = 1; i <= maxLengthB; i++)
                {
                    str0 += "0";
                }
                return(ExCast.zCDbl(str).ToString(str0));
            }
            catch
            {
                return(str);
            }
        }
Exemplo n.º 2
0
        public static string zRepStrNoQuota(object Expression)
        {
            string n;

            try
            {
                if (Expression != null)
                {
                    n = ExCast.zCStr(Expression);
                    n = n.Replace("'", "");
                    n = n.Replace("\"", "");
                    n = n.Replace(@"\", @"\\");
                    n = n.Replace(";", "");
                    n = n.Replace(" * ", "");
                    n = n.Replace(",", "");
                    return(n);
                }
                else
                {
                    return("");
                }
            }
            catch
            {
                throw;
            }
        }
Exemplo n.º 3
0
        public static string zFormatToDate_YYYYMM(object Expression)
        {
            string str = "";

            try
            {
                str = ExCast.zCStr(Expression);
                if (string.IsNullOrEmpty(str))
                {
                    return("");
                }
                if (str.Length != 6)
                {
                    return(str);
                }

                str = str.Substring(0, 4) + "/" +
                      str.Substring(4, 2);
                return(str);
            }
            catch
            {
                return(str);
            }
        }