我目前正在尝试将 JSON 字符串化对象存储到一个数组中,这样我就可以在进行过程中添加新元素:
function GetAllPatients(){
var patient = null;
var patients = [];
patient = { "FirstName": "Stephanie", "Gender": "Female", "Id": "P8401", "LastName": "BARRON", "Title": "Ms", "ConsultantId": "d10", "CurrentWardAdmissionName": "Non Admitted", "DOB": "/Date(1187650800000+0100)/", "HospitalAdmissionDate": "/Date(1294848066000+0000)/", "NHSNumber": "4646399561" };
patient = { "FirstName": "Joan", "Gender": "Female", "Id": "50434619", "LastName": "SMITH", "Title": "Mrs", "ConsultantId": "d1", "CurrentWardAdmissionName": "Non Admitted", "DOB": "/Date(513039600000+0100)/", "HospitalAdmissionDate": "/Date(1332242252817+0000)/", "NHSNumber": "9999999999" };
}
还有一个 switch case getPatientFromStore(pid) 函数,它将通过 pid 检索记录
我将如何实现这一目标?我需要更多信息来帮助我更接近解决方案吗?
基本上,我正在创建一个 Web 应用程序,它允许在断开连接状态下进行离线本地存储,并与服务器上的数据库同步。