Ejemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //viewbox.MaxHeight = SystemParameters.WorkArea.Size.Height;
            //viewbox.MaxWidth = SystemParameters.WorkArea.Size.Width;
            this.Height = SystemParameters.WorkArea.Size.Height;
            var hwnd = new System.Windows.Interop.WindowInteropHelper(this).Handle;

            SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_SYSMENU);
            //绑定数据
            Dictionary <string, object> dic = (Dictionary <string, Object>)DataContext;

            user           = (User)dic["user"];
            symptomInfoDTO = (SymptomInfoDTO)dic["symptomInfoDto"];
            logger.Info("user:"******"; symptomInfoDTO:" + symptomInfoDTO);
            Load_Data();
        }
Ejemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.Height = SystemParameters.WorkArea.Size.Height;

            var hwnd = new System.Windows.Interop.WindowInteropHelper(this).Handle;

            SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_SYSMENU);
            //绑定数据
            Dictionary <string, object> dic = (Dictionary <string, Object>)DataContext;

            user           = (User)dic["user"];
            symptomInfoDTO = (SymptomInfoDTO)dic["symptom"];
            List <TrainInfo> trainInfoNoSymp = new TrainInfoDAO().GetTrainInfoNoSymp(user.Pk_User_Id);

            train.ItemsSource = new TrainDTO().ConvertDtoList(trainInfoNoSymp);
            Load_Data();
        }
