public ActionResult DanhSachPhong() { G9Service.G9_Service sv = new G9Service.G9_Service(); G9Service.Phong[] list = sv.GetDanhSachPhong(); if (list == null || list.Count() <= 0) { ViewData["DSPhong"] = "Không có phòng"; return View(); } string temp = ""; temp += "<div class=\"user-tlb\">"; temp += " <ul style=\"list-style: none\">"; temp += " <li class=\"hder\">"; temp += " <ul>"; temp += " <li class=\"stt\">STT</li>"; temp += " <li class=\"account_name\">Tên phòng</li>"; temp += " <li class=\"user_type\">Tình trạng</li>"; temp += " <li class=\"active\">Sức chứa</li>"; temp += " <li class=\"edit\">Thao tác</li>"; temp += " </ul>"; temp += " </li>"; int i = 1; foreach (G9Service.Phong gv in list) { temp += " <li class=\"li-atv fl\">"; temp += " <ul>"; temp += " <li class=\"stt\">" + i + "</li>"; temp += " <li class=\"account_name\">" + gv.TenPhong + "</li>"; temp += " <li class=\"user_type\">" + gv.TinhTrang + "</li>"; temp += " <li class=\"active\">" + gv.SucChua + "</li>"; temp += " <li class=\"edit\"><div style='padding-left:20px;'><a href='" + Url.Content("~/Phong/CapNhatPhong?id=" + gv.MaPhong) + "'><div class='btnEdit'></div></a>"; temp += " <a href='" + Url.Content("~/Phong/XoaPhong?id=" + gv.MaPhong) + "'><div style='margin-left:5px;' class='btnXoa'></div></a></div></li>"; temp += " </ul>"; temp += " </li>"; i++; } temp += "</ul>"; temp += "</div><br />"; ViewData["DSPhong"] = temp; return View(); }