public ChartsTest() { InitializeComponent(); string path = AppDomain.CurrentDomain.BaseDirectory; Console.WriteLine(path); string rootpath = path.Substring(0, path.LastIndexOf("bin")); Console.WriteLine(rootpath); HLPWeb.Navigate(new Uri(rootpath + "Recovery/Echarts/dist/HLPLine.html")); }
/// <summary> /// 加载数据 /// </summary> private void Load_Data() { //用户信息 l1.Content = user.User_Name; l2.Content = user.Pk_User_Id; //训练日期 da.Content = trainDto.prescriptionResult.Gmt_create.ToString(); string path = AppDomain.CurrentDomain.BaseDirectory; //string rootpath = path.Substring(0, path.LastIndexOf("bin")); //查询处方和结果 #region 优化 //List<NewTrainDTO> trainDtoLists = new List<NewTrainDTO>(); //for(int i=0; i< trainDtoList.Count; i++) //{ // if(new TrainService().GetTrainDTOByPRId(Convert.ToInt32(trainDtoList[i].prescriptionResult.Pk_pr_id))[0] != null) // { // trainDtoLists.Add(new TrainService().GetTrainDTOByPRId(Convert.ToInt32(trainDtoList[i].prescriptionResult.Pk_pr_id))[0]); // } //} #endregion List <NewTrainDTO> trainDtos = new TrainService().GetTrainDTOByPRId(Convert.ToInt32(trainDto.prescriptionResult.Pk_pr_id)); DeviceSortDAO deviceSortDao = new DeviceSortDAO(); ResultLine resultLine = new ResultLine(); //循环判断填充数据 foreach (NewTrainDTO trainDto in trainDtos) { switch (trainDto.devicePrescription.Fk_ds_id) { case (int)DeviceType.P01: HLPGroupcount.Text = trainDto.devicePrescription.Dp_groupcount.ToString(); HLPGroupnum.Text = trainDto.devicePrescription.Dp_groupnum.ToString(); HLPRelaxTime.Text = trainDto.devicePrescription.Dp_relaxtime.ToString(); HLPMoveway.Text = trainDto.moveway; HLPPower.Text = trainDto.prescriptionResult.Power.ToString(); HLPTime1.Text = trainDto.prescriptionResult.Finish_time.ToString(); if (trainDto.devicePrescription.Device_mode == DevConstants.REHABILITATION_MODEL) { HLPTrainingModel.Text = LanguageUtils.ConvertLanguage("康复模式", "Rehabilitation Model"); HLPselect_change(); HLPConsequentForce.Text = trainDto.devicePrescription.Consequent_force.ToString(); HLPReverseForce.Text = trainDto.devicePrescription.Reverse_force.ToString(); } else if (trainDto.devicePrescription.Device_mode == DevConstants.ACTIVE_MODEL) { HLPTrainingModel.Text = LanguageUtils.ConvertLanguage("主被动模式", "Active Model"); HLPselect_change(); HLPSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } else { HLPTrainingModel.Text = LanguageUtils.ConvertLanguage("被动模式", "Passive Model"); HLPselect_change(); HLPSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } if (trainDto.prescriptionResult == null) { break; } HLPSportstrength.Text = StrengthConverter(trainDto.prescriptionResult.pr_userthoughts.ToString()); HLPHeartRateList.Text = trainDto.prescriptionResult.Heart_rate_list; HLPEnergy.Text = trainDto.prescriptionResult.Energy.ToString(); HLPFinishNum.Text = trainDto.prescriptionResult.Finish_num.ToString(); HLPAttentionpoint.Text = trainDto.devicePrescription.Dp_memo; // 心率折线图 HLPWeb.ObjectForScripting = new ResultLine(trainDto.prescriptionResult.Heart_rate_list, 0); HLPWeb.Navigate(new Uri(path + "dist\\HLPLine.html")); break; case (int)DeviceType.P00: ROWGroupcount.Text = trainDto.devicePrescription.Dp_groupcount.ToString(); ROWGroupnum.Text = trainDto.devicePrescription.Dp_groupnum.ToString(); ROWRelaxTime.Text = trainDto.devicePrescription.Dp_relaxtime.ToString(); ROWMoveway.Text = trainDto.moveway; ROWPower.Text = trainDto.prescriptionResult.Power.ToString(); ROWTime1.Text = trainDto.prescriptionResult.Finish_time.ToString(); if (trainDto.devicePrescription.Device_mode == DevConstants.REHABILITATION_MODEL) { ROWTrainingModel.Text = LanguageUtils.ConvertLanguage("康复模式", "Rehabilitation Model"); ROWselect_change(); ROWConsequentForce.Text = trainDto.devicePrescription.Consequent_force.ToString(); ROWReverseForce.Text = trainDto.devicePrescription.Reverse_force.ToString(); } else if (trainDto.devicePrescription.Device_mode == DevConstants.ACTIVE_MODEL) { ROWTrainingModel.Text = LanguageUtils.ConvertLanguage("主被动模式", "Active Model"); ROWselect_change(); ROWSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } else { ROWTrainingModel.Text = LanguageUtils.ConvertLanguage("被动模式", "Passive Model"); ROWselect_change(); ROWSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } if (trainDto.prescriptionResult == null) { break; } ROWSportstrength.Text = StrengthConverter(trainDto.prescriptionResult.pr_userthoughts.ToString()); ROWHeartRateList.Text = trainDto.prescriptionResult.Heart_rate_list; ROWEnergy.Text = trainDto.prescriptionResult.Energy.ToString(); ROWFinishNum.Text = trainDto.prescriptionResult.Finish_num.ToString(); ROWAttentionpoint.Text = trainDto.devicePrescription.Dp_memo; // 心率折线图 ROWWeb.ObjectForScripting = new ResultLine(trainDto.prescriptionResult.Heart_rate_list, 1); ROWWeb.Navigate(new Uri(path + "dist\\ROWLine.html")); break; case (int)DeviceType.P09: TFGroupcount.Text = trainDto.devicePrescription.Dp_groupcount.ToString(); TFGroupnum.Text = trainDto.devicePrescription.Dp_groupnum.ToString(); TFRelaxTime.Text = trainDto.devicePrescription.Dp_relaxtime.ToString(); TFMoveway.Text = trainDto.moveway; TFPower.Text = trainDto.prescriptionResult.Power.ToString(); TFTime1.Text = trainDto.prescriptionResult.Finish_time.ToString(); if (trainDto.devicePrescription.Device_mode == DevConstants.REHABILITATION_MODEL) { TFTrainingModel.Text = LanguageUtils.ConvertLanguage("康复模式", "Rehabilitation Model"); TFselect_change(); TFConsequentForce.Text = trainDto.devicePrescription.Consequent_force.ToString(); TFReverseForce.Text = trainDto.devicePrescription.Reverse_force.ToString(); } else if (trainDto.devicePrescription.Device_mode == DevConstants.ACTIVE_MODEL) { TFTrainingModel.Text = LanguageUtils.ConvertLanguage("主被动模式", "Active Model"); TFselect_change(); TFSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } else { TFTrainingModel.Text = LanguageUtils.ConvertLanguage("被动模式", "Passive Model"); TFselect_change(); TFSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } if (trainDto.prescriptionResult == null) { break; } TFSportstrength.Text = StrengthConverter(trainDto.prescriptionResult.pr_userthoughts.ToString()); TFHeartRateList.Text = trainDto.prescriptionResult.Heart_rate_list; TFEnergy.Text = trainDto.prescriptionResult.Energy.ToString(); TFFinishNum.Text = trainDto.prescriptionResult.Finish_num.ToString(); TFAttentionpoint.Text = trainDto.devicePrescription.Dp_memo; // 心率折线图 TFWeb.ObjectForScripting = new ResultLine(trainDto.prescriptionResult.Heart_rate_list, 2); TFWeb.Navigate(new Uri(path + "dist\\TFLine.html")); break; case (int)DeviceType.P06: LEGroupcount.Text = trainDto.devicePrescription.Dp_groupcount.ToString(); LEGroupnum.Text = trainDto.devicePrescription.Dp_groupnum.ToString(); LERelaxTime.Text = trainDto.devicePrescription.Dp_relaxtime.ToString(); LEMoveway.Text = trainDto.moveway; LEPower.Text = trainDto.prescriptionResult.Power.ToString(); LETime1.Text = trainDto.prescriptionResult.Finish_time.ToString(); if (trainDto.devicePrescription.Device_mode == DevConstants.REHABILITATION_MODEL) { LETrainingModel.Text = LanguageUtils.ConvertLanguage("康复模式", "Rehabilitation Model"); LEselect_change(); LEConsequentForce.Text = trainDto.devicePrescription.Consequent_force.ToString(); LEReverseForce.Text = trainDto.devicePrescription.Reverse_force.ToString(); } else if (trainDto.devicePrescription.Device_mode == DevConstants.ACTIVE_MODEL) { LETrainingModel.Text = LanguageUtils.ConvertLanguage("主被动模式", "Active Model"); LEselect_change(); LESpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } else { LETrainingModel.Text = LanguageUtils.ConvertLanguage("被动模式", "Passive Model"); LEselect_change(); LESpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } if (trainDto.prescriptionResult == null) { break; } LESportstrength.Text = StrengthConverter(trainDto.prescriptionResult.pr_userthoughts.ToString()); LEHeartRateList.Text = trainDto.prescriptionResult.Heart_rate_list; LEEnergy.Text = trainDto.prescriptionResult.Energy.ToString(); LEFinishNum.Text = trainDto.prescriptionResult.Finish_num.ToString(); LEAttentionpoint.Text = trainDto.devicePrescription.Dp_memo; // 心率折线图 LEWeb.ObjectForScripting = new ResultLine(trainDto.prescriptionResult.Heart_rate_list, 3); LEWeb.Navigate(new Uri(path + "dist\\LELine.html")); break; case (int)DeviceType.P02: HAGroupcount.Text = trainDto.devicePrescription.Dp_groupcount.ToString(); HAGroupnum.Text = trainDto.devicePrescription.Dp_groupnum.ToString(); HARelaxTime.Text = trainDto.devicePrescription.Dp_relaxtime.ToString(); HAMoveway.Text = trainDto.moveway; HAPower.Text = trainDto.prescriptionResult.Power.ToString(); HATime1.Text = trainDto.prescriptionResult.Finish_time.ToString(); if (trainDto.devicePrescription.Device_mode == DevConstants.REHABILITATION_MODEL) { HATrainingModel.Text = LanguageUtils.ConvertLanguage("康复模式", "Rehabilitation Model"); HAselect_change(); HAConsequentForce.Text = trainDto.devicePrescription.Consequent_force.ToString(); HAReverseForce.Text = trainDto.devicePrescription.Reverse_force.ToString(); } else if (trainDto.devicePrescription.Device_mode == DevConstants.ACTIVE_MODEL) { HATrainingModel.Text = LanguageUtils.ConvertLanguage("主被动模式", "Active Model"); HAselect_change(); HASpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } else { HATrainingModel.Text = LanguageUtils.ConvertLanguage("被动模式", "Passive Model"); HAselect_change(); HASpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } if (trainDto.prescriptionResult == null) { break; } HASportstrength.Text = StrengthConverter(trainDto.prescriptionResult.pr_userthoughts.ToString()); HAHeartRateList.Text = trainDto.prescriptionResult.Heart_rate_list; HAEnergy.Text = trainDto.prescriptionResult.Energy.ToString(); HAFinishNum.Text = trainDto.prescriptionResult.Finish_num.ToString(); HAAttentionpoint.Text = trainDto.devicePrescription.Dp_memo; // 心率折线图 HAWeb.ObjectForScripting = new ResultLine(trainDto.prescriptionResult.Heart_rate_list, 4); HAWeb.Navigate(new Uri(path + "dist\\HALine.html")); break; case (int)DeviceType.P05: CPGroupcount.Text = trainDto.devicePrescription.Dp_groupcount.ToString(); CPGroupnum.Text = trainDto.devicePrescription.Dp_groupnum.ToString(); CPRelaxTime.Text = trainDto.devicePrescription.Dp_relaxtime.ToString(); CPMoveway.Text = trainDto.moveway; CPPower.Text = trainDto.prescriptionResult.Power.ToString(); CPTime1.Text = trainDto.prescriptionResult.Finish_time.ToString(); if (trainDto.devicePrescription.Device_mode == DevConstants.REHABILITATION_MODEL) { CPTrainingModel.Text = LanguageUtils.ConvertLanguage("康复模式", "Rehabilitation Model"); CPselect_change(); CPConsequentForce.Text = trainDto.devicePrescription.Consequent_force.ToString(); CPReverseForce.Text = trainDto.devicePrescription.Reverse_force.ToString(); } else if (trainDto.devicePrescription.Device_mode == DevConstants.ACTIVE_MODEL) { CPTrainingModel.Text = LanguageUtils.ConvertLanguage("主被动模式", "Active Model"); CPselect_change(); CPSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } else { CPTrainingModel.Text = LanguageUtils.ConvertLanguage("被动模式", "Passive Model"); CPselect_change(); CPSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } if (trainDto.prescriptionResult == null) { break; } CPSportstrength.Text = StrengthConverter(trainDto.prescriptionResult.pr_userthoughts.ToString()); CPHeartRateList.Text = trainDto.prescriptionResult.Heart_rate_list; CPEnergy.Text = trainDto.prescriptionResult.Energy.ToString(); CPFinishNum.Text = trainDto.prescriptionResult.Finish_num.ToString(); CPAttentionpoint.Text = trainDto.devicePrescription.Dp_memo; // 心率折线图 CPWeb.ObjectForScripting = new ResultLine(trainDto.prescriptionResult.Heart_rate_list, 5); CPWeb.Navigate(new Uri(path + "dist\\CPLine.html")); break; case (int)DeviceType.P03: NewAGroupcount.Text = trainDto.devicePrescription.Dp_groupcount.ToString(); NewAGroupnum.Text = trainDto.devicePrescription.Dp_groupnum.ToString(); NewARelaxTime.Text = trainDto.devicePrescription.Dp_relaxtime.ToString(); NewAMoveway.Text = trainDto.moveway; NewAPower.Text = trainDto.prescriptionResult.Power.ToString(); NewATime1.Text = trainDto.prescriptionResult.Finish_time.ToString(); if (trainDto.devicePrescription.Device_mode == DevConstants.REHABILITATION_MODEL) { NewATrainingModel.Text = LanguageUtils.ConvertLanguage("康复模式", "Rehabilitation Model"); NewAselect_change(); NewAConsequentForce.Text = trainDto.devicePrescription.Consequent_force.ToString(); NewAReverseForce.Text = trainDto.devicePrescription.Reverse_force.ToString(); } else if (trainDto.devicePrescription.Device_mode == DevConstants.ACTIVE_MODEL) { NewATrainingModel.Text = LanguageUtils.ConvertLanguage("主被动模式", "Active Model"); NewAselect_change(); NewASpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } else { NewATrainingModel.Text = LanguageUtils.ConvertLanguage("被动模式", "Passive Model"); NewAselect_change(); NewASpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } if (trainDto.prescriptionResult == null) { break; } NewASportstrength.Text = StrengthConverter(trainDto.prescriptionResult.pr_userthoughts.ToString()); NewAHeartRateList.Text = trainDto.prescriptionResult.Heart_rate_list; NewAEnergy.Text = trainDto.prescriptionResult.Energy.ToString(); NewAFinishNum.Text = trainDto.prescriptionResult.Finish_num.ToString(); NewAAttentionpoint.Text = trainDto.devicePrescription.Dp_memo; // 心率折线图 NewAWeb.ObjectForScripting = new ResultLine(trainDto.prescriptionResult.Heart_rate_list, 6); NewAWeb.Navigate(new Uri(path + "dist\\NewALine.html")); break; case (int)DeviceType.P04: NewBGroupcount.Text = trainDto.devicePrescription.Dp_groupcount.ToString(); NewBGroupnum.Text = trainDto.devicePrescription.Dp_groupnum.ToString(); NewBRelaxTime.Text = trainDto.devicePrescription.Dp_relaxtime.ToString(); NewBMoveway.Text = trainDto.moveway; NewBPower.Text = trainDto.prescriptionResult.Power.ToString(); NewBTime1.Text = trainDto.prescriptionResult.Finish_time.ToString(); if (trainDto.devicePrescription.Device_mode == DevConstants.REHABILITATION_MODEL) { NewBTrainingModel.Text = LanguageUtils.ConvertLanguage("康复模式", "Rehabilitation Model"); NewBselect_change(); NewBConsequentForce.Text = trainDto.devicePrescription.Consequent_force.ToString(); NewBReverseForce.Text = trainDto.devicePrescription.Reverse_force.ToString(); } else if (trainDto.devicePrescription.Device_mode == DevConstants.ACTIVE_MODEL) { NewBTrainingModel.Text = LanguageUtils.ConvertLanguage("主被动模式", "Active Model"); NewBselect_change(); NewBSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } else { NewBTrainingModel.Text = LanguageUtils.ConvertLanguage("被动模式", "Passive Model"); NewBselect_change(); NewBSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } if (trainDto.prescriptionResult == null) { break; } NewBSportstrength.Text = StrengthConverter(trainDto.prescriptionResult.pr_userthoughts.ToString()); NewBHeartRateList.Text = trainDto.prescriptionResult.Heart_rate_list; NewBEnergy.Text = trainDto.prescriptionResult.Energy.ToString(); NewBFinishNum.Text = trainDto.prescriptionResult.Finish_num.ToString(); NewBAttentionpoint.Text = trainDto.devicePrescription.Dp_memo; // 心率折线图 NewBWeb.ObjectForScripting = new ResultLine(trainDto.prescriptionResult.Heart_rate_list, 7); NewBWeb.Navigate(new Uri(path + "dist\\NewBLine.html")); break; case (int)DeviceType.P07: NewCGroupcount.Text = trainDto.devicePrescription.Dp_groupcount.ToString(); NewCGroupnum.Text = trainDto.devicePrescription.Dp_groupnum.ToString(); NewCRelaxTime.Text = trainDto.devicePrescription.Dp_relaxtime.ToString(); NewCMoveway.Text = trainDto.moveway; NewCPower.Text = trainDto.prescriptionResult.Power.ToString(); NewCTime1.Text = trainDto.prescriptionResult.Finish_time.ToString(); if (trainDto.devicePrescription.Device_mode == DevConstants.REHABILITATION_MODEL) { NewCTrainingModel.Text = LanguageUtils.ConvertLanguage("康复模式", "Rehabilitation Model"); NewCselect_change(); NewCConsequentForce.Text = trainDto.devicePrescription.Consequent_force.ToString(); NewCReverseForce.Text = trainDto.devicePrescription.Reverse_force.ToString(); } else if (trainDto.devicePrescription.Device_mode == DevConstants.ACTIVE_MODEL) { NewCTrainingModel.Text = LanguageUtils.ConvertLanguage("主被动模式", "Active Model"); NewCselect_change(); NewCSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } else { NewCTrainingModel.Text = LanguageUtils.ConvertLanguage("被动模式", "Passive Model"); NewCselect_change(); NewCSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } if (trainDto.prescriptionResult == null) { break; } NewCSportstrength.Text = StrengthConverter(trainDto.prescriptionResult.pr_userthoughts.ToString()); NewCHeartRateList.Text = trainDto.prescriptionResult.Heart_rate_list; NewCEnergy.Text = trainDto.prescriptionResult.Energy.ToString(); NewCFinishNum.Text = trainDto.prescriptionResult.Finish_num.ToString(); NewCAttentionpoint.Text = trainDto.devicePrescription.Dp_memo; // 心率折线图 NewCWeb.ObjectForScripting = new ResultLine(trainDto.prescriptionResult.Heart_rate_list, 8); NewCWeb.Navigate(new Uri(path + "dist\\NewCLine.html")); break; case (int)DeviceType.P08: NewDGroupcount.Text = trainDto.devicePrescription.Dp_groupcount.ToString(); NewDGroupnum.Text = trainDto.devicePrescription.Dp_groupnum.ToString(); NewDRelaxTime.Text = trainDto.devicePrescription.Dp_relaxtime.ToString(); NewDMoveway.Text = trainDto.moveway; NewDPower.Text = trainDto.prescriptionResult.Power.ToString(); NewDTime1.Text = trainDto.prescriptionResult.Finish_time.ToString(); if (trainDto.devicePrescription.Device_mode == DevConstants.REHABILITATION_MODEL) { NewDTrainingModel.Text = LanguageUtils.ConvertLanguage("康复模式", "Rehabilitation Model"); NewDselect_change(); NewDConsequentForce.Text = trainDto.devicePrescription.Consequent_force.ToString(); NewDReverseForce.Text = trainDto.devicePrescription.Reverse_force.ToString(); } else if (trainDto.devicePrescription.Device_mode == DevConstants.ACTIVE_MODEL) { NewDTrainingModel.Text = LanguageUtils.ConvertLanguage("主被动模式", "Active Model"); NewDselect_change(); NewDSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } else { NewDTrainingModel.Text = LanguageUtils.ConvertLanguage("被动模式", "Passive Model"); NewDselect_change(); NewDSpeedRank.Text = trainDto.devicePrescription.Speed_rank.ToString(); } if (trainDto.prescriptionResult == null) { break; } NewDSportstrength.Text = StrengthConverter(trainDto.prescriptionResult.pr_userthoughts.ToString()); NewDHeartRateList.Text = trainDto.prescriptionResult.Heart_rate_list; NewDEnergy.Text = trainDto.prescriptionResult.Energy.ToString(); NewDFinishNum.Text = trainDto.prescriptionResult.Finish_num.ToString(); NewDAttentionpoint.Text = trainDto.devicePrescription.Dp_memo; // 心率折线图 NewDWeb.ObjectForScripting = new ResultLine(trainDto.prescriptionResult.Heart_rate_list, 9); NewDWeb.Navigate(new Uri(path + "dist\\NewDLine.html")); break; } } }