Ejemplo n.º 3
0
        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            Object o    = record.Content;
            User   user = (User)UsersInfo.SelectedItem;

            if (user == null)
            {
                MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择用户再进行操作!", "Please Select A Subject!"));
                return;
            }

            if (is_signinformationrecord.IsChecked == false || record.Content == null)
            {
                MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择症状信息再进行操作!", "Please Select A Symptom Info!"));
                return;
            }

            DataGrid dataGrid = ((SignInformationRecord_Frame)record.Content).SignInformationRecord;

            SymptomInfoDTO symptomInfoDto = (SymptomInfoDTO)dataGrid.SelectedItem;

            if (symptomInfoDto == null)
            {
                MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择症状信息再进行操作!", "Please Select A Symptom Info!"));
                return;
            }

            UpdateSymptominfo w2 = new UpdateSymptominfo
            {
                Owner                 = Window.GetWindow(this),
                ShowActivated         = true,
                ShowInTaskbar         = false,
                WindowStartupLocation = WindowStartupLocation.CenterScreen
            };
            Dictionary <string, Object> dic = new Dictionary <string, object>();

            dic.Add("user", user);
            dic.Add("symptom", symptomInfoDto);
            w2.DataContext = dic;
            w2.ShowDialog();
            Refresh_RecordFrame_Action();
        }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="uploadManagement">传入上传管理者实体</param>
        /// <returns>返回可以用来上传的辅助对象</returns>
        public ServiceResult GetServiceResult(UploadManagement uploadManagement)
        {
            //service返回结果对象
            ServiceResult serviceResult = new ServiceResult();
            //提前载入唯一Setter
            SetterDAO setterDAO = new SetterDAO();
            Setter    setter    = setterDAO.getSetter();
            //需要加入解密逻辑 TODO
            string mac = "";

            //try
            //{
            //    byte[] deBytes = AesUtil.Decrypt(Encoding.GetEncoding("GBK").GetBytes(setter.Set_Unique_Id),
            //        ProtocolConstant.USB_DOG_PASSWORD);
            //    mac = Encoding.GetEncoding("GBK").GetString(deBytes);
            //}
            //catch (Exception ex)
            //{
            //    mac = setter.Set_Unique_Id.Replace(":", "");
            //}
            byte[] a = ProtocolUtil.StringToBcd(setter.Set_Unique_Id);
            byte[] b = AesUtil.Decrypt(a, ProtocolConstant.USB_DOG_PASSWORD);
            mac = Encoding.GetEncoding("GBK").GetString(b).Replace(":", "-");

            ///if识别出表,设置发送路径,select出实体,转化至DTO,json打成string,返回
            //识别是否是权限用户添加
            if (uploadManagement.UM_DataTable == "bdl_auth")
            {
                AuthDAO authDAO = new AuthDAO();
                Auther  auther  = authDAO.Load(uploadManagement.UM_DataId);
                if (auther == null)
                {
                    return(null);
                }
                AutherDTO autherDTO = new AutherDTO(setter, auther, mac);


                //serviceResult.URL = "clientController/addClient.action";
                serviceResult.Data = JsonTools.Obj2JSONStrNew <AutherDTO>(autherDTO);
            }
            //bdl_customdata表
            else if (uploadManagement.UM_DataTable == "bdl_customdata")
            {
                CustomDataDAO customDataDAO = new CustomDataDAO();
                CustomData    customData    = customDataDAO.Load(uploadManagement.UM_DataId);
                if (customData == null)
                {
                    return(null);
                }
                CustomDataDTO customDataDTO = new CustomDataDTO(customData, mac);
                serviceResult.Data = JsonTools.Obj2JSONStrNew <CustomDataDTO>(customDataDTO);
            }
            //bdl_datacode表
            else if (uploadManagement.UM_DataTable == "bdl_datacode")
            {
                DataCodeDAO dataCodedao = new DataCodeDAO();
                DataCode    dataCode    = dataCodedao.Load(uploadManagement.UM_DataId);

                if (dataCode == null)
                {
                    return(null);
                }
                DataCodeDTO dataCodeDTO = new DataCodeDTO(dataCode, mac);
                serviceResult.Data = JsonTools.Obj2JSONStrNew <DataCodeDTO>(dataCodeDTO);
            }
            //bdl_deviceset表
            else if (uploadManagement.UM_DataTable == "bdl_deviceset")
            {
                DeviceSetDAO deviceSetDAO = new DeviceSetDAO();
                DeviceSet    deviceSet    = deviceSetDAO.Load(uploadManagement.UM_DataId);
                if (deviceSet == null)
                {
                    return(null);
                }
                DeviceSetDTO deviceSetDTO = new DeviceSetDTO(deviceSet, mac);

                serviceResult.Data = JsonTools.Obj2JSONStrNew <DeviceSetDTO>(deviceSetDTO);
            }
            //bdl_devicesort表
            else if (uploadManagement.UM_DataTable == "bdl_devicesort")
            {
                DeviceSortDAO deviceSortDAO = new DeviceSortDAO();
                DeviceSort    deviceSort    = deviceSortDAO.Load(uploadManagement.UM_DataId);
                if (deviceSort == null)
                {
                    return(null);
                }
                DeviceSortDTO deviceSortDTO = new DeviceSortDTO(deviceSort, mac);


                serviceResult.Data = JsonTools.Obj2JSONStrNew <DeviceSortDTO>(deviceSortDTO);
            }
            //bdl_onlinedevice表
            else if (uploadManagement.UM_DataTable == "bdl_onlinedevice")
            {
                OnlineDeviceDAO onlineDeviceDAO = new OnlineDeviceDAO();
                OnlineDevice    onlineDevice    = onlineDeviceDAO.Load(uploadManagement.UM_DataId);

                if (onlineDevice == null)
                {
                    return(null);
                }
                OnlineDeviceDTO onlineDeviceDTO = new OnlineDeviceDTO(onlineDevice, mac);

                serviceResult.Data = JsonTools.Obj2JSONStrNew <OnlineDeviceDTO>(onlineDeviceDTO);
            }
            //bdl_set表
            else if (uploadManagement.UM_DataTable == "bdl_set")
            {
                SetterDAO setterDAO1 = new SetterDAO();
                Setter    setter1    = setterDAO1.Load(uploadManagement.UM_DataId);

                if (setter1 == null)
                {
                    return(null);
                }

                SetterDTO setterDTO = new SetterDTO(setter1, mac);

                serviceResult.Data = JsonTools.Obj2JSONStrNew <SetterDTO>(setterDTO);
            }
            //病人表
            else if (uploadManagement.UM_DataTable == "bdl_user")
            {
                UserDAO userDAO = new UserDAO();
                User    user    = userDAO.Load(uploadManagement.UM_DataId);
                if (user == null)
                {
                    return(null);
                }


                UserDTO userDTO = new UserDTO(user, mac);
                //serviceResult.URL = "bigData/bodyStrongUser";
                serviceResult.Data = JsonTools.Obj2JSONStrNew <UserDTO>(userDTO);
            }

            //症状表
            else if (uploadManagement.UM_DataTable == "bdl_symptominfo")
            {
                SymptomInfoDao symptomInfoDao = new SymptomInfoDao();
                var            result         = symptomInfoDao.Load(uploadManagement.UM_DataId);
                if (result == null)
                {
                    return(null);
                }


                SymptomInfoDTO symptomInfoDTO = new SymptomInfoDTO(result, mac);
                //serviceResult.URL = "bigData/symptomInfo";
                serviceResult.Data = JsonTools.Obj2JSONStrNew <SymptomInfoDTO>(symptomInfoDTO);
            }

            //训练处方总表
            else if (uploadManagement.UM_DataTable == "bdl_traininfo")
            {
                TrainInfoDAO trainInfoDAO = new TrainInfoDAO();
                var          result       = trainInfoDAO.Load(uploadManagement.UM_DataId);
                if (result == null)
                {
                    return(null);
                }


                TrainInfoDTO trainInfoDTO = new TrainInfoDTO(result, mac);
                //serviceResult.URL = "bigData/trainInfo";
                serviceResult.Data = JsonTools.Obj2JSONStrNew <TrainInfoDTO>(trainInfoDTO);
            }

            //总表中的一条数据对某台设备的具体处方
            else if (uploadManagement.UM_DataTable == "bdl_deviceprescription")
            {
                DevicePrescriptionDAO devicePrescriptionDAO = new DevicePrescriptionDAO();
                var result = devicePrescriptionDAO.Load(uploadManagement.UM_DataId);
                if (result == null)
                {
                    return(null);
                }


                DevicePrescriptionDTO devicePrescriptionDTO = new DevicePrescriptionDTO(result, mac);
                //serviceResult.URL = "bigData/devicePrescription";
                serviceResult.Data = JsonTools.Obj2JSONStrNew <DevicePrescriptionDTO>(devicePrescriptionDTO);
            }
            //具体处方的具体反馈
            else if (uploadManagement.UM_DataTable == "bdl_prescriptionresult")
            {
                PrescriptionResultDAO prescriptionResultDAO = new PrescriptionResultDAO();
                var result = prescriptionResultDAO.Load(uploadManagement.UM_DataId);
                if (result == null)
                {
                    return(null);
                }


                PrescriptionResultDTO prescriptionResultDTO = new PrescriptionResultDTO(result, mac);
                //serviceResult.URL = "bigData/prescriptionResult";
                serviceResult.Data = JsonTools.Obj2JSONStrNew <PrescriptionResultDTO>(prescriptionResultDTO);
            }
            else if (uploadManagement.UM_DataTable == "bdl_physicalpower")
            {
                PhysicalPowerDAO physicalPowerDAO = new PhysicalPowerDAO();
                var result = physicalPowerDAO.Load(uploadManagement.UM_DataId);
                if (result == null)
                {
                    return(null);
                }

                PhysicalPowerDTO physicalPowerDTO = new PhysicalPowerDTO(result, mac);
                //serviceResult.URL = "bigData/physicalPower";
                serviceResult.Data = JsonTools.Obj2JSONStrNew <PhysicalPowerDTO>(physicalPowerDTO);
            }
            else if (uploadManagement.UM_DataTable == "bdl_error")
            {
                ErrorDao errorDao = new ErrorDao();
                var      result   = errorDao.Load(uploadManagement.UM_DataId);
                if (result == null)
                {
                    return(null);
                }

                ErrorDTO errorDTO = new ErrorDTO(result, mac);
                //serviceResult.URL = "bigData/physicalPower";
                serviceResult.Data = JsonTools.Obj2JSONStrNew <ErrorDTO>(errorDTO);
            }

            return(serviceResult);
        }
