// GET: PhieuNhap public ActionResult All(int page = 1, int pageSize = 10, string search = null) { List <PhieuNhap> DMPhieu = null; ViewBag.cultureInfo = CultureInfo; if (!String.IsNullOrEmpty(search)) { DMPhieu = PhieuNhapManager.filter(search); ViewBag.SearchKey = search; } else { DMPhieu = PhieuNhapManager.getAll(); } ViewBag.tongTien = DMPhieu.Sum(ph => ph.TongTien); //ViewBag.tongSoLuong = DMPhieu.Sum(ph => ph.ChiTiet.Sum(ct => ct.SoLuong)); var models = DMPhieu.ToPagedList(page, pageSize); setAlertMessage(); return(View(models)); }
private void LoadDSPM() { __DSPN = PhieuNhapManager.getAll(); gdvPhieuNhap.DataSource = __DSPN; }