public ActionResult TamTest() { var _lopHocDao = new LopHocDao(); var _modelLopHoc = _lopHocDao.GetClassByStatus(true); return(PartialView(_modelLopHoc)); }
public ActionResult Edit(LopHoc lopHoc) { try { // TODO: Add insert logic here if (ModelState.IsValid) { var _lopHocDao = new LopHocDao(); var res = _lopHocDao.Update(lopHoc); if (res) { return(RedirectToAction("Index", "LopHoc")); } else { ModelState.AddModelError("", "Cập nhật lỗi"); } } GetViewBagGiaoVien(); GetViewBagKhoaHoc(); return(View(lopHoc)); } catch { return(RedirectToAction("Index", "Home")); } }
public ActionResult Edit(int id) { var _lopHoc = new LopHocDao().ViewDetail(id); GetViewBagGiaoVien(); GetViewBagKhoaHoc(); return(View(_lopHoc)); }
public ActionResult testSearchByStatus(string searchStringStatus, int page = 1, int pageSize = 10) { ViewBag.LopHocHoatDong = db.LopHocs.Where(i => i.TinhTrang == true).Count(); ViewBag.LopHocNgungHoatDong = db.LopHocs.Where(i => i.TinhTrang == false).Count(); var _lopHocDao = new LopHocDao(); var _modelLopHoc = _lopHocDao.testSearchByStatus(searchStringStatus, page, pageSize); ViewBag.SearchStringStatus = searchStringStatus; return(View(_modelLopHoc)); }
public ActionResult Index(string searchString, int page = 1, int pageSize = 10) { ViewBag.LopHocHoatDong = db.LopHocs.Where(i => i.TinhTrang == true).Count(); ViewBag.LopHocNgungHoatDong = db.LopHocs.Where(i => i.TinhTrang == false).Count(); var _lopHocDao = new LopHocDao(); var _modelLopHoc = _lopHocDao.ListAllPaging(searchString, page, pageSize); ViewBag.SearchString = searchString; return(View(_modelLopHoc)); }
public ActionResult CreateDetails(HoaDonDetails hoaDonDetails) { var hoaDonDao = new HoaDonDao(); var ctHDDao = new CT_HoaDonDao(); var lopHocDao = new LopHocDao(); var hocVienDao = new HocVienDao(); var hocVien = new HocVien(); var ctHD = new CT_HoaDon(); var lopHoc = new LopHoc(); var hoaDon = new HoaDon(); return(RedirectToAction("Index")); }
public ActionResult Create(LopHoc lopHoc) { // TODO: Add insert logic here var _lopHocDao = new LopHocDao(); int _maLopHoc = _lopHocDao.Insert(lopHoc); if (_maLopHoc > 0) { return(RedirectToAction("Index", "LopHoc")); } else { ModelState.AddModelError("", "Thêm thất bại"); } return(View(lopHoc)); }
public void SetViewBagLopHoc(int?maLopHoc = null) { var daoLopHoc = new LopHocDao(); ViewBag.MaLopHoc = new SelectList(daoLopHoc.ListAll(), "MaLopHoc", "TenLopHoc", maLopHoc); }
public ActionResult Details(int id) { var lopHocDao = new LopHocDao().ViewDetail(id); return(View(lopHocDao)); }