public ActionResult Edit(BaiHoc baiviet) { if (ModelState.IsValid) { var daoBaiviet = new BaiHocDao(); var res = daoBaiviet.Update(baiviet); if (res) { //ViewBag.ListCSharp = new BaiHocDao().ListAllDmcBaiHocCsharp(); //ViewBag.ListJava = new BaiHocDao().ListAllDmcBaiHocJava(); //ViewBag.ListPython = new BaiHocDao().ListAllDmcBaiHocPython(); ViewBag.DanhMucKT = new DmKienThucDao().ListAll(); return(RedirectToAction("ListKienThuc", "KienThuc")); } else { ModelState.AddModelError("", "Thêm bài học mới thành công"); } } //ViewBag.ListCSharp = new BaiHocDao().ListAllDmcBaiHocCsharp(); //ViewBag.ListJava = new BaiHocDao().ListAllDmcBaiHocJava(); //ViewBag.ListPython = new BaiHocDao().ListAllDmcBaiHocPython(); ViewBag.DanhMucKT = new DmKienThucDao().ListAll(); //SetDropdownlist(); return(View("ListKienThuc")); }
public ActionResult ChiTietBaiHoc(int id) { var danhmuc = new BaiHocDao().ListAllDanhMucID(id); ViewBag.DmBaiHocTheoDmKienThucID = new BaiHocDao().ListAllDanhMucID(danhmuc.DanhMucKienThucID.Value); return(View(danhmuc)); }
public ActionResult Edit(int ID) { ViewBag.DanhMucKT = new DmKienThucDao().ListAll(); var list = new BaiHocDao().ListAllDanhMucID(ID); return(View(list)); }
public JsonResult ListName(string q) { var dulieu = new BaiHocDao().ListNameGoiY(q); return(Json(new { data = dulieu, status = true }, JsonRequestBehavior.AllowGet)); }
public ActionResult Create(BaiHoc baiviet) { if (ModelState.IsValid) { var daoBaiviet = new BaiHocDao(); int id = daoBaiviet.ThemBaiHoc(baiviet); if (id > 0) { return(RedirectToAction("Index", "KienThuc")); } else { ModelState.AddModelError("", "Thêm bài học mới thành công"); } } //SetDropdownlist(); return(View("Index")); }
public static BaiHocDto LayBaiHoc(string ten_tap_tin) { BaiHocDto kq = BaiHocDao.LayBaiDoc(ten_tap_tin); return(kq); }
public ActionResult DmPython() { var model = new BaiHocDao().ListAllDmcBaiHocPython(); return(PartialView(model)); }