Ejemplo n.º 5
0
        //按钮:查看详细信息
        private void ViewDetails(object sender, RoutedEventArgs e)
        {
            //查看征状详细信息
            if (is_signinformationrecord.IsChecked == true)
            {
                ViewSymptomInformation viewSymptomInformation = new ViewSymptomInformation
                {
                    Owner                 = Window.GetWindow(this),
                    ShowActivated         = true,
                    ShowInTaskbar         = false,
                    WindowStartupLocation = WindowStartupLocation.CenterScreen
                };
                List <TrainInfo> list      = new List <TrainInfo>();
                TrainInfo        trainInfo = new TrainInfo
                {
                    Gmt_Create = new DateTime(2012, 01, 02)
                };
                list.Add(trainInfo);
                Console.WriteLine(trainInfo.Gmt_Create);
                list.Add(trainInfo);

                if (record.Content == null)
                {
                    MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择症状信息再进行操作!", "Please Select A Symptom Info!"));
                    return;
                }

                DataGrid dataGrid = ((SignInformationRecord_Frame)record.Content).SignInformationRecord;

                SymptomInfoDTO symptomInfoDto = (SymptomInfoDTO)dataGrid.SelectedItem;
                User           user           = (User)UsersInfo.SelectedItem;
                if (user == null)
                {
                    MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择用户再进行操作!", "Please Select A Subject!"));
                    return;
                }

                if (symptomInfoDto == null)
                {
                    MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择症状信息再进行操作!", "Please Select A Symptom Info!"));
                    return;
                }

                Dictionary <string, Object> dictionary = new Dictionary <string, object>();
                dictionary.Add("user", user);
                dictionary.Add("symptomInfoDto", symptomInfoDto);
                viewSymptomInformation.DataContext = dictionary;
                viewSymptomInformation.ShowDialog();
            }
            //打开训练详细信息
            else if (is_trainingrecord.IsChecked == true)
            {
                ViewTrainingResults viewTrainingResults = new ViewTrainingResults
                {
                    Owner                 = Window.GetWindow(this),
                    ShowActivated         = true,
                    ShowInTaskbar         = false,
                    WindowStartupLocation = WindowStartupLocation.CenterScreen
                };

                Object   o        = record.Content;
                TrainDTO trainDto = null;
                User     user     = (User)UsersInfo.SelectedItem;
                if (o is TrainingRecord_Frame)
                {
                    TrainingRecord_Frame trainingRecordFrame = (TrainingRecord_Frame)o;
                    int index = trainingRecordFrame.TabControl1.SelectedIndex;
                    switch (index)
                    {
                    case 0:
                        trainDto = (TrainDTO)trainingRecordFrame.TrainingRecord1.SelectedItem;
                        break;

                    case 1:
                        trainDto = (TrainDTO)trainingRecordFrame.TrainingRecord2.SelectedItem;
                        break;

                    case 2:
                        trainDto = (TrainDTO)trainingRecordFrame.TrainingRecord3.SelectedItem;
                        break;

                    case 3:
                        trainDto = (TrainDTO)trainingRecordFrame.TrainingRecord4.SelectedItem;
                        break;

                    case 4:
                        trainDto = (TrainDTO)trainingRecordFrame.TrainingRecord5.SelectedItem;
                        break;

                    case 5:
                        trainDto = (TrainDTO)trainingRecordFrame.TrainingRecord6.SelectedItem;
                        break;
                    }
                }

                if (user == null)
                {
                    MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择用户再进行操作!", "Please Select A Subject!"));
                    return;
                }
                if (trainDto == null)
                {//判断是否选择了训练信息
                    MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择训练信息再进行操作!", "Please Select A Train Info!"));
                    return;
                }
                Dictionary <string, Object> dic = new Dictionary <string, object>();
                dic.Add("user", user);
                dic.Add("trainDto", trainDto);
                viewTrainingResults.DataContext = dic;
                viewTrainingResults.ShowDialog();
            }
            //打开体力评价详细信息
            else if (is_physicalevaluation.IsChecked == true)
            {
                ViewManualMvaluation viewManualMvaluation = new ViewManualMvaluation
                {
                    Owner                 = Window.GetWindow(this),
                    ShowActivated         = true,
                    ShowInTaskbar         = false,
                    WindowStartupLocation = WindowStartupLocation.CenterScreen
                };

                Object       o            = record.Content;
                PhysicaleDTO physicaleDto = null;
                User         user         = (User)UsersInfo.SelectedItem;
                if (o is PhysicaleValuation_Frame)
                {
                    PhysicaleValuation_Frame physicaleValuationFrame = (PhysicaleValuation_Frame)o;
                    physicaleDto = (PhysicaleDTO)physicaleValuationFrame.PhysicaleValuation.SelectedItem;
                }

                if (user == null)
                {
                    MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择用户再进行操作!", "Please Select A Subject!"));
                    return;
                }
                if (physicaleDto == null)
                {//判断是否选择了训练信息
                    MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择体力评价再进行操作!", "Please Select A Physical Evalution!"));
                    return;
                }
                Dictionary <string, Object> dic = new Dictionary <string, object>();
                dic.Add("user", user);
                dic.Add("physicaleDto", physicaleDto);
                viewManualMvaluation.DataContext = dic;
                viewManualMvaluation.ShowDialog();
            }
        }