Esempio n. 1
0
 public IActionResult CreateCTPM(PhieuMuonIndexVm vm)
 {
     if (ModelState.IsValid)
     {
         phieuMuonService.AddCTPM(vm.ctpm);
         return(RedirectToAction("Index"));
     }
     return(View());
 }
Esempio n. 2
0
 public IActionResult Delete(PhieuMuonIndexVm vm)
 {
     if (ModelState.IsValid)
     {
         phieuMuonService.DeletePhieuMuon(vm.phieumuon.MaPM);
         return(RedirectToAction("Index"));
     }
     return(View());
 }
Esempio n. 3
0
        public IActionResult DeleteCTPM(PhieuMuonIndexVm vm)
        {
            var a = 123;

            if (ModelState.IsValid)
            {
                phieuMuonService.DeleteCTPM(vm.phieumuon.ChiTietPhieuMuons);
                return(RedirectToAction("Index"));
            }
            return(View());
        }
Esempio n. 4
0
        public IActionResult Index(string sortOrder, string searchString, int pageIndex = 1)
        {
            int pageSize = 8;
            int count;
            var dsphieumuon = phieuMuonService.GetPhieuMuons(sortOrder, searchString, pageIndex, pageSize, out count);
            var phieumuon   = new PhieuMuonDTO();
            var ctpm        = new ChiTietPhieuMuonDTO();
            var listSach    = sachService.GetSachs(sortOrder, searchString, pageIndex, pageSize, out count);
            var phieumuonVM = new PhieuMuonIndexVm()
            {
                PhieuMuons   = new PaginatedList <PhieuMuonDTO>(dsphieumuon, count, pageIndex, pageSize),
                SearchString = searchString,
                SortOrder    = sortOrder,
                phieumuon    = phieumuon,
                ctpm         = ctpm
            };

            return(View(phieumuonVM));
        }