public ViewResult CreateCatagoryCourse() { eCenterDbContext _context = new eCenterDbContext(); List <DanhMucKhoaHoc> listDanhMucKhoaHoc = _context.DanhMucKhoaHocs.ToList(); return(View(listDanhMucKhoaHoc)); }
public ActionResult TestPartialView() { eCenterDbContext db = new eCenterDbContext(); return(PartialView()); }
public JsonResult GetDataHocVien() { eCenterDbContext db = new eCenterDbContext(); var query = db.HocViens.Include("HocVien") .GroupBy(p => p.NgayDangKy.Value.Month) .Select(g => new { name = g.Key, count = g.Count() }); return(Json(query, JsonRequestBehavior.AllowGet)); }
public JsonResult GetData() { eCenterDbContext db = new eCenterDbContext(); var query = db.HoaDons.Include("HoaDon") .GroupBy(p => p.NgayLap.Value.Month) .Select(g => new { name = g.Key, count = g.Sum(x => x.TongTien) }); return(Json(query, JsonRequestBehavior.AllowGet)); }
public ActionResult GetDataPieChart() { eCenterDbContext db = new eCenterDbContext(); int male = db.GiaoViens.Where(x => x.GioiTinh == "Nam").Count(); int female = db.GiaoViens.Where(x => x.GioiTinh == "Nữ").Count(); Ratio obj = new Ratio(); obj.Male = male; obj.Female = female; return(Json(obj, JsonRequestBehavior.AllowGet)); }
public ActionResult testSearchByStatus(string searchStringStatus, int page = 1, int pageSize = 10) { eCenterDbContext _context = new eCenterDbContext(); ViewBag.TongKhoaHoc = _context.KhoaHocs.Count(); // Khóa học còn chỗ ViewBag.KhoaHocConCho = _context.KhoaHocs.Where(x => x.SoLuong > 0).Count(); // Khóa học hết chỗ ViewBag.KhoaHocHetCho = _context.KhoaHocs.Where(x => x.SoLuong == 0).Count(); var _khoaHocDao = new KhoaHocDao(); var _modelKhoaHoc = _khoaHocDao.ListAllPagingByStatus(searchStringStatus, page, pageSize); ViewBag.SearchStringByStatus = searchStringStatus; return(View(_modelKhoaHoc)); }
public ActionResult Index() { eCenterDbContext db = new eCenterDbContext(); //ViewBag.ThongKeHocVien = db.HocViens. ViewBag.GiaoVien = db.GiaoViens.Count(); // return tổng số giáo viên ViewBag.HocVien = db.HocViens.Count(); // return tổng số học viên ViewBag.KhoaHoc = db.KhoaHocs.Count(); // return tổng số khóa hoc ViewBag.TongTien = db.HoaDons.Sum(x => x.TongTien).Value.ToString("#,##").Replace(',', '.'); ViewBag.HocVienDangKyMoi = db.HocViens.Where(x => x.NgayDangKy == DateTime.Today).Count(); ViewBag.HocVienDangKyMoiTheoThang = db.HocViens.Where(x => x.NgayDangKy.Value.Month == DateTime.Today.Month).Count(); ViewBag.TongTienLuong = db.GiaoViens.Sum(x => x.MucLuong).Value.ToString("#,##").Replace(',', '.'); ViewBag.TongLopHoc = db.LopHocs.Where(x => x.TinhTrang == true).Count(); //ViewBag.KhoaHocNoiBat = db.KhoaHocs.Where(x=>) return(View()); }
public ActionResult TaoMoiVaSuaDanhMuc(DanhMucKhoaHoc danhMuc) { eCenterDbContext _context = new eCenterDbContext(); var danhMucDao = new DanhMucKhoaHocDao(); int _maDanhMuc = danhMucDao.Insert(danhMuc); //var modal = danhMucDao.GetById(_maDanhMuc); if (_maDanhMuc > 0) { return(RedirectToAction("Index", "KhoaHoc")); } else { ModelState.AddModelError("", "Thêm thất bại"); } return(View(danhMuc)); }
// GET: KhoaHoc public ActionResult Index(string searchString, int page = 1, int pageSize = 10) { eCenterDbContext _context = new eCenterDbContext(); ViewBag.TongKhoaHoc = _context.KhoaHocs.Count(); // Khóa học còn chỗ ViewBag.KhoaHocConCho = _context.KhoaHocs.Where(x => x.SoLuong > 0).Count(); // Khóa học hết chỗ ViewBag.KhoaHocHetCho = _context.KhoaHocs.Where(x => x.SoLuong == 0).Count(); var _khoaHocDao = new KhoaHocDao(); var _modelKhoaHoc = _khoaHocDao.ListAllPaging(searchString, page, pageSize); ViewBag.SoLuongCon = _khoaHocDao.CountQuantityRemaining(); ViewBag.SearchString = searchString; return(View(_modelKhoaHoc)); }
public TrinhDoDao() { _context = new eCenterDbContext(); }
// Constructor public KhoaHocDao() { _context = new eCenterDbContext(); }
public PhuHuynhDao() { _context = new eCenterDbContext(); }
public DangNhapDao() { _context = new eCenterDbContext(); }
// Constructor public ThoiKhoaBieuDao() { _context = new eCenterDbContext(); }
public HoaDonDao() { _context = new eCenterDbContext(); }
public HocVienDao() { context = new eCenterDbContext(); }
public LopHocDao() { _context = new eCenterDbContext(); }
public GiaoVienDao() { _context = new eCenterDbContext(); }
public TaiKhoanDao() { context = new eCenterDbContext(); }
public BangDiemDao() { _context = new eCenterDbContext(); }