public async Task <IActionResult> List(int page = 1, int pageSize = 10, string title = "", string timeFrom = "", string timeTo = "") { string where = string.Empty; if (!string.IsNullOrEmpty(title)) { where += $" and title like '%{title}%'"; } if (!string.IsNullOrEmpty(timeFrom)) { where += $" and SendTime>='{timeFrom} 00:00:00'"; } if (!string.IsNullOrEmpty(timeTo)) { where += $" and SendTime<='{timeTo} 23:59:59'"; } int total; DataSet ds = _appService.GetPage(page, pageSize, "id desc", out total, where); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total); ViewBag.PageSize = pageSize; if (Request.Headers.ContainsKey("x-requested-with")) { return(View("_Table", pageList)); } var storeDropDown = (await _storeAppService.GetDropDown()); ViewData.Add("ChainStore", new SelectList(storeDropDown, "Id", "Name")); return(View(pageList)); }
public async Task <IActionResult> CouponList(int page = 1, int pageSize = 10, string memberId = "") { string where = $" and Memberid={memberId}"; int total; DataSet ds = _useService.GetPage(page, pageSize, "id desc", out total, where); IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total); return(View("_TableCoupon", pageList)); }