コード例 #1
0
ファイル: WebSocketSingleton.cs プロジェクト: radtek/YiYao
        public MTMIssueCollectDTO callForA8()
        {
            MTMIssueCollectDTO info = null;

            try
            {
                string str = System.Environment.CurrentDirectory + "\\Json.txt";
                // Open the text file using a stream reader.
                using (StreamReader sr = new StreamReader(str))
                {
                    // Read the stream to a string, and write the string to the console.
                    String line = sr.ReadToEnd();

                    info = JsonConvert.DeserializeObject <MTMIssueCollectDTO>(line, s_settings);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("The file could not be read:");
                Console.WriteLine(e.Message);
            }
            return(info);
        }
コード例 #2
0
ファイル: WebSocketSingleton.cs プロジェクト: radtek/YiYao
        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);
        }