public async Task<GetTaskItem> GetTaskListDetailItemForBinding(string user,string sTransid) { string sJson = await GetTaskDetail(user,sTransid); GetTaskItem tli = new GetTaskItem(); JArray obj = Newtonsoft.Json.Linq.JArray.Parse(sJson); foreach (JObject jo in obj) { JToken table = jo.SelectToken("gettaskinfo", false); if (!table.ToString().Equals(objUnityData.EMPTY_JSON_TABLE)) { foreach (JToken joRow in table) { // GetTaskItem gtli = new GetTaskItem(); tli.firstname = joRow["firstname"].ToString(); tli.lastname = joRow["lastname"].ToString(); tli.workobject = joRow["workobject"].ToString(); tli.Infotype = joRow["Infotype"].ToString(); //only set this if there is a name. tli.Buttons = joRow["Buttons"].ToString(); tli.HomePhone = joRow["HomePhone"].ToString(); tli.age = joRow["age"].ToString(); tli.TaskInfo = joRow["TaskInfo"].ToString(); } } } return tli; }
public async Task<List<GetTaskItem>> GetTaskListItemsForBinding(string user) { string sJson = await GetTaskList(user); List<GetTaskItem> tli = new List<GetTaskItem>(); JArray obj = Newtonsoft.Json.Linq.JArray.Parse(sJson); foreach (JObject jo in obj) { JToken table = jo.SelectToken("gettasklistinfo", false); if (!table.ToString().Equals(objUnityData.EMPTY_JSON_TABLE)) { foreach (JToken joRow in table) { GetTaskItem gtli = new GetTaskItem(); gtli.TaskType = joRow["TaskType"].ToString(); gtli.patientid = joRow["patientid"].ToString(); gtli.TaskOrder = joRow["TaskOrder"].ToString(); gtli.transid = joRow["transid"].ToString(); //only set this if there is a name. if (gtli.patientid != "0") gtli.PatName = joRow["PatName"].ToString(); else gtli.PatName = "Non-patient task"; gtli.TaskPriority = joRow["TaskPriority"].ToString(); gtli.Description = joRow["Description"].ToString(); gtli.CreateDate = joRow["CreateDate"].ToString(); tli.Add(gtli); } } } return tli; }