public static ListItem GetListItem(EStatisticsInputType type, bool selected) { var item = new ListItem(GetText(type), GetValue(type)); if (selected) { item.Selected = true; } return(item); }
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); }
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(); }
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(); }
public static bool Equals(string typeStr, EStatisticsInputType type) { return(Equals(type, typeStr)); }