Exemplo n.º 1
0
        private String getDropList( long val ) {
            PropertyCollection plist = new PropertyCollection();
            plist.Add( new PropertyItem( lang( "title" ), 1 ) );
            plist.Add( new PropertyItem( lang( "author" ), 2 ) );

            return Html.DropList( plist, "qtype", "Name", "Value", val );
        }
Exemplo n.º 2
0
        private static PropertyCollection getOptions()
        {
            PropertyCollection p = new PropertyCollection();
            p.Add( new PropertyItem( lang.get( "privacySelf" ), 0 ) );
            p.Add( new PropertyItem( lang.get( "privacyFriend" ), 1 ) );
            p.Add( new PropertyItem( lang.get( "privacyLoggedUser" ), 2 ) );
            p.Add( new PropertyItem( lang.get( "privacyEveryone" ), 3 ) );

            return p;
        }
Exemplo n.º 3
0
        private static PropertyCollection getWeightPropertyList()
        {
            PropertyCollection propertys = new PropertyCollection();

            propertys.Add(new PropertyItem(lang.get("plsSelect"), 0));
            for (int i = 30; i < 131; i++)
            {
                propertys.Add(new PropertyItem(i + " kg", i));
            }
            return(propertys);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取数值列表,用于下拉选项。自动在第一项前面增加“请选择”项,其值为0
        /// </summary>
        /// <param name="intFrom">起始值</param>
        /// <param name="intTo">终止值</param>
        /// <returns>数值列表</returns>
        public static PropertyCollection GetInts(int intFrom, int intTo)
        {
            PropertyCollection propertys = new PropertyCollection();

            propertys.Add(new PropertyItem(lang.get("plsSelect"), 0));

            for (int i = intFrom; i <= intTo; i++)
            {
                propertys.Add(new PropertyItem(i.ToString(), i));
            }

            return(propertys);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取语言包里存储的键值对列表(用于自定义扩展)
        /// </summary>
        /// <param name="langItemName">语言key</param>
        /// <returns></returns>
        public static PropertyCollection GetPropertyList(String langItemName)
        {
            PropertyCollection propertys = new PropertyCollection();
            String             str       = lang.get(langItemName);

            if (strUtil.IsNullOrEmpty(str))
            {
                return(propertys);
            }

            String[] strArray = str.Split(new char[] { '/' });
            foreach (String item in strArray)
            {
                if (strUtil.IsNullOrEmpty(item))
                {
                    continue;
                }
                String[] arrPair = item.Split(new char[] { '-' });
                if (arrPair.Length != 2)
                {
                    continue;
                }
                String name = arrPair[0].Trim();
                int    val  = cvt.ToInt(arrPair[1]);
                propertys.Add(new PropertyItem(name, val));
            }

            return(propertys);
        }
Exemplo n.º 6
0
        private static PropertyCollection getDropOptions( String Options ) {

            PropertyCollection result = new PropertyCollection();
            if (strUtil.IsNullOrEmpty( Options )) return result;

            Dictionary<String, object> dic = JsonParser.Parse( Options ) as Dictionary<String, object>;
            foreach (KeyValuePair<String, object> pair in dic) {
                result.Add( new PropertyItem( pair.Key, cvt.ToInt( pair.Value ) ) );
            }
            return result;
        }
Exemplo n.º 7
0
 private static PropertyCollection getWeightPropertyList()
 {
     PropertyCollection propertys = new PropertyCollection();
     propertys.Add( new PropertyItem( lang.get( "plsSelect" ), 0 ) );
     for (int i = 30; i < 131; i++) {
         propertys.Add( new PropertyItem( i + " kg", i ) );
     }
     return propertys;
 }
Exemplo n.º 8
0
        /// <summary>
        /// ��ȡ���԰���洢�ļ�ֵ���б�(�����Զ�����չ)
        /// </summary>
        /// <param name="langItemName">����key</param>
        /// <returns></returns>
        public static PropertyCollection GetPropertyList( String langItemName )
        {
            PropertyCollection propertys = new PropertyCollection();
            String str = lang.get( langItemName );
            if (strUtil.IsNullOrEmpty( str )) return propertys;

            String[] strArray = str.Split( new char[] { '/' } );
            foreach (String item in strArray) {
                if (strUtil.IsNullOrEmpty( item )) continue;
                String[] arrPair = item.Split( new char[] { '-' } );
                if (arrPair.Length != 2) continue;
                String name = arrPair[0].Trim();
                int val = cvt.ToInt( arrPair[1] );
                propertys.Add( new PropertyItem( name, val ) );
            }

            return propertys;
        }
Exemplo n.º 9
0
        /// <summary>
        /// ��ȡ��ֵ�б����������ѡ��Զ��ڵ�һ��ǰ�����ӡ���ѡ�����ֵΪ0
        /// </summary>
        /// <param name="intFrom">��ʼֵ</param>
        /// <param name="intTo">��ֵֹ</param>
        /// <returns>��ֵ�б�</returns>
        public static PropertyCollection GetInts( int intFrom, int intTo )
        {
            PropertyCollection propertys = new PropertyCollection();
            propertys.Add( new PropertyItem( lang.get( "plsSelect" ), 0 ) );

            for (int i = intFrom; i <= intTo; i++) {
                propertys.Add( new PropertyItem( i.ToString(), i ) );
            }

            return propertys;
        }