コード例 #1
0
        public static ListItem GetListItem(EStatisticsInputType type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
コード例 #2
0
 public static bool Equals(EStatisticsInputType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
コード例 #3
0
 public static string GetText(EStatisticsInputType type)
 {
     if (type == EStatisticsInputType.Text)
     {
         return("文本框(单行)");
     }
     if (type == EStatisticsInputType.CheckBox)
     {
         return("复选列表(checkbox)");
     }
     if (type == EStatisticsInputType.Radio)
     {
         return("单选列表(radio)");
     }
     if (type == EStatisticsInputType.SelectOne)
     {
         return("下拉列表(select单选)");
     }
     throw new Exception();
 }
コード例 #4
0
 public static string GetValue(EStatisticsInputType type)
 {
     if (type == EStatisticsInputType.Text)
     {
         return("Text");
     }
     if (type == EStatisticsInputType.CheckBox)
     {
         return("CheckBox");
     }
     if (type == EStatisticsInputType.Radio)
     {
         return("Radio");
     }
     if (type == EStatisticsInputType.SelectOne)
     {
         return("SelectOne");
     }
     throw new Exception();
 }
コード例 #5
0
 public static bool Equals(string typeStr, EStatisticsInputType type)
 {
     return(Equals(type, typeStr));
 }