object转成Boolean的中文格式(“是”和“否”) - DataBindBooleanCN
2017-01-26 09:39:24 访问(1589) 赞(0) 踩(0)
/// <summary>
/// object转成Boolean的中文格式(“是”和“否”) - DataBindBooleanCN
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public string DataBindBooleanCN(object obj)
{
if (obj == null)
return "";
if (obj is bool)
{
if ((bool)obj)
return "是";
else
return "否";
}
string str = obj.ToString();
if (str == "1")
return "是";
if (str == "0")
return "否";
return str;
}
标签:
object转成Boolean的中文格式(“是”和“否”) - DataBindBooleanCN 


上一条:
下一条:
相关评论
发表评论