public ActionResult SapXep(bool auto) { string type = ""; if (auto) type = "checkbox"; else type = "radio"; G9Service.G9_Service sv = new G9Service.G9_Service(); string temp = ""; temp += "Năm học"; temp += "<select name=\"namHoc\" id='cbNamHoc'>"; for (int i = 0; i < 3; i++) { temp += "<option value=\"" + (DateTime.Now.Year + i) + "\">" + (DateTime.Now.Year + i) + "</option>"; } temp += "</select>"; temp += "<br />"; ViewData["NamHoc"] = temp; temp = "<fieldset>"; if (auto) temp += "<div><input type='checkbox' class='checkallLop'/>Chọn hết</div><br/>"; Lop[] dsLop = sv.GetDanhSachLop(); foreach (Lop l in dsLop) { temp += "<input type='" + type + "' value='" + l.MaLop + "' id='chkLop" + l.MaLop + "' name='lops'/>" + l.TenLop + "<br/>"; } temp += "</fieldset>"; temp += "<input type=\"submit\" value=\"Sắp xếp\" "+(auto ? "" : "onclick='RedirectTaoMoi();return false;'")+"/>"; ViewData["dsLop"] = temp; return View(); }
public ActionResult DanhSachLop() { G9Service.G9_Service sv = new G9Service.G9_Service(); G9Service.Lop[] list = sv.GetDanhSachLop(); if (list==null || list.Count()<=0) { ViewData["DSLop"] = "Không có lớp"; return View(); } string temp = ""; for (int j = 10; j <= 12; j++) { temp += "<h1 style='padding:10px 0px;'>KHỐI "+j+"</h1>"; 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\">Lớp</li>"; temp += " <li class=\"user_type\">Khối</li>"; temp += " <li class=\"active\">Sỉ số</li>"; temp += " <li class=\"edit\">Thao tác</li>"; temp += " </ul>"; temp += " </li>"; int i = 1; foreach (G9Service.Lop lop in list) { if (lop.KhoiLop == j.ToString()) { temp += " <li class=\"li-atv fl\">"; temp += " <ul>"; temp += " <li class=\"stt\">" + i + "</li>"; temp += " <li class=\"account_name\">" + lop.TenLop + "</li>"; temp += " <li class=\"user_type\">" + lop.KhoiLop + "</li>"; temp += " <li class=\"active\">" + lop.SiSo + "</li>"; temp += " <li class=\"edit\"><div style='padding-left:20px;'><a href='" + Url.Content("~/Lop/CapNhatLop?id=" + lop.MaLop) + "'><div class='btnEdit'></div></a>"; temp += " <a href='" + Url.Content("~/Lop/XoaLop?id=" + lop.MaLop) + "'><div style='margin-left:5px;' class='btnXoa'></div></a></div></li>"; temp += " </ul>"; temp += " </li>"; i++; } } temp += "</ul>"; temp += "</div><br />"; } ViewData["DSLop"] = temp; return View(); }