Esempio n. 1
0
        public ActionResult DanhSachGiaoVien()
        {
            G9Service.G9_Service sv = new G9Service.G9_Service();
            G9Service.GiaoVien[] list = sv.GetDanhSachGiaoVien();

            if (list == null || list.Count() <= 0)
            {
                ViewData["DSGiaoVien"] = "Không có giáo viên";
                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\">Họ tên</li>";
            temp += "                <li class=\"user_type\">Giới tính</li>";
            temp += "                <li class=\"active\">Ngày sinh</li>";
            temp += "                <li class=\"edit\">Thao tác</li>";
            temp += "            </ul>";
            temp += "        </li>";
            int i = 1;
            foreach (G9Service.GiaoVien gv in list)
            {
                temp += "    <li class=\"li-atv fl\">";
                temp += "        <ul>";
                temp += "            <li class=\"stt\">" + i + "</li>";
                temp += "            <li class=\"account_name\">" + gv.TenGiaoVien + "</li>";
                temp += "            <li class=\"user_type\">" + gv.GioiTinh + "</li>";
                temp += "            <li class=\"active\">" + gv.NgaySinh + "</li>";
                temp += "            <li class=\"edit\"><div style='padding-left:20px;'><a href='" + Url.Content("~/GiaoVien/CapNhatGiaoVien?id=" + gv.MaGiaoVien) + "'><div class='btnEdit'></div></a>";
                temp += "            <a href='" + Url.Content("~/GiaoVien/XoaGiaoVien?id=" + gv.MaGiaoVien) + "'><div style='margin-left:5px;' class='btnXoa'></div></a></div></li>";
                temp += "        </ul>";
                temp += "    </li>";
                i++;
            }
            temp += "</ul>";
            temp += "</div><br />";

            ViewData["DSGiaoVien"] = temp;
            return View();
        }
Esempio n. 2
0
        public ActionResult XemThoiKhoaBieuGiaoVien(String giaovien)
        {
            try
            {
                String tmp = "<select id='cbbGiaoVien'>{0}</select>";
                G9Service.G9_Service sv = new G9Service.G9_Service();
                var lst = sv.GetDanhSachGiaoVien();
                String tmpItem = "";
                foreach (var cur in lst)
                {
                    String item = "<option value='{0}'>{1}</option>";
                    item = String.Format(item, cur.MaGiaoVien, cur.TenGiaoVien);
                    tmpItem += item;
                }

                tmp = String.Format(tmp, tmpItem);
                ViewData["strCbbGiaoVien"] = tmp;

                return View();
            }
            catch
            {
                return View("Error");
            }
        }