public ActionResult JsonReceipts(string hospitalId) { if (string.IsNullOrWhiteSpace(hospitalId)) { return(JsonNet(new ResponseResult(false, null))); } var list = new ReceiptInfoService().GetByHospital(hospitalId).ToList(); List <object> receiptsList = new List <object>(); list.ForEach(m => { receiptsList.Add(new { Id = m.Id, HospitalId = m.HospitalId, Title = m.Title, Tax = m.Tax, display = true, edit = false }); }); return(JsonNet(new ResponseResult(true, new { Receipts = receiptsList, hospitalId }))); }