public IActionResult JsonIndex(DeviceJsonIndexModel model) { //if (model.BeginDateTime == null) // model.BeginDateTime = DateTime.Now.ToString("yyyy-MM-dd"); //if (model.EndDateTime == null) // model.EndDateTime = DateTime.Now.ToString("yyyy-MM-dd"); var dal = new DeviceDal(); var param = new DeviceDal.QueryByParam1In() { //BeginDateTime = DateTime.Parse(model.BeginDateTime), //EndDateTime = DateTime.Parse(model.EndDateTime), Rows = model.Rows, Page = model.Page, }; var list = dal.QueryByParam1(param); var list2 = from o in list select new { DeviceId = o.DeviceId, DeviceName = o.DeviceName, }; var grid = new { total = param.Total, rows = list2, }; return(Json(grid)); }
public IActionResult Index() { var model = new DeviceJsonIndexModel() { CurrentAdmin = CurrentAdmin, //BeginDateTime = DateTime.Now.ToString("yyyy-MM-dd"), //EndDateTime = DateTime.Now.ToString("yyyy-MM-dd"), }; return(View(model)); }