示例#1
0
    private void showinfo(int id)
    {
        switch (UserState.lng)
        {
            case "cn":
                pageVal = 1;
                break;
            case "kr":
                pageVal = 2;
                break;
            case "en":
                pageVal = 3;
                break;
        }

        List<light.Model.news> models = new light.BLL.news().GetModelList(" categoryid=" + id.ToString());
        StringBuilder sb = new StringBuilder();

        light.Model.newscategory model = new light.BLL.newscategory().GetModel(id);

        string title = string.Empty;
        string list = string.Empty;

        if (pageVal == 1)
        {
            title = model.cname;
        }
        else if (pageVal == 2)
        {
            title = model.ename.Split('|')[1];
        }
        else
        {
            title = model.ename.Split('|')[0];
        }
        list = base.newsCategory(pageVal);
        description =base.newsCategoryById(id);

        sb.AppendLine(@" <table style=""z-index: 100"" border=""0"" cellspacing=""0"" cellpadding=""0"" width=""100%"">");
        sb.AppendLine(@"                            <tbody>");

        sb.AppendLine(@"                                <tr>");
        sb.AppendLine(@"                                    <td style=""padding-left: 45px; color: #ffffff; font-size: 14px; font-weight: bold""");

        sb.AppendLine(@"                                        height=""39"" background=""/images/title.jpg"">" + title);
        sb.AppendLine(@"                                    </td>");
        sb.AppendLine(@"                                </tr>");
        sb.AppendLine(@"                                <tr>");
        sb.AppendLine(@"                                    <td style=""padding-bottom: 2px; padding-left: 5px; padding-right: 5px; padding-top: 2px""");
        sb.AppendLine(@"                                        valign=""top"">");
        sb.AppendLine(@"                                        " + list);
        sb.AppendLine(@"                                    </td>");
        sb.AppendLine(@"                                </tr>");
        sb.AppendLine(@"                            </tbody>");
        sb.AppendLine(@"                        </table>");

        leftString = sb.ToString();
    }
示例#2
0
文件: myBase.cs 项目: no10pc/Light
    public string newsCategory(int type)
    {
        StringBuilder myStringBuilder = new StringBuilder();
        myStringBuilder.Append("<div class='syCss_2010461021968'>");
        myStringBuilder.Append("<table class='Board_Tab' width='100%' border='0' cellspacing='0' cellpadding='0'>");
        string catestr = " pkid=1 or pkid =2 ";
        if (type == 1)
            catestr = " pkid=1 or pkid = 2  ";
        else if (type == 2)
            catestr = " pkid=3 or pkid = 4  ";
        else
            catestr = " pkid=5 or pkid = 6  ";

        DataTable dt = new light.BLL.newscategory().GetList(catestr + " ").Tables[0];
        foreach (DataRow dr in dt.Rows)
        {
            myStringBuilder.Append("<tr>");
            myStringBuilder.Append("<td align='center' height='39'  background='/images/left.jpg'>");
            if (type == 1)
            {
                myStringBuilder.Append("<a href='newslist.aspx?id=" + dr["pkid"].ToString() + "' target='_self'>[" + dr["ename"].ToString() + "]</a>");
            }
            else if (type == 2)
            {
                myStringBuilder.Append("<a href='newslist.aspx?id=" + dr["pkid"].ToString() + "' target='_self'>[" + dr["ename"].ToString() + "]</a>");

            }
            else
            {
                myStringBuilder.Append("<a href='newslist.aspx?id=" + dr["pkid"].ToString() + "' target='_self'>[" + dr["ename"].ToString() + "]</a>");

            }

            myStringBuilder.Append("</td>");
            myStringBuilder.Append("</tr>");
        }
        myStringBuilder.Append("</table>");
        myStringBuilder.Append("</div>");
        return myStringBuilder.ToString();
    }