Ejemplo n.º 1
0
        /// <summary>
        /// 设置宏参数指定值
        /// </summary>
        /// <param name="ps">宏参数数组,参数长度不够9则直接返回忽略设置新值</param>
        /// <param name="tp">宏参数类别</param>
        /// <param name="value">宏参数值</param>
        /// <returns>返回宏参数值</returns>
        public static string[] setMacroParam(string[] ps, MacroPmType tp, string value)
        {
            if (null == ps || ps.Length < 9)
            {
                return(ps);
            }
            switch (tp)
            {
            case MacroPmType.pagesize:  ps[0] = regexInt.IsMatch(value) ? value : "1000"; break;

            case MacroPmType.firstnum:  ps[1] = regexInt.IsMatch(value) ? value : "0"; break;

            case MacroPmType.QW: ps[2] = value; break;

            case MacroPmType.FW: ps[3] = value; break;

            case MacroPmType.FGroup: ps[4] = value; break;

            case MacroPmType.FSumcol: ps[5] = value; break;

            case MacroPmType.FWhere: ps[6] = value; break;

            case MacroPmType.topnum: ps[7] = regexInt.IsMatch(value) ? value : "1000"; break;
            }
            return(ps);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 设置宏参数的其中一个值,其他值使用默认值
        /// </summary>
        /// <param name="tp">宏参数类别</param>
        /// <param name="value">宏参数值</param>
        /// <returns>返回设定的宏参数数组</returns>
        public static string[] setMacroParam(MacroPmType tp, string value)
        {
            //字符串替换:pagesize/分页尺寸; firstnum-topnum/分页起止行记录; QW/(1>0,1=1); FW/(2>0,2=2);initFilter/(2>0,2=2);
            //              FGroup/(###); FSumcol/($$$); FWhere/(***)
            string pagesize = "100", firstnum = "0", QW = "", FW = "", FGroup = "", FSumcol = "", FWhere = "", topnum = "1000",
                   initFilter = "";

            string[] psString = new string[] { pagesize, firstnum, QW, FW, FGroup, FSumcol, FWhere, topnum, initFilter };
            return(setMacroParam(psString, tp, value));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// ���ú����ָ��ֵ
 /// </summary>
 /// <param name="ps">���������,�������Ȳ���9��ֱ�ӷ��غ���������ֵ</param>
 /// <param name="tp">��������</param>
 /// <param name="value">�����ֵ</param>
 /// <returns>���غ����ֵ</returns>
 public static string[] setMacroParam(string[] ps, MacroPmType tp, string value)
 {
     if (null == ps || ps.Length < 9)
         return ps;
     switch (tp)
     {
         case MacroPmType.pagesize:  ps[0] = regexInt.IsMatch(value) ? value : "1000"; break;
         case MacroPmType.firstnum:  ps[1] = regexInt.IsMatch(value) ? value : "0"; break;
         case MacroPmType.QW: ps[2] = value; break;
         case MacroPmType.FW: ps[3] = value; break;
         case MacroPmType.FGroup: ps[4] = value; break;
         case MacroPmType.FSumcol: ps[5] = value; break;
         case MacroPmType.FWhere: ps[6] = value; break;
         case MacroPmType.topnum: ps[7] = regexInt.IsMatch(value) ? value : "1000"; break;
     }
     return ps;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// ���ú����������һ��ֵ,����ֵʹ��Ĭ��ֵ
 /// </summary>
 /// <param name="tp">��������</param>
 /// <param name="value">�����ֵ</param>
 /// <returns>�����趨�ĺ��������</returns>
 public static string[] setMacroParam(MacroPmType tp, string value)
 {
     //�ַ����滻��pagesize/��ҳ�ߴ磻 firstnum-topnum/��ҳ��ֹ�м�¼�� QW/(1>0,1=1)�� FW/(2>0,2=2)��initFilter/(2>0,2=2)��
     //              FGroup/(###)�� FSumcol/($$$)�� FWhere/(***)
     string pagesize = "100", firstnum = "0", QW = "", FW = "", FGroup = "", FSumcol = "", FWhere = "", topnum = "1000",
         initFilter = "";
     string[] psString = new string[] { pagesize, firstnum, QW, FW, FGroup, FSumcol, FWhere, topnum, initFilter };
     return setMacroParam(psString, tp, value);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 设置宏参数的其中一个值,其他值使用默认值
 /// </summary>
 /// <param name="tp">宏参数类别</param>
 /// <param name="value">宏参数值</param>
 /// <returns>返回设定的宏参数数组</returns>
 public static string[] setMacroParam(MacroPmType tp, string value)
 {
     //字符串替换:pagesize/分页尺寸; firstnum-topnum/分页起止行记录; QW/(1>0,1=1); FW/(2>0,2=2);initFilter/(2>0,2=2);
     //              FGroup/(###); FSumcol/($$$); FWhere/(***)
     string pagesize = "100", firstnum = "0", QW = "", FW = "", FGroup = "", FSumcol = "", FWhere = "", topnum = "1000",
         initFilter = "";
     string[] psString = new string[] { pagesize, firstnum, QW, FW, FGroup, FSumcol, FWhere, topnum, initFilter };
     return setMacroParam(psString, tp, value);
 }