public ActionResult Index2(int?page, int?PageSize, string idBill, string customerName, string phone, string address, string discountCode, string discountFrom, string discountTo, string subtotalFrom, string subtotalTo, string totalFrom, string totalTo, string status) { ViewBag.IdBill = idBill; ViewBag.CustomerName = customerName; ViewBag.CustomerPhone = phone; ViewBag.CustomerAddress = address; ViewBag.DiscountCode = discountCode; ViewBag.DiscountFrom = discountFrom; ViewBag.DiscountTo = discountTo; ViewBag.SubtotalFrom = subtotalFrom; ViewBag.SubtotalTo = subtotalTo; ViewBag.TotalFrom = totalFrom; ViewBag.TotalTo = totalTo; ViewBag.IdBillStatus = status; if (status != "" && status != null) { ViewBag.Status = BSdao.getByID(Convert.ToInt32(status)).status; } ViewBag.PageSize = new List <SelectListItem>() { new SelectListItem() { Value = "10", Text = "10" }, new SelectListItem() { Value = "15", Text = "15" }, new SelectListItem() { Value = "20", Text = "20" }, new SelectListItem() { Value = "25", Text = "25" }, new SelectListItem() { Value = "50", Text = "50" } }; int pageNumber = (page ?? 1); int pagesize = (PageSize ?? 10); ViewBag.psize = pagesize; ViewBag.Count = Bdao.ListAdvanced(idBill, customerName, phone, address, discountCode, discountFrom, discountTo, subtotalFrom, subtotalTo, totalFrom, totalTo, status).Count(); return(View(Bdao.ListAdvancedSearch(pageNumber, pagesize, idBill, customerName, phone, address, discountCode, discountFrom, discountTo, subtotalFrom, subtotalTo, totalFrom, totalTo, status))); }