public async Task <ActionResult> List() { string staff_id = CommonHelper.GetValue(Request["staff_id"]); int month = CommonHelper.GetValue <int>(Request["month"], 0); int year = CommonHelper.GetValue <int>(Request["year"], 0); int pgnum = CommonHelper.GetValue <int>(Request["pgnum"], 1); int pgsize = CommonHelper.GetValue <int>(Request["pgsize"], 0); string sortcolumn = CommonHelper.GetValue(Request["sortcolumn"], PayrateHelper.DEFAULT_SORT_COLUMN); string sortdir = CommonHelper.GetValue(Request["sortdir"], PayrateHelper.DEFAULT_SORT_DIR); Sort sort = new Sort(sortcolumn, sortdir); Dictionary <string, object> filters = new Dictionary <string, object> { { "staff_id", staff_id }, { "month", month }, { "year", year } }; ListModel <Payrate> l = null; if (string.IsNullOrEmpty(staff_id) && month == 0 && year == 0) { l = await PayrateHelper.GetAll(pgnum, pgsize, sort); } else { l = await PayrateHelper.GetFilterBy(filters, pgnum, pgsize, sort); } return(View("_list", l)); }
// // GET: /Admin/PayRate/ public async Task <ActionResult> Index() { ListModel <Payrate> l = null; l = await PayrateHelper.GetAll(); return(View(l)); }