Exemplo n.º 1
0
        public static stru_result GetDevData(string IDCardNo, string DeviceType, string DeviceName)
        {
            stru_result _result  = new stru_result();
            string      strWhere = "";

            strWhere = string.Format(" IDCardNo = '{0}' and DeviceType = '{1}' ", IDCardNo, DeviceType);
            if (!string.IsNullOrEmpty(DeviceName))
            {
                strWhere = strWhere + string.Format("and DeviceName = '{0}' ", DeviceName);
            }
            strWhere = strWhere + " order by id desc ";
            List <DeviceInfoModel> modelList = new DeviceInfoBLL().GetModelList(strWhere);

            if ((modelList != null) && (modelList.Count > 0))
            {
                _result.type     = DeviceType;
                _result.HasValue = true;
                _result.datetime = modelList[0].UpdateData;
                _result.value1   = modelList[0].Value1;
                if (DeviceType == "20")
                {
                    _result.value2 = modelList[0].Value2;
                    _result.value3 = modelList[0].Value3;
                }
                if (DeviceType == "33")
                {
                    _result.value2  = modelList[0].Value2;
                    _result.value3  = modelList[0].Value3;
                    _result.value4  = modelList[0].Value4;
                    _result.value5  = modelList[0].Value5;
                    _result.value6  = modelList[0].Value6;
                    _result.value7  = modelList[0].Value7;
                    _result.value8  = modelList[0].Value8;
                    _result.value9  = modelList[0].Value9;
                    _result.value10 = modelList[0].Value10;
                    _result.value11 = modelList[0].Value11;
                }
                if (DeviceType == "32")
                {
                    _result.value2 = modelList[0].Value2;
                }
                if (DeviceType == "35")
                {
                }
                return(_result);
            }
            _result.HasValue = false;
            return(_result);
        }
Exemplo n.º 2
0
        public static stru_result GetDevData(string IDCardNo, string DeviceType)
        {
            stru_result            _result   = new stru_result();
            List <DeviceInfoModel> modelList = new DeviceInfoBLL().GetModelList((!(DeviceType == "24") ?
                                                                                 string.Format(" IDCardNo = '{0}' and DeviceType = '{1}' ", IDCardNo, DeviceType) :
                                                                                 string.Format(" IDCardNo = '{0}' and (DeviceType = 24 or (DeviceType = 35 and DeviceName = '血糖' )) ", IDCardNo, DeviceType)) +
                                                                                " order by id desc ");

            if ((modelList != null) && (modelList.Count > 0))
            {
                _result.type     = DeviceType;
                _result.HasValue = true;
                _result.datetime = modelList[0].UpdateData;
                _result.value1   = modelList[0].Value1;
                if (DeviceType == "20")
                {
                    _result.value2 = modelList[0].Value2;
                    _result.value3 = modelList[0].Value3;
                }
                if (DeviceType == "39")
                {
                    _result.value2 = modelList[0].Value2;
                    _result.value3 = modelList[0].Value3;
                }
                if (DeviceType == "33")
                {
                    _result.value2  = modelList[0].Value2;
                    _result.value3  = modelList[0].Value3;
                    _result.value4  = modelList[0].Value4;
                    _result.value5  = modelList[0].Value5;
                    _result.value6  = modelList[0].Value6;
                    _result.value7  = modelList[0].Value7;
                    _result.value8  = modelList[0].Value8;
                    _result.value9  = modelList[0].Value9;
                    _result.value10 = modelList[0].Value10;
                    _result.value11 = modelList[0].Value11;
                }
                if (DeviceType == "32")
                {
                    _result.value2 = modelList[0].Value2;
                }
                return(_result);
            }
            _result.HasValue = false;
            return(_result);
        }
