RolePermission.Common/HtmlHelpers/GetStringByValue.cs
(完整代码) 1KBusing System.Collections.Generic;
using System.Text;
namespace RolePermission.Common.HtmlHelpers
{
public static class GetStringByValue
{
public static string GetGenderName(this string str)
{
return str == "M" ? "男" : "女";
}
/// <summary>
/// 根据ID获取状态名称
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static string GetStatusName(this string str)
{
switch (str)
{
case "Y":
return "启用";
case "N":
return "停用";
case "D":
return "删除";
default:
return "未知";
}
}
public static string GetStringByList(this List<string> lst)
{
StringBuilder sb = new StringBuilder();
foreach (var v in lst)
{
sb.Append(v + " ");
}
return sb.ToString();
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。