private void txbLoc_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         gdvDMNXB.DataSource = NhaXuatBanManager.filter(txbLoc.Text, _DMNXB);
     }
 }
 private void btnLoc_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(txbLoc.Text))
     {
         gdvDMNXB.DataSource = NhaXuatBanManager.filter(txbLoc.Text, _DMNXB);
     }
 }
 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: NhaXuatBan
        public ActionResult Index(int page = 1, int pageSize = 10, string search = null)
        {
            List <NhaXuatBan> DMNXB = null;

            if (!String.IsNullOrEmpty(search))
            {
                DMNXB             = NhaXuatBanManager.filter(search);
                ViewBag.searchKey = search;
            }
            else
            {
                DMNXB = NhaXuatBanManager.getAllAlive();
            }
            var models = DMNXB.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 <NhaXuatBan> DMNXB = NhaXuatBanManager.getAllAlive()
                                   .Where(nxb => nxb.tinhTongSoLuongNoTheoThang(
                                              ((DateTime)startDate).Month,
                                              ((DateTime)startDate).Year,
                                              ((DateTime)endDate).Month,
                                              ((DateTime)endDate).Year) > 0 &&
                                          nxb.tongTienNoThang(
                                              ((DateTime)startDate).Month,
                                              ((DateTime)startDate).Year,
                                              ((DateTime)endDate).Month,
                                              ((DateTime)endDate).Year) > 0 &&
                                          nxb.tongTienNhapThang(
                                              ((DateTime)startDate).Month,
                                              ((DateTime)startDate).Year,
                                              ((DateTime)endDate).Month,
                                              ((DateTime)endDate).Year) > 0).ToList();
         if (!String.IsNullOrEmpty(search))
         {
             DMNXB             = NhaXuatBanManager.filter(search, DMNXB);
             ViewBag.SearchKey = search;
         }
         ViewBag.tongTienNhap  = DMNXB.Sum(nxb => nxb.TongTienNhapTheoThang);
         ViewBag.tongSoLuongNo = DMNXB.Sum(nxb => nxb.TongSoLuongNoTheoThang);
         ViewBag.tongTienNo    = DMNXB.Sum(s => s.TongTienNoThang);
         var models = DMNXB.ToPagedList(page, pageSize);
         setAlertMessage();
         return(View(models));
     }
     setAlertMessage();
     return(View());
 }