private void txbLoc_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { gdvDMCongNo.DataSource = DaiLyManager.filter(txbLoc.Text, _DMDaiLy); } }
public ActionResult DoanhThu(DateTime?startDate, DateTime?endDate, int dlpage = 1, int dlpageSize = 10, int nxbpage = 1, int nxbpageSize = 10, string searchDaiLy = null, string searchNXB = null) { if (startDate != null && endDate != null) { ViewBag.cultureInfo = CultureInfo; ViewBag.startDate = startDate; ViewBag.endDate = endDate; List <DaiLy> DMDaily = DaiLyManager.getAllAlive() .Where(dl => dl.tinhTongTienThanhToanTheoThang( ((DateTime)startDate).Month, ((DateTime)startDate).Year, ((DateTime)endDate).Month, ((DateTime)endDate).Year) > 0).ToList(); ViewBag.tongTienThu = DMDaily.Sum(s => s.TongTienThanhToanTheoThang); if (!String.IsNullOrEmpty(searchDaiLy)) { DMDaily = DaiLyManager.filter(searchDaiLy, DMDaily); ViewBag.SearchKeyDaiLy = searchDaiLy; } List <NhaXuatBan> DMNXB = NhaXuatBanManager.getAllAlive() .Where(nxb => nxb.tinhTongTienThanhToanTheoThang( ((DateTime)startDate).Month, ((DateTime)startDate).Year, ((DateTime)endDate).Month, ((DateTime)endDate).Year) > 0).ToList(); ViewBag.tongTienChi = DMNXB.Sum(s => s.TongTienThanhToanTheoThang); if (!String.IsNullOrEmpty(searchNXB)) { DMNXB = NhaXuatBanManager.filter(searchNXB, DMNXB); ViewBag.SearchKeyNXB = searchNXB; } ViewBag.tongCongDaiLy = DMDaily.Sum(dl => dl.TongTienThanhToan); ViewBag.tongCongDaiLyTheoThang = DMDaily.Sum(dl => dl.TongTienThanhToanTheoThang); ViewBag.tongCongNXB = DMNXB.Sum(nxb => nxb.TongTienThanhToan); ViewBag.tongCongNXBTheoThang = DMNXB.Sum(nxb => nxb.TongTienThanhToanTheoThang); ViewBag.DaiLymodels = DMDaily.ToPagedList(dlpage, dlpageSize); ViewBag.NXBmodels = DMNXB.ToPagedList(nxbpage, nxbpageSize); setAlertMessage(); return(View()); } setAlertMessage(); return(View()); }
// GET: DaiLy public ActionResult Index(int page = 1, int pageSize = 10, string search = null) { List <DaiLy> DMDaiLy = null; if (!String.IsNullOrEmpty(search)) { DMDaiLy = DaiLyManager.filter(search); ViewBag.SearchKey = search; } else { DMDaiLy = DaiLyManager.getAllAlive(); } var models = DMDaiLy.ToPagedList(page, pageSize); setAlertMessage(); return(View(models)); }
public ActionResult TheoDoi(DateTime?startDate, DateTime?endDate, int page = 1, int pageSize = 10, string search = null) { if (startDate != null && endDate != null) { ViewBag.cultureInfo = CultureInfo; ViewBag.startDate = startDate; ViewBag.endDate = endDate; List <DaiLy> DMDaiLy = DaiLyManager.getAllAlive() .Where(dl => dl.tinhTongSoLuongNoTheoThang( ((DateTime)startDate).Month, ((DateTime)startDate).Year, ((DateTime)endDate).Month, ((DateTime)endDate).Year) > 0 && dl.tongTienNoThang( ((DateTime)startDate).Month, ((DateTime)startDate).Year, ((DateTime)endDate).Month, ((DateTime)endDate).Year) > 0 && dl.tongTienXuatThang( ((DateTime)startDate).Month, ((DateTime)startDate).Year, ((DateTime)endDate).Month, ((DateTime)endDate).Year) > 0).ToList(); if (!String.IsNullOrEmpty(search)) { DMDaiLy = DaiLyManager.filter(search, DMDaiLy); ViewBag.SearchKey = search; } ViewBag.tongTienXuat = DMDaiLy.Sum(nxb => nxb.TongTienXuatTheoThang); ViewBag.tongSoLuongNo = DMDaiLy.Sum(nxb => nxb.TongSoLuongNoTheoThang); ViewBag.tongTienNo = DMDaiLy.Sum(s => s.TongTienNoThang); var models = DMDaiLy.ToPagedList(page, pageSize); setAlertMessage(); return(View(models)); } setAlertMessage(); return(View()); }
//Khi chọn lọc private void btnLoc_Click(object sender, EventArgs e) { gdvDMCongNo.DataSource = DaiLyManager.filter(txbLoc.Text, _DMDaiLy); }