static object invokeDataReciveCallBack(MEMBERType pageType, String jsonContent) { object obj = null; switch (pageType) { case MEMBERType.MEMBBASIC: { // 新建会员采集基本信息 //pageType = typeof(A3); MTMCustInfo info = JsonConvert.DeserializeObject <MTMCustInfo>(jsonContent, s_settings); obj = info; } break; case MEMBERType.MEMBHEALTH: { //新建会员时,采集健康信息 //pageType = typeof(A5); MTMHealthCollectDTO info = JsonConvert.DeserializeObject <MTMHealthCollectDTO>(jsonContent, s_settings); obj = info; } break; case MEMBERType.MEMBDRUG: { //新建会员时,采集用药信息 MTMMedCollectDTO info = JsonConvert.DeserializeObject <MTMMedCollectDTO>(jsonContent, s_settings); obj = info; } break; case MEMBERType.MEMBDISEASE: { //新建会员时,采集疾病风险信息 //pageType = typeof(A7); MTMDisDTO info = JsonConvert.DeserializeObject <MTMDisDTO>(jsonContent, s_settings); obj = info; } break; case MEMBERType.MEMBQR: { //供会员关注和绑定的二维码 //pageType = typeof(A4); MTMQRDTO info = JsonConvert.DeserializeObject <MTMQRDTO>(jsonContent, s_settings); obj = info; } break; case MEMBERType.MEMBRISK: { //会员评估结果数据 //pageType = typeof(A8); MTMIssueCollectDTO info = JsonConvert.DeserializeObject <MTMIssueCollectDTO>(jsonContent, s_settings); if (null != info.measuredata) { obj = info; } else if (0 == info.risklevel) { obj = null; } } break; case MEMBERType.MEMBRECOMM: { //推荐用药数据 //pageType = typeof(RecomMed); MTMRecMedDTO info = JsonConvert.DeserializeObject <MTMRecMedDTO>(jsonContent, s_settings); obj = info; } break; case MEMBERType.MEMBCART: { //药品购物车 //pageType = typeof(ShoppingCar); MTMShopCarDTO info = JsonConvert.DeserializeObject <MTMShopCarDTO>(jsonContent, s_settings); obj = info; } break; case MEMBERType.MEMBPLAN: { //会员用药计划 //pageType = typeof(A3); MTMMedPlanDTO info = JsonConvert.DeserializeObject <MTMMedPlanDTO>(jsonContent, s_settings); obj = info; } break; case MEMBERType.MEMBEDIT: { //会员用药计划 MTMCustInfo info = JsonConvert.DeserializeObject <MTMCustInfo>(jsonContent, s_settings); obj = info; } break; case MEMBERType.MEMBEDITDISEASE: { //老会员 疾病信息随访 MTMDisDTO info = JsonConvert.DeserializeObject <MTMDisDTO>(jsonContent, s_settings); obj = info; } break; default: // break; } return(obj); }
private void OnWebSocketEvent(object data) { try { dto = (WebService.MTMRecMedDTO)data; Console.WriteLine("data ======== OK "); if (true) { if (null != dto.healthproduct) { baojianpinItemControl.ItemsSource = dto.healthproduct; } if (null != dto.chineseherb) { zhongyaoItemControl.ItemsSource = dto.chineseherb; } if (null != dto.westdrugs) { List <string> westDrug = new List <string>(); if (dto.westdrugs.firstdrugs.Count() > 0) { foreach (WebService.Firstdrug item in dto.westdrugs.firstdrugs) { if (!String.IsNullOrEmpty(item.name)) { westDrug.Add(item.name); } else if (!String.IsNullOrEmpty(item.common_name)) { westDrug.Add(item.common_name); } } } if (dto.westdrugs.seconddrugs.Count() > 0) { foreach (WebService.Seconddrug item in dto.westdrugs.seconddrugs) { if (!String.IsNullOrEmpty(item.name)) { westDrug.Add(item.name); } else if (!String.IsNullOrEmpty(item.common_name)) { westDrug.Add(item.common_name); } } } if (westDrug.Count() > 0) { xiyaoItemControl.ItemsSource = westDrug; } } } } catch (Exception) { throw; } }