Exemplo n.º 3
0
        public static stru_result GetDevData(string IDCardNo, string DeviceType, string DeviceName)
        {
            stru_result _result = new stru_result();
            string      str     = string.Format(" IDCardNo = '{0}' and DeviceType = '{1}' ", IDCardNo, DeviceType);

            if (DeviceType == "20")
            {
                if (DeviceName == "心率")
                {
                    str = str + string.Format(" and Value3 != '' ", new object[0]);
                }
                if (DeviceName == "血压")
                {
                    str = str + string.Format(" and Value1 != '' ", new object[0]);
                }
            }
            List <DeviceInfoModel> modelList = new DeviceInfoBLL().GetModelList(str + " order by id desc ");

            if ((modelList != null) && (modelList.Count > 0))
            {
                _result.type     = DeviceType;
                _result.HasValue = true;
                _result.datetime = modelList[0].UpdateData;
                _result.value1   = modelList[0].Value1;
                if (DeviceType == "20")
                {
                    if (DeviceName == "血压")
                    {
                        DeviceInfoModel deviceinfo = modelList.First <DeviceInfoModel>(mc => !string.IsNullOrEmpty(mc.Value1 + mc.Value2));
                        if (deviceinfo != null)
                        {
                            _result.value1 = deviceinfo.Value1;
                            _result.value2 = deviceinfo.Value2;
                            _result.value3 = deviceinfo.Value3;
                        }
                    }
                    else if (DeviceName == "心率")
                    {
                        DeviceInfoModel deviceinfo2 = modelList.First <DeviceInfoModel>(mc => !string.IsNullOrEmpty(mc.Value3));
                        if (deviceinfo2 != null)
                        {
                            _result.value3 = deviceinfo2.Value3;
                        }
                    }
                    else
                    {
                        _result.value2 = modelList[0].Value2;
                        _result.value3 = modelList[0].Value3;
                    }
                }
                if (DeviceType == "33")
                {
                    _result.value2  = modelList[0].Value2;
                    _result.value3  = modelList[0].Value3;
                    _result.value4  = modelList[0].Value4;
                    _result.value5  = modelList[0].Value5;
                    _result.value6  = modelList[0].Value6;
                    _result.value7  = modelList[0].Value7;
                    _result.value8  = modelList[0].Value8;
                    _result.value9  = modelList[0].Value9;
                    _result.value10 = modelList[0].Value10;
                    _result.value11 = modelList[0].Value11;
                }
                if (DeviceType == "32")
                {
                    _result.value2 = modelList[0].Value2;
                }
                if (!(DeviceType == "35"))
                {
                }
                return(_result);
            }
            _result.HasValue = false;
            return(_result);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 抓取蓝牙上传资料
        /// </summary>
        /// <param name="msg"></param>
        public override void UpdateDeviceinfoContent(int msg)
        {
            switch (msg)
            {
            case 0x597:
                stru_result _result = ClsGetDevInfo.GetDevData(this.Model.IDCardNo, "20", "血压");

                if (_result.HasValue)
                {
                    this.healthHouserModel.PulseRate = new decimal?(int.Parse(_result.value3));

                    // 根据设定值判断为左侧血压(L)还是右侧血压(R)
                    if (LRType.Equals("L"))
                    {
                        this.healthHouserModel.LeftHeight  = new decimal?(int.Parse(_result.value1));
                        this.healthHouserModel.LeftPre     = new decimal?(int.Parse(_result.value2));
                        this.healthHouserModel.RightHeight = new decimal?((int.Parse(_result.value1) + m));
                        this.healthHouserModel.RightPre    = new decimal?((int.Parse(_result.value2) + n));
                    }
                    else
                    {
                        this.healthHouserModel.RightHeight = new decimal?(int.Parse(_result.value1));
                        this.healthHouserModel.RightPre    = new decimal?(int.Parse(_result.value2));
                        this.healthHouserModel.LeftHeight  = new decimal?((int.Parse(_result.value1) - m));
                        this.healthHouserModel.LeftPre     = new decimal?((int.Parse(_result.value2) - n));
                    }

                    this.txtRightHeight.Text = this.healthHouserModel.RightHeight.ToString();
                    this.txtRightPre.Text    = this.healthHouserModel.RightPre.ToString();
                    this.txtLeftHeight.Text  = this.healthHouserModel.LeftHeight.ToString();
                    this.txtLeftPre.Text     = this.healthHouserModel.LeftPre.ToString();
                    this.txtPulseRate.Text   = _result.value3;
                }

                return;

            case 0x598:
                // 身高
                stru_result devData = ClsGetDevInfo.GetDevData(this.Model.IDCardNo, "39");

                if (devData.HasValue)
                {
                    this.txtHeight.Text = devData.value1;
                }

                return;

            case 0x599:
            case 0x59b:
                break;

            case 0x59a:
                // 血氧
                stru_result _result3 = ClsGetDevInfo.GetDevData(this.Model.IDCardNo, "32");

                if (_result3.HasValue && _result3.value2 != "0")
                {
                    this.txtBloodOxygen.Text = _result3.value1;
                    this.txtPulseRate.Text   = _result3.value2;
                }

                return;

            case 0x59c:
                // 体重
                stru_result _result4 = ClsGetDevInfo.GetDevData(this.Model.IDCardNo, "22");

                if (_result4.HasValue)
                {
                    this.txtWeight.Text = _result4.value1;
                }

                return;

            default:
                return;
            }
        }