Example #1
0
        public ViewResult CreateCatagoryCourse()
        {
            eCenterDbContext      _context           = new eCenterDbContext();
            List <DanhMucKhoaHoc> listDanhMucKhoaHoc = _context.DanhMucKhoaHocs.ToList();

            return(View(listDanhMucKhoaHoc));
        }
Example #2
0
        public ActionResult TestPartialView()
        {
            eCenterDbContext db = new eCenterDbContext();


            return(PartialView());
        }
Example #3
0
        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));
        }
Example #4
0
        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));
        }
Example #5
0
        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));
        }
Example #6
0
        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));
        }
Example #7
0
        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());
        }
Example #8
0
        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));
        }
Example #9
0
        // 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));
        }
Example #10
0
 public TrinhDoDao()
 {
     _context = new eCenterDbContext();
 }
Example #11
0
 // Constructor
 public KhoaHocDao()
 {
     _context = new eCenterDbContext();
 }
Example #12
0
 public PhuHuynhDao()
 {
     _context = new eCenterDbContext();
 }
Example #13
0
 public DangNhapDao()
 {
     _context = new eCenterDbContext();
 }
Example #14
0
 // Constructor
 public ThoiKhoaBieuDao()
 {
     _context = new eCenterDbContext();
 }
Example #15
0
 public HoaDonDao()
 {
     _context = new eCenterDbContext();
 }
Example #16
0
 public HocVienDao()
 {
     context = new eCenterDbContext();
 }
Example #17
0
 public LopHocDao()
 {
     _context = new eCenterDbContext();
 }
Example #18
0
 public GiaoVienDao()
 {
     _context = new eCenterDbContext();
 }
Example #19
0
 public TaiKhoanDao()
 {
     context = new eCenterDbContext();
 }
Example #20
0
 public BangDiemDao()
 {
     _context = new eCenterDbContext();
 }