示例#1
0
    public string loadNews(string branchType)
    {
        string result = ""; int i = 1;

        var m = db.sp_web_loadNews(branchType);

        foreach (var item in m.ToList())
        {
            result += "<tr class='detail-rows' id='" + item.Id.ToString() + "' title='Click để xem chi tiết'>";

            result += "<td><img width='120px' height='80px' ";
            if (item.Image != null)
            {
                if (branchType == "1")
                {
                    result += "src ='" + item.Image.Replace("/upload/", "/upload/cnice/") + "' alt='" + item.Title + "'></td>";
                }
                else if (branchType == "2")
                {
                    result += "src ='" + item.Image.Replace("/upload/", "/upload/cfashion/") + "' alt='" + item.Title + "'></td>";
                }
            }
            else
            {
                result += "src ='' alt='" + item.Title + "'></td>";
            }
            result += "<td><span style='font-weight:bold;'><a href='/detail-news/" + item.Id.ToString() + "/" + cl.ConvertToUnSign(item.Title) + ".html'>" + item.Title + "</a></span></br><span style='font-size:11px; font-style:italic;'>" + item.Description + "</span></td>";
            result += "<td style='width:200px;'>" + item.Type + "</td>";
            result += "<td style='width:100px;'>" + item.Status + "</td>";
            result += "<td style='width:100px;'>" + item.CreateAt + "</td>";
            result += "<td style='width:100px;'>" + item.CreateBy + "</td>";
            result += "</tr>";
            i++;
        }
        return(result);
    }