Esempio n. 1
0
 private void LoadGianHang()
 {
     CuaHang ch = new CuaHang();
     DataSet ds = ch.SelectCuaHangAtViTriCuaHangByKhuVuc(1, intKhuVucID);
     int n = ds.Tables[0].Rows.Count;
     for (int j = 0; j < 4; j++)
     {
         TableRow tr = new TableRow();
         for (int i = 0; i < 4; i++)
         {
             TableCell td = new TableCell();
             string content = "";
             if (j*4 + i < n)
             {
                 content += "<table width=\"100%\" border=\"0\" cellspacing=\"4\" cellpadding=\"0\">";
                 content += "<tr><td><img src=\"." + ds.Tables[0].Rows[j*4 + i]["Anh"] +
                            "\" width=\"110\" height=\"73\" style=\"border:#ece2a4 1px solid\" /></td>";
                 content += "<td><a href=\"#\"><b>" + ds.Tables[0].Rows[j*4 + i]["TenCuaHang"] +
                            "</b></a></td></tr></table>";
             }
             td.Text = content;
             td.HorizontalAlign = HorizontalAlign.Left;
             if (j == 0) td.Width = Unit.Percentage(25);
             tr.Cells.Add(td);
         }
         tblGianHang.Rows.Add(tr);
     }
 }