private void LoadTinTucMoi() { TinTuc tt = new TinTuc(); DataSet ds = tt.SelectByNguoiDungIDPaging(ChuCuaHangID, 1, 5); string content = "<ul class=\"list-news\">"; foreach (DataRow dr in ds.Tables[0].Rows) { content += "<li><a href=\"EstoreNews.aspx?sid=" + CuaHangID + "&nid=" + dr["TinTucID"].ToString() + "\">" + dr["TieuDe"].ToString() + "</a></li>"; } content += "</ul>"; spnTinTuc.InnerHtml = content; }
private void LoadTinTucMoiVaCu() { TinTuc tt = new TinTuc(); DataSet ds = tt.SelectByNguoiDungIDPaging(ChuCuaHangID, 1, 10); string content = "<ul class=\"list-news\">"; string content1 = "<ul class=\"list-news\">"; for (int i = 0; i < ds.Tables[0].Rows.Count; i++ ) { DataRow dr = ds.Tables[0].Rows[i]; if (i < 5) { content += "<li><a href=\"EstoreNews.aspx?sid=" + CuaHangID + "&nid=" + dr["TinTucID"].ToString() + "\">" + dr["TieuDe"].ToString() + "</a></li>"; } else { content1 += "<li><a href=\"EstoreNews.aspx?sid=" + CuaHangID + "&nid=" + dr["TinTucID"].ToString() + "\">" + dr["TieuDe"].ToString() + "</a></li>"; } } content += "</ul>"; content1 += "</ul>"; spnTinTucMoi.InnerHtml = content; spnTinTucCu.InnerHtml = content1; }