示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var DeUid   = Request["DeUid"];
            var EnUid   = Request["EnUid"];
            var message = "404,參數空值";

            if (string.IsNullOrEmpty(EnUid))
            {
            }
            else
            {
                var longUid = ToolLibs.EncryptDES(EnUid, Config.DESKey, Config.DESIV);
                message = $"加密後:{longUid.ToString()}";
            }

            if (string.IsNullOrEmpty(DeUid))
            {
            }
            else
            {
                var longUid = Convert.ToInt64(ToolLibs.DecryptDES(DeUid, Config.DESKey, Config.DESIV));
                message = $"解密後:{longUid.ToString()}";
            }

            Response.Write(message);
        }
示例#2
0
        public void PrepareData(string uid)
        {
            //將Request回來的UID解密
            var longUid = Convert.ToInt64(ToolLibs.DecryptDES(uid, Config.DESKey, Config.DESIV));

            log.Info($"取得檢測資料\tUid:{longUid}");

            //取得檢測資料
            var measureInfo = DBService.MeasureInfo.GetMeasureInfoByUID(longUid);

            log.Trace($"Data\t{measureInfo.MIData}");

            log.Info($"取得會員資料\t身分證:{measureInfo.MemberIDNo}");
            //取得會員資料
            var memberInfo = DBService.MemberInfo.GetMemberInfoByIDNo(measureInfo.MemberIDNo);

            //所記錄的測量資料
            var mIData = JsonConvert.DeserializeObject <Models.Utility.MIData>(measureInfo.MIData);

            //舒張壓
            var tmpBP_Systolic = DBService.ResultRemark.GetRemarkByType(Enums.ResultRemarkType.LBP, ToolLibs.ConvertStrToDouble(mIData.BP_Systolic));

            log.Info($"舒張壓 Remark\t{tmpBP_Systolic.Message}\t{tmpBP_Systolic.Level}");

            //收縮壓
            var tmpHP_Diastolic = DBService.ResultRemark.GetRemarkByType(Enums.ResultRemarkType.HBP, ToolLibs.ConvertStrToDouble(mIData.BP_Diastolic));


            log.Info($"收縮壓 Remark\t{tmpHP_Diastolic.Message}\t{tmpHP_Diastolic.Level}");

            //脈博
            var tmpHeatRate = DBService.ResultRemark.GetRemarkByType(Enums.ResultRemarkType.HR, ToolLibs.ConvertStrToDouble(mIData.HeatRate));

            var HPRemark = string.IsNullOrEmpty(tmpHeatRate.Level) ? $"{tmpHeatRate.Message}" : $"{tmpHeatRate.Level},{tmpHeatRate.Message}";

            log.Info($"脈博 Remark\t{tmpHeatRate.Message}\t{tmpHeatRate.Level}");

            //BMI
            var tmpBMI = DBService.ResultRemark.GetRemarkByType(Enums.ResultRemarkType.BMI, ToolLibs.ConvertStrToDouble(mIData.BMI));

            var BMIRemark = tmpBMI.Message == "正常" ? $"{tmpBMI.Message}" : $"{tmpBMI.Message}需多注意飲食管理";

            log.Info($"BMI Remark\t{tmpBMI.Message}\t{tmpBMI.Level}");

            htmlBMI = mIData.BMI;

            htmlHeight = mIData.Height;

            htmlWeight = mIData.Weight;

            htmlLowBP = mIData.BP_Systolic;

            htmlHighBP = mIData.BP_Diastolic;

            htmlHeartBeat = mIData.HeatRate;

            htmlBodyTemperture = mIData.BodyTemperture;

            htmlBMIRemark = BMIRemark;

            htmlHPRemark = HPRemark;

            htmlAlertStatus = "N";

            log.Info($"網頁帶入的資料BMI:{htmlBMI}\t" +
                     $"身高:{htmlHeight}\t" +
                     $"體重:{htmlWeight}\t" +
                     $"舒張壓:{htmlLowBP}\t" +
                     $"收縮壓:{htmlHighBP}\t" +
                     $"脈搏:{htmlHeartBeat}\t" +
                     $"體溫:{htmlBodyTemperture}\t" +
                     $"BMI註記:{htmlBMIRemark}\t" +
                     $"血壓註記:{htmlHPRemark}");
        }