예제 #1
0
        /// <summary>
        /// 获取参数对应的控件
        /// </summary>
        /// <param name="param"></param>
        /// <param name="paramIndex"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public static ParamControl GetControl(String param, int paramIndex, String value)
        {
            if (strUtil.IsNullOrEmpty(param))
            {
                return(null);
            }

            String[] strArray  = param.Split(new char[] { '=' });
            String   itemName  = strArray[0];
            String   itemValue = strArray[1];

            if (itemValue.StartsWith("IntTextbox"))
            {
                IntTextbox intBox = new IntTextbox();
                init(intBox, itemName, paramIndex, value);
                return(intBox);
            }
            if (itemValue.StartsWith("IntDroplist"))
            {
                IntDroplist droplist = new IntDroplist();
                initList(droplist, itemName, paramIndex, value, itemValue);
                return(droplist);
            }
            if (itemValue.StartsWith("StringTextbox"))
            {
                StringTextbox strBox = new StringTextbox();
                init(strBox, itemName, paramIndex, value);
                return(strBox);
            }
            if (itemValue.StartsWith("StringDroplist"))
            {
                StringDroplist droplist = new StringDroplist();
                initList(droplist, itemName, paramIndex, value, itemValue);
                return(droplist);
            }
            if (itemValue.StartsWith("StringRadio"))
            {
                StringRadio radio = new StringRadio();
                initList(radio, itemName, paramIndex, value, itemValue);
                return(radio);
            }
            if (itemValue.StartsWith("StringCheckbox"))
            {
                StringCheckbox checkbox = new StringCheckbox();
                initList(checkbox, itemName, paramIndex, value, itemValue);
                return(checkbox);
            }
            if (itemValue.StartsWith("LongTextbox"))
            {
                LongTextbox longBox = new LongTextbox();
                init(longBox, itemName, paramIndex, value);
                return(longBox);
            }

            return(null);
        }
예제 #2
0
        /// <summary>
        /// 获取参数对应的控件
        /// </summary>
        /// <param name="param"></param>
        /// <param name="paramIndex"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public static ParamControl GetControl( String param, int paramIndex, String value )
        {
            if (strUtil.IsNullOrEmpty( param )) return null;

            String[] strArray = param.Split( new char[] { '=' } );
            String itemName = strArray[0];
            String itemValue = strArray[1];

            if (itemValue.StartsWith( "IntTextbox" )) {
                IntTextbox intBox = new IntTextbox();
                init( intBox, itemName, paramIndex, value );
                return intBox;
            }
            if (itemValue.StartsWith( "IntDroplist" )) {
                IntDroplist droplist = new IntDroplist();
                initList( droplist, itemName, paramIndex, value, itemValue );
                return droplist;
            }
            if (itemValue.StartsWith( "StringTextbox" )) {
                StringTextbox strBox = new StringTextbox();
                init( strBox, itemName, paramIndex, value );
                return strBox;
            }
            if (itemValue.StartsWith( "StringDroplist" )) {
                StringDroplist droplist = new StringDroplist();
                initList( droplist, itemName, paramIndex, value, itemValue );
                return droplist;
            }
            if (itemValue.StartsWith( "StringRadio" )) {
                StringRadio radio = new StringRadio();
                initList( radio, itemName, paramIndex, value, itemValue );
                return radio;
            }
            if (itemValue.StartsWith( "StringCheckbox" )) {
                StringCheckbox checkbox = new StringCheckbox();
                initList( checkbox, itemName, paramIndex, value, itemValue );
                return checkbox;
            }
            if (itemValue.StartsWith( "LongTextbox" )) {
                LongTextbox longBox = new LongTextbox();
                init( longBox, itemName, paramIndex, value );
                return longBox;
            }

            return null;
        }