Ejemplo n.º 1
0
        public ActionResult TamTest()
        {
            var _lopHocDao   = new LopHocDao();
            var _modelLopHoc = _lopHocDao.GetClassByStatus(true);

            return(PartialView(_modelLopHoc));
        }
Ejemplo n.º 2
0
        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"));
            }
        }
Ejemplo n.º 3
0
        public ActionResult Edit(int id)
        {
            var _lopHoc = new LopHocDao().ViewDetail(id);

            GetViewBagGiaoVien();
            GetViewBagKhoaHoc();

            return(View(_lopHoc));
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
        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));
        }
Ejemplo n.º 6
0
        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"));
        }
Ejemplo n.º 7
0
        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));
        }
Ejemplo n.º 8
0
        public void SetViewBagLopHoc(int?maLopHoc = null)
        {
            var daoLopHoc = new LopHocDao();

            ViewBag.MaLopHoc = new SelectList(daoLopHoc.ListAll(), "MaLopHoc", "TenLopHoc", maLopHoc);
        }
Ejemplo n.º 9
0
        public ActionResult Details(int id)
        {
            var lopHocDao = new LopHocDao().ViewDetail(id);

            return(View(lopHocDao));
        }