Beispiel #1
0
        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);
        }
Beispiel #2
0
        void webSocketPageCommandEvents(MEMBERType sender, object deSerDataObject)
        {
            Console.WriteLine("recive page command");
            Type pageType = null;

            switch (sender)
            {
            case MEMBERType.MEMBBASIC:
            {        // 新建会员采集基本信息
                Console.WriteLine("go to page A3");
                pageType = typeof(A3);
            }
            break;

            case MEMBERType.MEMBHEALTH:
            {        //新建会员时,采集健康信息
                pageType = typeof(A5);
            }
            break;

            case MEMBERType.MEMBDRUG:
            {        //新建会员时,采集用药信息
                pageType = typeof(A6);
            }
            break;

            case MEMBERType.MEMBDISEASE:
            {        //新建会员时,采集疾病风险信息
                pageType = typeof(A7);
            }
            break;

            case MEMBERType.MEMBQR:
            {        //供会员关注和绑定的二维码
                pageType = typeof(A4);
            }
            break;

            case MEMBERType.MEMBRISK:
            {        //会员评估结果数据
                pageType = typeof(A8);
            }
            break;

            case MEMBERType.MEMBRECOMM:
            {        //推荐用药数据
                pageType = typeof(RecomMed);
            }
            break;

            case MEMBERType.MEMBCART:
            {        //药品购物车
                pageType = typeof(ShoppingCar);
            }
            break;

            case MEMBERType.MEMBPLAN:
            {        //会员用药计划
                pageType = typeof(MedPlan);
            }
            break;

            case MEMBERType.MEMBEDIT:
            {         // 修改用户基本信息
                pageType = typeof(UserInfoEdit);
            }
            break;

            case MEMBERType.MEMBEDITDISEASE:
            {         // 修改用户基本信息
                pageType = typeof(A7);
            }
            break;

            default:
                //
                break;
            }
            App.Current.Dispatcher.Invoke((Action)(() =>
            {
                root.GoToPageWithArgs(pageType, deSerDataObject);

                mEventAggregator.GetEvent <WebSocketEvent>().Publish(deSerDataObject);
            }));
        }