public RequestsController(IDiaryRepository diaryRepository, IBPRepository bPRepository, IToRepository toRepository) { _diaryRepository = diaryRepository; _bPRepository = bPRepository; _toRepository = toRepository; }
/// <summary> /// view list KhachHang with filter /// </summary> public ActionResult Index(KhachHangFilterModel filter, Pager pager, ViewMode viewMode = ViewMode.Default) { title = "Quản lý Khách hàng"; // default values if (filter.Mode == KhachHangFilterModel.FilterByManagementInfo) // not in filter { // set selected to, quan huyen = nhanVien's to, quan huyen if (nhanVien != null && filter.QuanHuyenID == null) { filter.NhanVienID = nhanVien.NhanvienID; filter.ToID = nhanVien.ToQuanHuyenID; IToRepository toRepository = uow.Repository <ToRepository>(); var to = toRepository.GetByID(nhanVien.ToQuanHuyenID ?? 0); if (to != null) { filter.QuanHuyenID = to.QuanHuyenID; } } } var items = khachHangRepository.GetAllKhachHangModel(); items = filter.ApplyFilter(items); if (viewMode == ViewMode.Excel) { return(ExcelResult("IndexExport", items.ToList())); } items = pager.ApplyPager(items); #region view data ViewBag.NhanVien = nhanVien; ViewBag.Filter = filter; ViewBag.Pager = pager; #endregion return(View(items.ToList())); }
public HoaDonController() { hoaDonRepository = uow.Repository <HoaDonRepository>(); toRepository = uow.Repository <ToRepository>(); }
public BaoCaoController() { toRepository = uow.Repository <ToRepository>(); }