Exemplo n.º 1
0
        public static ListItem GetListItem(EVoteRestrictType type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
Exemplo n.º 2
0
 public static bool Equals(EVoteRestrictType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 3
0
 public static string GetText(EVoteRestrictType type)
 {
     if (type == EVoteRestrictType.NoRestrict)
     {
         return("允许重复投票");
     }
     if (type == EVoteRestrictType.RestrictOneDay)
     {
         return("一天内禁止重复投票");
     }
     if (type == EVoteRestrictType.RestrictOnlyOnce)
     {
         return("每台机只能投一票");
     }
     if (type == EVoteRestrictType.RestrictUser)
     {
         return("每用户只能投一票");
     }
     throw new Exception();
 }
Exemplo n.º 4
0
 public static string GetValue(EVoteRestrictType type)
 {
     if (type == EVoteRestrictType.NoRestrict)
     {
         return("NoRestrict");
     }
     if (type == EVoteRestrictType.RestrictOneDay)
     {
         return("RestrictOneDay");
     }
     if (type == EVoteRestrictType.RestrictOnlyOnce)
     {
         return("RestrictOnlyOnce");
     }
     if (type == EVoteRestrictType.RestrictUser)
     {
         return("RestrictUser");
     }
     throw new Exception();
 }
Exemplo n.º 5
0
 public static string GetText(EVoteRestrictType type)
 {
     if (type == EVoteRestrictType.NoRestrict)
     {
         return("�����ظ�ͶƱ");
     }
     else if (type == EVoteRestrictType.RestrictOneDay)
     {
         return("һ���ڽ�ֹ�ظ�ͶƱ");
     }
     else if (type == EVoteRestrictType.RestrictOnlyOnce)
     {
         return("ÿ̨��ֻ��ͶһƱ");
     }
     else if (type == EVoteRestrictType.RestrictUser)
     {
         return("ÿ�û�ֻ��ͶһƱ");
     }
     else
     {
         throw new Exception();
     }
 }
Exemplo n.º 6
0
        public static EVoteRestrictType GetEnumType(string typeStr)
        {
            EVoteRestrictType retval = EVoteRestrictType.NoRestrict;

            if (Equals(EVoteRestrictType.NoRestrict, typeStr))
            {
                retval = EVoteRestrictType.NoRestrict;
            }
            else if (Equals(EVoteRestrictType.RestrictOneDay, typeStr))
            {
                retval = EVoteRestrictType.RestrictOneDay;
            }
            else if (Equals(EVoteRestrictType.RestrictOnlyOnce, typeStr))
            {
                retval = EVoteRestrictType.RestrictOnlyOnce;
            }
            else if (Equals(EVoteRestrictType.RestrictUser, typeStr))
            {
                retval = EVoteRestrictType.RestrictUser;
            }

            return(retval);
        }
Exemplo n.º 7
0
 public static bool Equals(string typeStr, EVoteRestrictType type)
 {
     return(Equals(type, typeStr));
 }