Example #1
0
        //Author: Koh Meng Guan
        // GET: /StockAdjustment/History
        public ActionResult History(string searchString, string currentFilter, int?page)
        {
            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }

            ViewBag.CurrentFilter = searchString;

            var adjustments = !string.IsNullOrEmpty(searchString)
                ? _stockAdjustmentRepo.FindAdjVoucherByText(searchString).Reverse().ToList()
                : _stockAdjustmentRepo.GetAll().Reverse().ToList();

            var reqAll = adjustments.ToPagedList(pageNumber: page ?? 1, pageSize: 15);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("_History", reqAll));
            }

            return(View(reqAll));
        }