IsOnTop | IsMostOnTop | IsLock | IsExtract | PostCounts |
---|---|---|---|---|
No | No | No | No | 0 |
<asp:Image id=imgType runat="server" ImageUrl='<%# GetThreadImg(DataBinder.Eval(Container, "DataItem.IsLock").ToString()+","+DataBinder.Eval(Container, "DataItem.IsMostOnTop").ToString()+","+DataBinder.Eval(Container, "DataItem.IsExtract").ToString()+","+DataBinder.Eval(Container, "DataItem.IsOnTop").ToString()+","+DataBinder.Eval(Container, "DataItem.PostCounts").ToString()) %>' ToolTip='<%# GetThreadTypeInfo(DataBinder.Eval(Container, "DataItem.IsLock").ToString()+","+DataBinder.Eval(Container, "DataItem.IsMostOnTop").ToString()+","+DataBinder.Eval(Container, "DataItem.IsExtract").ToString()+","+DataBinder.Eval(Container, "DataItem.IsOnTop").ToString()+","+DataBinder.Eval(Container, "DataItem.PostCounts").ToString()) %>'>
</asp:Image>
</asp:Image>
CS
/// <summary>
/// 根据贴子的性质取得图标样式,根据Image的ImageUrl属性
/// 根据贴子的性质取得图标样式,根据Image的ImageUrl属性
/// </summary>
/// <param name="ThreadID"></param>
/// <returns></returns>
public string GetThreadImg(string ThreadID)
{
string[] types=ThreadID.Split( new char[]{','});
//先测是否为锁定
if (bool.Parse(types[0]))
return "../Images/Forums/ThreadType1.gif";
//是否为总固顶
if (bool.Parse(types[1]))
return "../Images/Forums/ThreadType2.gif";
//是否为固顶
if (bool.Parse(types[3]))
return "../Images/Forums/ThreadType3.gif";
//再测是否为精华
if (bool.Parse(types[2]))
return "../Images/Forums/ThreadType4.gif";
//是否为热点
if (int.Parse(types[4])>200)
return "../Images/Forums/ThreadType5.gif";
//是后为普通
return"../Images/Forums/ThreadType6.gif";
}
/// <summary>
/// 取得状态的描述信息,根据Image的ToolTip属性
/// </summary>
/// <param name="ThreadID"></param>
/// <returns></returns>
public string GetThreadTypeInfo(string ThreadID)
{
string[] types=ThreadID.Split( new char[]{','});
//先测是否为锁定
if (bool.Parse(types[0]))
return "锁定";
//是否为总固顶
if (bool.Parse(types[1]))
return "总固顶";
//是否为固顶
if (bool.Parse(types[3]))
return "固顶";
//再测是否为精华
if (bool.Parse(types[2]))
return "精华";
//是否为热点
if (int.Parse(types[4])>50)
return "热门";
//是后为普通
return"普通";
}
/// <param name="ThreadID"></param>
/// <returns></returns>
public string GetThreadImg(string ThreadID)
{
string[] types=ThreadID.Split( new char[]{','});
//先测是否为锁定
if (bool.Parse(types[0]))
return "../Images/Forums/ThreadType1.gif";
//是否为总固顶
if (bool.Parse(types[1]))
return "../Images/Forums/ThreadType2.gif";
//是否为固顶
if (bool.Parse(types[3]))
return "../Images/Forums/ThreadType3.gif";
//再测是否为精华
if (bool.Parse(types[2]))
return "../Images/Forums/ThreadType4.gif";
//是否为热点
if (int.Parse(types[4])>200)
return "../Images/Forums/ThreadType5.gif";
//是后为普通
return"../Images/Forums/ThreadType6.gif";
}
/// <summary>
/// 取得状态的描述信息,根据Image的ToolTip属性
/// </summary>
/// <param name="ThreadID"></param>
/// <returns></returns>
public string GetThreadTypeInfo(string ThreadID)
{
string[] types=ThreadID.Split( new char[]{','});
//先测是否为锁定
if (bool.Parse(types[0]))
return "锁定";
//是否为总固顶
if (bool.Parse(types[1]))
return "总固顶";
//是否为固顶
if (bool.Parse(types[3]))
return "固顶";
//再测是否为精华
if (bool.Parse(types[2]))
return "精华";
//是否为热点
if (int.Parse(types[4])>50)
return "热门";
//是后为普通
return"普通";
}