public JsonResult GetAllRows() { IEnumerable <PosDeviceFlatViewModel> posDevices; posDevices = _posDeviceService.GetAllPosDevices().PosDevices.ConvertToPosDeviceFlatViewModels(); DataTableViewModel data = new DataTableViewModel(); data.draw = "1"; data.recordsTotal = posDevices.ToList().Count.ToString(); data.recordsFiltered = posDevices.ToList().Count.ToString(); data.data = posDevices.ToList <object>(); return(Json(data, JsonRequestBehavior.AllowGet)); }
public ActionResult Index() { PosTerminalTableViewModel model = new PosTerminalTableViewModel(); model.PosDevices = _posDeviceService.GetAllPosDevices().PosDevices.Select(u => new SelectListItem() { Text = u.DeviceId.ToString(), Value = u.DeviceId.ToString() }).ToList(); model.PosStatusTerminals = _posStatusTerminalService.GetAllPosStatusTerminals().PosStatusTerminals.Select(u => new SelectListItem() { Text = u.StatusName, Value = u.TerminalStatusId.ToString() }).ToList(); model.PosSims = _posSimService.GetAllPosSims().PosSims.Select(u => new SelectListItem() { Text = u.SimId.ToString(), Value = u.SimId.ToString() }).ToList(); return(View("../Datatables/PosTerminalTable", model)); }