private void Button_SaveClick(object sender, RoutedEventArgs e) { //获取文本框的值 string Name = DiagnosisName.Text; CustomData CustomData = CustomDataDAO.GetListByTypeIDAndName(CustomDataEnum.Diagiosis, Name); if (CustomData != null) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("残障名称已存在", "Disability name already exists")); } string value = this.DiagnosisName.Text; selectedDiagnosis.CD_CustomName = value; // MessageBox.Show("OldDiagnosisName:"+ OldDiagnosisName+"Newvalue"+value); DynamicParameters Parameters = new DynamicParameters(); Parameters.Add("User_PhysicalDisabilities", value); Parameters.Add("old", OldDiagnosisName); using (var conn = DbUtil.getConn()) { conn.Execute("update bdl_customdata set CD_CustomName=@CD_CustomName where Pk_CD_Id=@Pk_CD_Id", selectedDiagnosis); string query = "update bdl_user SET user_physicaldisabilities = @User_PhysicalDisabilities where user_physicaldisabilities=@old"; conn.Execute(query, Parameters); } this.Close(); }
/// <summary> /// 保存按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click_Save(object sender, RoutedEventArgs e) { SkeletonLengthEntity skeletonLengthEntity = new SkeletonLengthEntity(); skeletonLengthEntity.Fk_member_id = SelectUser.Pk_User_Id; if (Weigth.Text != null && Weigth.Text != "") { skeletonLengthEntity.Weigth = System.Convert.ToDouble(Weigth.Text); } skeletonLengthEntity.Height = System.Convert.ToDouble(Man_Height.Text); skeletonLengthEntity.Shoulder_width = System.Convert.ToDouble(Shoulder_width.Text); skeletonLengthEntity.Arm_length_up = System.Convert.ToDouble(Arm_length_up.Text); skeletonLengthEntity.Arm_length_down = System.Convert.ToDouble(Arm_length_down.Text); skeletonLengthEntity.Leg_length_up = System.Convert.ToDouble(Leg_length_up.Text); skeletonLengthEntity.Leg_length_down = System.Convert.ToDouble(Leg_length_down.Text); skeletonLengthEntity.Body_length = System.Convert.ToDouble(Body_length.Text); if (skeletonLengthDAO.getSkeletonLengthRecord(SelectUser.Pk_User_Id) == null) { skeletonLengthDAO.insertSkeletonLengthRecord(skeletonLengthEntity); } else { if (Weigth.Text != null && Weigth.Text != "") { skeletonLengthDAO.updateSkeletonLengthAndWeightRecord(skeletonLengthEntity); } else { skeletonLengthDAO.updateSkeletonLengthRecord(skeletonLengthEntity); } } MessageBoxX.Info("保存成功"); }
private void click1(object sender, RoutedEventArgs e) { MessageBoxX.Info("我里边的值随便写"); MessageBoxX.Error("我里边的值真随便写"); MessageBoxX.Warning("我里边的值真真随便写"); MessageBoxX.Question("我里边的值真真真随便写"); }
private void DeleteCommandFunc() { // 支持多选 var res = MessageBoxX.Question("确认删除所选数据?"); MessageBoxX.Info(res.ToString()); }
private void Button_SaveClick(object sender, RoutedEventArgs e) { //获取文本框的值 string Name = DiseaseName.Text; CustomData CustomData = CustomDataDAO.GetListByTypeIDAndName(CustomDataEnum.Disease, Name); if (CustomData != null) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("疾病名称已存在", "Disease name already exists")); } string value = this.DiseaseName.Text; selectedDisease.CD_CustomName = value; DynamicParameters Parameters = new DynamicParameters(); Parameters.Add("user_illnessname", value); Parameters.Add("old", OldDiseaseName); using (var conn = DbUtil.getConn()) { conn.Execute("update bdl_customdata set CD_CustomName=@CD_CustomName where Pk_CD_Id=@Pk_CD_Id", selectedDisease); string query = "update bdl_user SET user_illnessname = @user_illnessname where user_illnessname=@old"; conn.Execute(query, Parameters); } this.Close(); }
private void Button_SaveClick(object sender, RoutedEventArgs e) { //获取文本框的值 string Name = GroupName.Text; CustomData CustomData = CustomDataDAO.GetListByTypeIDAndName(CustomDataEnum.Group, Name); if (CustomData != null) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("小组名称已存在", "Group already exists")); } string value = this.GroupName.Text; selectedGroup.CD_CustomName = value; DynamicParameters Parameters = new DynamicParameters(); Parameters.Add("user_groupname", value); Parameters.Add("old", OldGroupName); using (var conn = DbUtil.getConn()) { conn.Execute("update bdl_customdata set CD_CustomName=@CD_CustomName where Pk_CD_Id=@Pk_CD_Id", selectedGroup); //插入至上传表 UploadManagementDAO uploadManagementDao1 = new UploadManagementDAO(); uploadManagementDao1.Insert(new UploadManagement(selectedGroup.Pk_CD_Id, "bdl_customdata", 1)); string query = "update bdl_user SET user_groupname = @user_groupname where user_groupname=@old"; conn.Execute(query, Parameters); //插入至上传表 UploadManagementDAO uploadManagementDao = new UploadManagementDAO(); uploadManagementDao1.Insert(new UploadManagement(Parameters.Get <int>("old"), "bdl_user", 1)); } this.Close(); }
// 用户自主选择照片 private void Select_Picture_Show(object sender, RoutedEventArgs e) { if (t3.Text == "" || IDCard.Text == "") { MessageBoxX.Info(LanguageUtils.ConvertLanguage("请填写完整信息", "Please fill in the complete information")); return; } using (System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog()) { ofd.Title = "请选择要插入的图片"; ofd.Filter = "JPG图片|*.jpg|BMP图片|*.bmp|Gif图片|*.gif"; ofd.CheckFileExists = true; ofd.CheckPathExists = true; ofd.Multiselect = false; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { BitmapImage image = new BitmapImage(new Uri(ofd.FileName, UriKind.Absolute));//打开图片 var win2 = new PhotoCutWindow(image) { Owner = Window.GetWindow(this), ShowActivated = true, ShowInTaskbar = false, WindowStartupLocation = WindowStartupLocation.CenterScreen }; win2.getName = t3.Text; win2.id = IDCard.Text; win2.oldPhotoName = oldPhotoName; //如果是免冠照片 double p = image.Width / image.Height;//照片比例 if (p > 0.6 && p < 0.8) { PicZipUtil.GetPicThumbnail(ofd.FileName, CommUtil.GetUserPic() + win2.getPhotoName()); } else { win2.ShowDialog(); } photoName = win2.photoName; oldPhotoName = photoName; //photograph.Close(); Console.WriteLine(photoName); //在更新页面上展示用户 刚刚更新的照片 string photoUpdatePhoto = CommUtil.GetUserPic() + photoName; if (File.Exists(photoUpdatePhoto)) { //MessageBox.Show("hi open!"); BitmapImage i = new BitmapImage(new Uri(photoUpdatePhoto, UriKind.Absolute)); //打开图片 pic.Source = i.Clone(); //将控件和图片绑定 } } else { userIfSelectPic = false; } } }
private void Button_OK(object sender, RoutedEventArgs e) { string PassWord = ""; if (UserName.Text != null && UserName.Text != "") { auther.Auth_UserName = UserName.Text; } else { MessageBoxX.Info(LanguageUtils.ConvertLanguage("用户名不能为空", "The username can not be empty")); } auther.Gmt_Create = DateTime.Now; auther.Gmt_Modified = DateTime.Now; if ((bool)Yes.IsChecked) { DateTime date = (DateTime)Auther.Auth_OFFLINETIMEFREE; string sdate = string.Format("{0:yyyy-MM-dd}", date); DateTimeFormatInfo dtFormat = new DateTimeFormatInfo(); dtFormat.ShortDatePattern = "yyyy-MM-dd"; auther.Auth_OfflineTime = Convert.ToDateTime(sdate, dtFormat); auther.User_Status = 2; this.Close(); } else { if (Confirm_Date.SelectedDate == null) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("离线时间不能为空", "The offlinetime can not be empty")); } else { auther.Auth_OfflineTime = Confirm_Date.SelectedDate; auther.User_Status = 0; } } PassWord = Pass.Password; string REPassword = Confirm_Pass.Password; auther.Auth_Level = 0x01; if (UserName.Text != "" && auther.User_Status != null && PassWord.Equals(REPassword) && PassWord != "") { auther.Auth_UserPass = PassWord; authDAO.Insert(auther); this.Close(); } else if (UserName.Text != "" && PassWord == "") { MessageBoxX.Info(LanguageUtils.ConvertLanguage("密码不能为空", "The password can not be empty")); } else if (!PassWord.Equals(REPassword)) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("密码的两次输入不一致", "Two inconsistencies in the password are inconsistencies")); } }
private void Name_LostFocus(object sender, RoutedEventArgs e) { //获取文本框的值 string Name = UserName.Text; Auther AutherTemp = authDAO.GetByName(Name); if (AutherTemp != null) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("用户名已存在", "The username has already existed")); } }
private void Button_Click_4(object sender, RoutedEventArgs e) { byte[] content = Encoding.ASCII.GetBytes("abcdrfghijklmnopqrstuvwxyz12345678901"); byte[] jiamihou = AesUtil.Encrypt(content, ProtocolConstant.USB_DOG_PASSWORD); var jiemihou = AesUtil.Decrypt(jiamihou, ProtocolConstant.USB_DOG_PASSWORD); var str = Encoding.ASCII.GetString(jiemihou); MessageBoxX.Info(str); }
private void Determine(object sender, RoutedEventArgs e) { //如果不为空,赋值 if (portName != "") { SerialPortUtil.portName = portName; this.Close(); } else { MessageBoxX.Info(LanguageUtils.ConvertLanguage("请选择串口", "Please select the serial port")); } }
private void Confirm(object sender, RoutedEventArgs e) { string Password = PasswordText.Password; if (Password == "111") { IsTrue = 1; this.Close(); } else { MessageBoxX.Info(LanguageUtils.ConvertLanguage("密码错误,请重新输入", "Password error, please retype")); } }
private void NavigationService_LoadCompleted(object sender, NavigationEventArgs e) { if (e.ExtraData != null) { // Do something here... // System.Windows.MessageBox.Show(this,string.Format("Capture Page Skip Message:{0}",e.ExtraData),"Capture",MessageBoxButton.OK,MessageBoxImage.Information,MessageBoxResult.OK); MessageBoxX.Info(string.Format("Capture Page Skip Message:{0}", e.ExtraData)); MessageBoxX.Error(string.Format("Capture Page Skip Message:{0}", e.ExtraData)); MessageBoxX.Warning(string.Format("Capture Page Skip Message:{0}", e.ExtraData)); MessageBoxX.Question(string.Format("Capture Page Skip Message:{0}", e.ExtraData)); } }
/// <summary> /// 重置按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click_Clear(object sender, RoutedEventArgs e) { //重新调用扫描的构造函数 cqz NuitrackCreate(); Weigth.Text = null; Man_Height.Text = null; Shoulder_width.Text = null; Arm_length_up.Text = null; Arm_length_down.Text = null; Leg_length_up.Text = null; Leg_length_down.Text = null; Body_length.Text = null; statusImage1.Source = null; statusImage.Source = null; breakFlag = false; MessageBoxX.Info("重置成功,请站在目标位置,再点击开始重新扫描。"); }
// 摄像按钮 private void Photograph(object sender, RoutedEventArgs e) { if (t3.Text == "" || IDCard.Text == "") { MessageBoxX.Info(LanguageUtils.ConvertLanguage("请填写完整信息", "Please fill in the complete information")); return; } // 切换用户图片的显示,解决线程占用问题 BitmapImage bitmap = new BitmapImage(new Uri(@"\view\images\NoPhoto.png", UriKind.Relative)); pic.Source = bitmap; Photograph photograph = new Photograph { Owner = Window.GetWindow(this), ShowActivated = true, ShowInTaskbar = false, WindowStartupLocation = WindowStartupLocation.CenterScreen }; //如果不存在摄像头,不必打开界面 if (!photograph.existCameras) { return; } photograph.getName = t3.Text; photograph.id = IDCard.Text; photograph.oldPhotoName = SelectUser.User_PhotoLocation; photograph.ShowDialog(); photoName = photograph.photoName; //photograph.Close(); Console.WriteLine(photoName); //在更新页面上展示用户 刚刚更新的照片 string photoUpdatePhoto = CommUtil.GetUserPic() + photoName; if (File.Exists(photoUpdatePhoto)) { //MessageBox.Show("hi open!"); BitmapImage image = new BitmapImage(new Uri(photoUpdatePhoto, UriKind.Absolute)); //打开图片 pic.Source = image.Clone(); //将控件和图片绑定 } }
private void Button_Click(object sender, RoutedEventArgs e) { string Name = DiseaseName.Text; CustomData CustomData = CustomDataDAO.GetListByTypeIDAndName(CustomDataEnum.Disease, Name); if (Name == "") { MessageBoxX.Info(LanguageUtils.ConvertLanguage("疾病名称不能为空", "The disease name can not be null")); } else if (CustomData != null) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("疾病名称已存在", "The name of the disease has already existed")); } else { string value = this.DiseaseName.Text; customDataService.InsertCustomData(CustomDataEnum.Disease, value); this.Close(); } }
private void Button_SaveClick(object sender, RoutedEventArgs e) { //获取文本框的值 string Name = GroupName.Text; CustomData CustomData = CustomDataDAO.GetListByTypeIDAndName(CustomDataEnum.Group, Name); if (Name == "") { MessageBoxX.Info(LanguageUtils.ConvertLanguage("小组名称不能为空", "The group name can not be null")); } else if (CustomData != null) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("小组名称已存在", "The group has already existed")); } else { string value = this.GroupName.Text; Console.WriteLine(value); customDataService.InsertCustomData(CustomDataEnum.Group, value); this.Close(); } }
// 重写基类的方法,当消息到达时触发,这里收到消息后,在控制台输出收到的内容,并原样返回了客户端 public override void ChannelRead(IChannelHandlerContext context, object message) { var buffer = message as BodyStrongMessage; //BodyStrongMessage response = new BodyStrongMessage(); //response.Sequence = buffer.Sequence > Int32.MaxValue - 1 ? 0 : buffer.Sequence + 1; if (buffer.MessageType != BodyStrongMessage.Types.MessageType.Heaerbeatresp) { return; } switch (buffer.HeartbeatResponse.ResponseType) { //延长使用时间,注意区分9999和一般时间 case HeartbeatResponse.Types.ResponseType.Addusetime: TcpHeartBeatUtils.AddUseTime(buffer.HeartbeatResponse); break; //正常心跳不做处理 case HeartbeatResponse.Types.ResponseType.Nomal: break; //上锁 case HeartbeatResponse.Types.ResponseType.Lock: TcpHeartBeatUtils.LockUse(buffer.HeartbeatResponse); App.Current.Dispatcher.Invoke(new Action(() => { MessageBoxX.Info(LanguageUtils.GetCurrentLanuageStrByKey("App.Locked")); System.Environment.Exit(0); })); break; //解锁 case HeartbeatResponse.Types.ResponseType.Unlock: TcpHeartBeatUtils.UnLockUse(buffer.HeartbeatResponse); break; } }
//输入非公开信息 private void InputNonPublicInformationPassword(object sender, RoutedEventArgs e) { NonPublicInfomationPass nonPublicInfomationPass = new NonPublicInfomationPass { Owner = Window.GetWindow(this), ShowActivated = true, ShowInTaskbar = false, WindowStartupLocation = WindowStartupLocation.CenterScreen }; nonPublicInfomationPass.ShowDialog(); //将非公开信息框显示 if (nonPublicInfomationPass.result == "success") { this.Non_Public_Information.Visibility = System.Windows.Visibility.Visible; //调整该窗体宽度 //this.Width = 800; } else if (nonPublicInfomationPass.result == "failed") { MessageBoxX.Info(LanguageUtils.ConvertLanguage("密码不正确!", "Incorrect password!")); } }
// 摄像 private void Photograph(object sender, RoutedEventArgs e) { if (t3.Text == "" || IDCard.Text == "") { MessageBoxX.Info(LanguageUtils.ConvertLanguage("请填写完整信息", "Please fill in the complete information")); return; } Photograph photograph = new Photograph { Owner = Window.GetWindow(this), ShowActivated = true, ShowInTaskbar = false, WindowStartupLocation = WindowStartupLocation.CenterScreen }; //如果不存在摄像头,不必打开界面 if (photograph.existCameras == false) { return; } photograph.getName = t3.Text; photograph.id = IDCard.Text; photograph.oldPhotoName = oldPhotoName; photograph.ShowDialog(); photoName = photograph.photoName; oldPhotoName = photoName; //photograph.Close(); //展示摄像的时候的图片 if (File.Exists(CommUtil.GetUserPic() + photoName)) { //MessageBox.Show("hi open!"); BitmapImage bitmap = new BitmapImage(new Uri(CommUtil.GetUserPic() + photoName, UriKind.Absolute)); //打开图片 pic.Source = bitmap.Clone(); //将控件和图片绑定 } }
// 获取摄像头 public Photograph() { InitializeComponent(); this.Width = SystemParameters.WorkArea.Size.Width * 0.477; this.Height = this.Width / 1.24; WindowStartupLocation = WindowStartupLocation.CenterScreen; this.MaxHeight = SystemParameters.WorkArea.Size.Height; this.MaxWidth = SystemParameters.WorkArea.Size.Width; //this.Height = SystemParameters.WorkArea.Size.Height; // combox 获得摄像头列表 cb.ItemsSource = MultimediaUtil.VideoInputNames; if (MultimediaUtil.VideoInputNames.Length > 0) { existCameras = true; cb.SelectedIndex = 0;//第0个摄像头为默认摄像头 } else { MessageBoxX.Info(LanguageUtils.ConvertLanguage("电脑没有安装任何可用摄像头", "Computer does not have any available camera")); //没检测到摄像头。 existCameras = false; return; } }
private void Button_Click(object sender, RoutedEventArgs e) { MessageBoxX.Info("领域驱动设计、三体、极客与团队、技术领导之路、文明"); }
/// <summary> /// 接收数据的监听方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnPortDataReceived(Object sender, SerialDataReceivedEventArgs e) { try { Thread.Sleep(50); isReceive = true;//收到数据,取消重发 byte[] buffer = null;; int len = serialPort.BytesToRead; byte[] receiveData = new byte[len]; serialPort.Read(receiveData, 0, len); //Console.WriteLine("收到的数据:" + ProtocolUtil.ByteToStringOk(receiveData)); int offset = 0; Int32 datalen = 0; if (len > 0 && receiveData[0] == 0xAA)//第一包数据 { datalen = Convert.ToInt32((receiveData[2].ToString("X2") + receiveData[3].ToString("X2")), 16); //Console.WriteLine("数据的长度:" + datalen); buffer = new byte[datalen + 6]; for (int i = 0; i < receiveData.Length; i++) { buffer[i] = receiveData[i]; } offset = receiveData.Length; } else { return; } while (buffer != null && buffer[buffer.Length - 1] != 0xCC) { Thread.Sleep(50); int len2 = serialPort.BytesToRead; if (len2 <= 0) { return; } serialPort.Read(buffer, offset, len2); offset += len2; if (offset > buffer.Length) { return; } } //下面是完整数据 if (buffer != null) { byte[] data = new byte[datalen + 3]; Array.Copy(buffer, 1, data, 0, data.Length); if (buffer[buffer.Length - 2] == ProtocolUtil.XorByByte(data)) { object result = null;//用于存放uuid的鉴权加密 new ParserUSBDogFrame().Parser(ref result, buffer); string b = ProtocolUtil.BytesToString((byte[])result); //Console.WriteLine("解密通讯加密后的数据:" + b); byte[] uuidBytes = null; uuidBytes = AesUtil.Decrypt((byte[])result, ProtocolConstant.USB_DOG_AUTH_PASSWORD); //Console.WriteLine("解密鉴权加密后的数据:" + ProtocolUtil.ByteToStringOk(uuidBytes)); string strUUID = System.Text.Encoding.ASCII.GetString(uuidBytes); if (strUUID == Get_UUID()) { //MessageBoxX.Info("激活成功"); //todo 全局变量 ProtocolConstant.USB_SUCCESS = 1; MessageBoxX.Info(LanguageUtils.ConvertLanguage("激活成功", "Activated successfully")); //Console.WriteLine("激活成功"); logger.Debug("激活成功"); } else { //MessageBox.Show("激活失败"); //Console.WriteLine("激活失败"); logger.Debug("激活失败"); } } else { //Console.WriteLine("校验失败"); logger.Debug("校验失败"); } } } catch (Exception ex) { } finally { //收到消息后至空串口并关闭 SerialPortUtil.ClosePort(ref serialPort); Dispatcher.Invoke(new Action(() => { this.Close(); })); } }
private void FButton_Click_Question(object sender, RoutedEventArgs e) { var res = MessageBoxX.Question("你是最帅的嘛?"); MessageBoxX.Info(res.ToString()); }
//Thread loadThread; //delegate void updateUIHandler(string name); //private void updateWork() //{ // GlobalData.ModuleManager.LoadModuleCompleted += ModuleManager_LoadModuleCompleted; // foreach (var item in GlobalData.ModuleCatalog.Modules) // { // if (item.ModuleName != ModuleNames.Login) // { // Log.info("加载模块开始:" + item.ModuleName); // GlobalData.ModuleManager.LoadModule(item.ModuleName); // } // } // Log.info("运行模块开始"); // //GlobalData.ModuleManager.Run(); //} //public void LoadAllModules() //{ // loadThread = new Thread(new ThreadStart(updateWork)); // loadThread.SetApartmentState(ApartmentState.STA); // loadThread.IsBackground = true; // loadThread.Start(); //} //void ModuleManager_LoadModuleCompleted(object sender, LoadModuleCompletedEventArgs e) //{ // Log.info("加载模块完成:" + e.ModuleInfo.ModuleName); // updateUIHandler mothed = new updateUIHandler(updateUI); // this.Dispatcher.Invoke(mothed, e.ModuleInfo.ModuleName); //} //private void updateUI(string name) { // this.moduleTracker.RecordModuleLoaded(name); // GlobalData.LoadModule.Add(name); // //throw new NotImplementedException(); // if (GlobalData.LoadModule.Count == GlobalData.ModuleCatalog.Modules.Count()) // { // Log.info("加载模块完成打开主菜单"); // regionViewRegistry.RegisterViewWithRegion(RegionNames.Main, typeof(SysSwitchView)); // regionManager.RequestNavigate(RegionNames.Main, "SysSwitchView"); // // 加载各模块主页面 // CommandEventArgs ces = new CommandEventArgs(); // ces.Type = CommandType.registerDefViewWithRegion; // GlobalData.EventAggregator.GetEvent<CommandEvent>().Publish(ces); // } //} private void btnLogin_Click(object sender, RoutedEventArgs e) { this.btnLogin.IsEnabled = false; if ((!String.IsNullOrEmpty(this.txtPassword.Password.Trim()) && !String.IsNullOrEmpty(this.txtName.Text.Trim()))) { this.gcLogin.Visibility = Visibility.Collapsed; this.loadingInfo.Visibility = Visibility.Visible; CommandEventArgs cmd = new CommandEventArgs(); cmd.Type = CommandType.showLoading; GlobalData.EventAggregator.GetEvent <CommandEvent>().Publish(cmd); ServiceComm sc = new ServiceComm(); sc.LoginCompleted += (serice, eve) => { if (eve.Succesed && eve.Result) { Log.info("登录成功"); GlobalData.EventAggregator.GetEvent <BaseDataLoadedEvent>().Publish(1); Log.info("加载模块"); LoadAllModules(); Log.info("存储登录信息"); #region 独立存储区操作 try { if (IsolatedStorageFile.IsEnabled == true) { IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForAssembly(); IsolatedStorageFileStream isoFileStream = isoFile.OpenFile("login.txt", System.IO.FileMode.Create); String loginStr = ""; if (this.cbxRemPassword.IsChecked == true) { loginStr = String.Format("{0}", this.txtName.Text.Trim()); } Byte[] bts = Encoding.UTF8.GetBytes(loginStr); isoFileStream.Write(bts, 0, bts.Length); isoFileStream.Close(); isoFile.Dispose(); } } catch (Exception) { } #endregion GlobalData.UserName = this.txtName.Text.Trim(); Log.info("建立回话连接"); SocketClient socketClient = null; socketClient = SocketClient.GetInstance(); //socketClient.ReceivedMsg = new SocketClient.ReceivedMsgHandler(socketClient_ReceivedMsg); socketClient.BeginConnect(); cmd.Type = CommandType.hideLoading; GlobalData.EventAggregator.GetEvent <CommandEvent>().Publish(cmd); } else { this.btnLogin.IsEnabled = true; this.gcLogin.Visibility = Visibility.Visible; this.loadingInfo.Visibility = Visibility.Collapsed; cmd.Type = CommandType.hideLoading; GlobalData.EventAggregator.GetEvent <CommandEvent>().Publish(cmd); MessageBoxX.Info("登陆失败!"); } }; Log.info("开始登录"); sc.Login(this.txtName.Text.Trim(), this.txtPassword.Password.Trim()); } else { this.btnLogin.IsEnabled = true; MessageBox.Show("请输入用户名或密码!"); } }
/// <summary> /// 确定保存添加按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_OK(object sender, RoutedEventArgs e) { //获取用户身份证的内容 //string userID = t1.Text; //获取用户姓名的内容 string userName = t2.Text; //获取用户姓名拼音的内容 string usernamePY = t3.Text; //获取用户性别的内容 string usersex = c1.Text; //获取用户出生年月的内容 string brithday = t4.Text; //获得身份证号 string IDCard = this.IDCard.Text; //获得手机号 string phone = this.phoneNum.Text; //获取身份证与手机号之后马上查重 //if (userService.GetByIdCard(IDCard) != null) //{ // //身份证重复气泡提示 // Error_Info_IDCard.Content = "该身份证已注册"; // bubble_IDCard.IsOpen = true; //} //if (userService.GetByPhone(phone) != null) //{ // //手机重复气泡提示 // Error_Info_Phone.Content = "该手机号已注册"; // bubble_phone.IsOpen = true; //} if (!String.IsNullOrEmpty(IDCard) || IDCard.Length > 31) { //if (IDCard.Length < 18) //{ // //for (int i = IDCard.Length; i < 18; i++) // //{ // // IDCard = IDCard + '0'; // //} // if (userService.GetByIdCard(IDCard) != null) // { // //身份证重复气泡提示 // Error_Info_IDCard.Content = LanguageUtils.ConvertLanguage("该身份证已注册", "This ID is registered"); // bubble_IDCard.IsOpen = true; // return; // } //} //else if (IDCard.Length == 18 && !inputlimited.InputLimited.IsIDcard(IDCard)) { Error_Info_IDCard.Content = LanguageUtils.ConvertLanguage("请输入正确的身份证号码", "Please enter a valid ID number"); bubble_IDCard.IsOpen = true; return; } else if (userService.GetByIdCard(IDCard) != null) { //身份证重复气泡提示 Error_Info_IDCard.Content = LanguageUtils.ConvertLanguage("该身份证已注册", "This ID is registered"); bubble_IDCard.IsOpen = true; return; } else { bubble_IDCard.IsOpen = false; } } else { Error_Info_IDCard.Content = LanguageUtils.ConvertLanguage("请输入正确的身份证号码", "Please enter the ID number"); bubble_IDCard.IsOpen = true; return; } if (String.IsNullOrEmpty(phone)) { Error_Info_Phone.Content = LanguageUtils.ConvertLanguage("请输入手机号", "Please enter phone number"); bubble_phone.IsOpen = true; return; } else { if (userService.GetByPhone(phone) != null) { //手机重复气泡提示 Error_Info_Phone.Content = LanguageUtils.ConvertLanguage("该手机号已注册", "The phone number is registered"); bubble_phone.IsOpen = true; return; } else if (!inputlimited.InputLimited.IsHandset(phone) && !String.IsNullOrEmpty(phone)) { Error_Info_Phone.Content = LanguageUtils.ConvertLanguage("请输入正确的手机号", "Please enter a valid phone number"); bubble_phone.IsOpen = true; return; } } string IdCard = this.IDCard.Text; string name = t3.Text; //获取小组名称的内容 string groupName = c2.Text; //获取初期要介护度的内容 string initial = c3.SelectedIndex.ToString(); //获取现在要介护度的内容 string now = c4.SelectedIndex.ToString(); //获取疾病名称的内容 string sicknessName = c5.Text; //获取残障名称的内容 string disabilityName = c6.Text; //获取备忘的内容 TextRange text = new TextRange(t6.Document.ContentStart, t6.Document.ContentEnd); string memo = text.Text; //私密信息 String noPublicInfo = this.noPublicInfoText.Text; //string secretMessage = this.Non_Public_Information. User user = new User(); user.User_Privateinfo = noPublicInfo; user.User_Birth = Convert.ToDateTime(brithday); user.User_GroupName = groupName; //设置私密信息 user.User_Privateinfo = noPublicInfo == null ? "" : noPublicInfo; //user.User_Privateinfo = secretMessage==null?"":secretMessage; if (IdCard == null || name == null || IDCard == "" || name == "") { MessageBoxX.Info(LanguageUtils.ConvertLanguage("没有填写身份证或者名字(拼音)", "No identity card or First Name")); return; } user.User_IDCard = IDCard; user.User_IllnessName = sicknessName; user.User_InitCare = initial; user.User_Memo = memo; user.User_Name = userName; user.User_Namepinyin = usernamePY; user.User_Nowcare = now; user.User_PhysicalDisabilities = disabilityName; user.User_Sex = (byte?)(LanguageUtils.EqualsResource(usersex, "AddOrEditView.M") ? 1 : 0); user.User_Phone = phone; // 如果用户是自己选择现成的图片,将图片保存在安装目录下 if (IdCard != null && name != null && IDCard != "" && name != "" && userIfSelectPic != false) { // 用户选择的图片文件的 原路径 string sourcePic = userPhotoPath; // 压缩 string targetPic = CommUtil.GetUserPicTemp(); Random random = new Random(); int rd = random.Next(0, 100000); targetPic += t3.Text.ToString() + rd.ToString() + ".gif"; //targetPic += ".gif"; // 获得保存图片的文件夹 String dirPath = CommUtil.GetUserPicTemp(); //判断是否存在 if (Directory.Exists(dirPath)) { //Response.Write("已存在"); } else { //Response.Write("不存在,正在创建"); Directory.CreateDirectory(dirPath);//创建新路径 } //压缩一下并且储存图片 long picLen = 0; GetPicThumbnail(sourcePic, targetPic, 184, 259, 20); FileInfo di = new FileInfo(targetPic); picLen = di.Length; picLen /= 1024; // 如果图片太大就重新选择 if (picLen > 40) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("图片过大,请重新选择,不能超过40KB", "The picture is too large. Please select it again. Cannot exceed 40KB")); File.Delete(targetPic); return; } string userSelectFinalPic = CommUtil.GetUserPic(photoName); File.Copy(targetPic, userSelectFinalPic); } else if (userIfSelectPic != false) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("没有填写身份证或者名字(拼音)", "No identity card or First Name")); return; } string tempPic = CommUtil.GetUserPicTemp(photoName); // 如果是正常拍照得到的图片 if (File.Exists(tempPic)) { string finalPic = CommUtil.GetUserPic(photoName); //如果增加时,对应位置存在这个图片,则删除 if (File.Exists(finalPic)) { File.Delete(finalPic); } //确定没有重名,在进行复制 File.Copy(tempPic, finalPic); } //将图片的url传到数据库 user.User_PhotoLocation = photoName; userService.InsertUser(user); //保存照片的路径 this.Close(); }
private void Button_Save(object sender, RoutedEventArgs e) { //获取日期 //DateTime? da = date.SelectedDate; DateTime?da = Convert.ToDateTime(date.Content); //康复前血压 string preLowPressure = bloodlow_1.Text; string preHighPressure = bloodhight_1.Text; //康复前心率 string preHeartRate = heartRate_1.Text; //康复前脉 int prePulse = 0; if (rule_1.IsChecked == true) {//规律脉 prePulse = 0; } else if (irregular_1.IsChecked == true) {//脉律不齐 prePulse = 1; } else { MessageBoxX.Info(LanguageUtils.ConvertLanguage("请选择康复前脉症状", "Please choose the symptoms of the pre recovery pulse")); return; } //康复前体温 string preAnimalheat = heat_1.Text; //康复后血压 string sufLowPressure = bloodlow_2.Text; string sufHighPressure = bloodhight_2.Text; if (preLowPressure.Trim() == "" || preHighPressure.Trim() == "" || !(Double.Parse(preHighPressure) > 0 && Double.Parse(preHighPressure) < 300) || !(Double.Parse(preLowPressure) > 0 && Double.Parse(preLowPressure) < 300)) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("请输入正确的血压", "Please enter the right blood pressure")); return; } //康复后心率 string sufHeartRate = heartRate_2.Text; if (preHeartRate.Trim() == "" || !(Int32.Parse(preHeartRate) > 0 && Int32.Parse(preHeartRate) < 200)) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("请输入正确的心率", "Please enter the right heartrate")); return; } int sufPulse = 0; if (rule_2.IsChecked == true) {//规律脉 sufPulse = 0; } else if (irregular_2.IsChecked == true) {//脉律不齐 sufPulse = 1; } //康复后体温 string sufAnimalheat = heat_2.Text; if (preAnimalheat.Trim() == "" || !(Double.Parse(preAnimalheat) < 50 && Double.Parse(preAnimalheat) > 30)) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("请输入正确的体温", "Please enter the right temperature")); return; } //问诊票 List <string> inquiryList = new List <string>(); foreach (CheckBox chk in this.stackPanel_1.Children.OfType <CheckBox>()) { if (chk.IsChecked == true) { inquiryList.Add(chk.Content as string); } } foreach (CheckBox chk in this.stackPanel_2.Children.OfType <CheckBox>()) { if (chk.IsChecked == true) { inquiryList.Add(chk.Content as string); } } string inquiryStr = string.Join(",", inquiryList.ToArray()); //参加不参加 Byte isJoin = 0; if (join_1.IsChecked == true) { isJoin = 0; } else if (join_2.IsChecked == true) { isJoin = 1; } else { MessageBoxX.Info(LanguageUtils.ConvertLanguage("请选择是否参加", "Please choose whether or not to participate")); return; } //int tiId = new DevicePrescriptionDAO().GetTIIdByPRId(trainDto.prescriptionResult.Pk_PR_Id); //摄取水分量 string waterInput = amunt.Text; if (waterInput.Trim() == "" || Double.Parse(waterInput) < 0) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("请输入正确的摄水量", "Please enter the correct water intake")); return; } //看护记录 string careInfo = Record.Text; //构建对象 SymptomInfo symptomInfo = new SymptomInfoDao().Load(symptomInfoDTO.ID); //症状信息 symptomInfo.Fk_User_Id = user.Pk_User_Id; symptomInfo.Gmt_Create = da; symptomInfo.Gmt_Modified = DateTime.Now; symptomInfo.SI_CareInfo = careInfo; symptomInfo.SI_Inquiry = inquiryStr; symptomInfo.SI_IsJoin = isJoin; symptomInfo.SI_WaterInput = waterInput; if (!string.IsNullOrEmpty(train.Text)) { //如果选择了训练记录 symptomInfo.Fk_TI_Id = (int)train.SelectedValue; } //symptomInfo.Fk_TI_Id = tiId; //康复前 symptomInfo.SI_Pre_AnimalHeat = preAnimalheat; symptomInfo.SI_Pre_HeartRate = preHeartRate; symptomInfo.SI_Pre_HighPressure = preHighPressure; symptomInfo.SI_Pre_LowPressure = preLowPressure; symptomInfo.SI_Pre_Pulse = prePulse; //康复后 symptomInfo.SI_Suf_AnimalHeat = sufAnimalheat; symptomInfo.SI_Suf_HeartRate = sufHeartRate; symptomInfo.SI_Suf_HighPressure = sufHighPressure; symptomInfo.SI_Suf_LowPressure = sufLowPressure; symptomInfo.SI_Suf_Pulse = sufPulse; //更新 new SymptomService().UpdateSymptomnInfo(symptomInfo); MessageBoxX.Info(LanguageUtils.ConvertLanguage("已更新", "Finished update")); this.Close(); }
/// <summary> /// 应用启动的时候生命周期 /// </summary> /// <param name="ex"></param> protected override void OnStartup(StartupEventArgs ex) { //全局异常处理机制,UI异常 Current.DispatcherUnhandledException += App_OnDispatcherUnhandledException; //全局异常处理机制,线程异常 AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; //加载语言 LanguageUtils.SetLanguage(); //启动netty,用于与设备端通信 Thread th = new Thread(() => { try { logger.Info("线程启动成功"); NettyLuncher.getInstance().Start().Wait(); } catch (AggregateException ee) { App.Current.Dispatcher.Invoke(new Action(() => { MessageBoxX.Info(LanguageUtils.GetCurrentLanuageStrByKey("App.PortOccupy")); System.Environment.Exit(0); })); } }); th.Start(); //启动远程更新 Thread updateTh = new Thread(() => { try { Thread.Sleep(1000 * 8); Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("version", CommUtil.GetCurrentVersion()); var result = HttpSender.GET(HttpSender.URL_UPDATE, param); if (string.IsNullOrEmpty(result)) { return; } var info = JsonTools.DeserializeJsonToObject <VersionInfo>(result); if (info == null || info.update == false) { return; } info.language = LanguageUtils.IsChainese() ? 1 : 0; App.Current.Dispatcher.Invoke(new Action(() => { Boolean dr = MessageBoxX.Question(LanguageUtils.GetCurrentLanuageStrByKey("App.UpdateInfo")); if (dr == true) { Process.Start("AutoUpdater.exe", info.GetProcessString()); Environment.Exit(0); } })); } catch (Exception exc) { Console.WriteLine(exc.ToString()); return; } }); updateTh.Start(); //大数据线程 Thread bdth = new Thread(() => { try { SetterDAO setterDao = new SetterDAO(); AuthDAO authDAO = new AuthDAO(); while (true) { if (setterDao.ListAll().Count != 1) { //不激活不开启 Thread.Sleep(1000 * 15); continue; } if (authDAO.ListAll().Count == 1) { //Console.WriteLine("-----------------boom shakalaka--------------"); //只有admin,不创建用户,不开启,睡个15s Thread.Sleep(1000 * 15); continue; } try { BigDataOfficer bigDataOfficer = new BigDataOfficer(); bigDataOfficer.Run(); //int heartBeatRate = (int)CommUtil.GetBigDataRate(); Thread.Sleep(1000 * 60); //Console.WriteLine("-----------------boom"); } catch (Exception e) { logger.Error("大数据线程失败:" + e.StackTrace); Console.WriteLine("大数据线程失败:" + e.Message); } } } catch (Exception exct) { Console.WriteLine(exct.ToString()); } }); bdth.Start(); //心跳线程 Thread hbth = new Thread(() => { ProtoBufSocket socket = null; try { socket = new ProtoBufSocket(); socket.Connect(); } catch (Exception exception) { Console.WriteLine("连接失败:" + exception.StackTrace); TcpHeartBeatUtils.WriteLogFile("连接失败:" + exception.StackTrace); } while (true) { try { BodyStrongMessage bodyStrongMessage = new BodyStrongMessage { MessageType = BodyStrongMessage.Types.MessageType.Heaerbeatreq, //可能为null HeartbeatRequest = TcpHeartBeatUtils.GetHeartBeatByCurrent() }; socket.SendMessage(bodyStrongMessage); Console.WriteLine("发送msg!!"); //Thread.Sleep(5000); } catch (Exception eee) { Console.WriteLine("发送msg失败" + eee.StackTrace); TcpHeartBeatUtils.WriteLogFile("发送msg失败" + eee.StackTrace); } finally { Thread.Sleep(5000); } } }); hbth.Start(); base.OnStartup(ex); }
/// <summary> /// 保存按钮的操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Save(object sender, RoutedEventArgs e) { StringBuilder builder = new StringBuilder(); PhysicalPower physicalPower = new PhysicalPower(); try { //id physicalPower.FK_user_Id = Current_User.Pk_User_Id; //日期 physicalPower.Gmt_Create = implementation_date.DateTime; physicalPower.Gmt_Modified = implementation_date.DateTime; //1.拼接身高 physicalPower.PP_High = "param1," + (height_first.Text != "" ? height_first.Text + "," : "param2,") + "param3," + (height_condition.IsChecked == true ? height_condition.Content + "," : "param4,") + (height_duty.Text.ToString() != "" ? height_duty.Text.ToString() : "param5"); //2.拼接体重 physicalPower.PP_Weight = "param1," + (weight_first.Text != "" ? weight_first.Text + "," : "param2,") + "param3," + (weight_condition.IsChecked == true ? "服装:" + weight_condition_text.Text.ToString() + "," : "param4,") + (weight_duty.Text.ToString() != "" ? weight_duty.Text.ToString() : "param5"); //3.拼接握力 if (grip_left.IsChecked == true) { builder.Append(grip_left.Content + ","); } else if (grit_right.IsChecked == true) { builder.Append(grit_right.Content + ","); } else { builder.Append("param1,"); } builder.Append(grip_first.Text != "" ? grip_first.Text + "," : "param2,"); builder.Append(grip_second.Text != "" ? grip_second.Text + "," : "param3,"); if (grid_stand.IsChecked == true) { builder.Append(grid_stand.Content + ","); } else if (grid_sit.IsChecked == true) { builder.Append(grid_sit.Content + ","); } else { builder.Append("param4,"); } builder.Append(grip_duty.Text != "" ? grip_duty.Text : "param5"); physicalPower.PP_Grip = builder.ToString(); builder.Clear(); //4.睁眼单脚站立 if (stand_left.IsChecked == true) { builder.Append(stand_left.Content + ","); } else if (stand_right.IsChecked == true) { builder.Append(stand_right.Content + ","); } else { builder.Append("param1,"); } builder.Append(stand_first.Text != "" ? stand_first.Text + "," : "param2,"); builder.Append(stand_second.Text != "" ? stand_second.Text + "," : "param3,"); if (stand_nosupport.IsChecked == true) { builder.Append(stand_nosupport.Content + ","); } else if (stand_toolsupport.IsChecked == true) { //比较特别,拼接睁眼单脚站立的使用支持用具 IsCheckedTools(ref builder, stand_toolsupport, stand_tools_selected); if (stand_tools_selected2.SelectedValue != null) { builder.Append("(" + stand_tools_selected2.SelectedValue.ToString() + ")"); } builder.Append(","); } else if (stand_support.IsChecked == true) { builder.Append(stand_support.Content + ","); } else { builder.Append("param4,"); } builder.Append(stand_duty.Text != "" ? stand_duty.Text : "param5"); physicalPower.PP_EyeOpenStand = builder.ToString(); builder.Clear(); //5.功能性前伸 if (protrack_twohands.IsChecked == true) { builder.Append(protrack_twohands.Content + ","); } else if (protrack_left.IsChecked == true) { builder.Append(protrack_left.Content + ","); } else if (protrack_right.IsChecked == true) { builder.Append(protrack_right.Content + ","); } else { builder.Append("param1,"); } builder.Append(protrack_first.Text != "" ? protrack_first.Text + "," : "param2,"); builder.Append(protrack_second.Text != "" ? protrack_second.Text + "," : "param3,"); if (protrack_curvature.IsChecked == true) { builder.Append(protrack_curvature.Content + ","); } else if (protrack_sit.IsChecked == true) { builder.Append(protrack_sit.Content + ","); } else { builder.Append("param4,"); } builder.Append(protrack_duty.Text != "" ? protrack_duty.Text : "param5"); physicalPower.PP_FunctionProtract = builder.ToString(); builder.Clear(); //6.坐姿体前屈 if (measuring_leg_left.IsChecked == true) { builder.Append(measuring_leg_left.Content + ","); } else if (measuring_leg_right.IsChecked == true) { builder.Append(measuring_leg_right.Content + ","); } else { builder.Append("param1,"); } builder.Append(sitand_reach_first.Text != "" ? sitand_reach_first.Text + "," : "param2,"); builder.Append(sitand_reach_second.Text != "" ? sitand_reach_second.Text + "," : "param3,"); if (knee_flexure_is.IsChecked == true) { builder.Append(knee_flexure_is.Content + ","); } else if (knee_flexure_not.IsChecked == true) { builder.Append(knee_flexure_not.Content + ","); } else { builder.Append("param4,"); } builder.Append(sitand_reach_duty.Text != "" ? sitand_reach_duty.Text : "param5"); physicalPower.PP_SitandReach = builder.ToString(); builder.Clear(); //7.time&up go if (time_up_base.IsChecked == true) { builder.Append(time_up_base.Content + ","); } else if (time_up_routine.IsChecked == true) { builder.Append(time_up_routine.Content + ","); } else { builder.Append("param1,"); } builder.Append(time_up_first.Text != "" ? time_up_first.Text + "," : "param2,"); builder.Append(time_up_second.Text != "" ? time_up_second.Text + "," : "param3,"); if (time_up_walk.IsChecked == true) { builder.Append(time_up_walk.Content + ","); } else if (time_up_tools.IsChecked == true) { IsCheckedTools(ref builder, time_up_tools, time_up_other_selected); builder.Append(","); } else if (time_up_other.IsChecked == true) { builder.Append(time_up_other_content.Text.ToString() + ","); } else { builder.Append("param4,"); } builder.Append(time_up_duty.Text != "" ? time_up_duty.Text : "param5"); physicalPower.PP_TimeUpGo = builder.ToString(); builder.Clear(); //7.5m步行 (通常) if (walk5_base.IsChecked == true) { builder.Append(walk5_base.Content + ","); } else if (walk5_routine.IsChecked == true) { builder.Append(walk5_routine.Content + ","); } else { builder.Append("param1,"); } builder.Append(walk5_first.Text != "" ? walk5_first.Text + "," : "param2,"); builder.Append(walk5_second.Text != "" ? walk5_second.Text + "," : "param3,"); if (walk5_walk.IsChecked == true) { builder.Append(walk5_walk.Content + ","); } else if (walk5_tools.IsChecked == true) { IsCheckedTools(ref builder, walk5_tools, walk5_tools_selected); builder.Append(","); //builder.Append(walk5_tools_selected.SelectedValue.ToString() + ","); } else if (walk5_other.IsChecked == true) { builder.Append(walk5_other_content.Text.ToString() + ","); } else { builder.Append("param4,"); } builder.Append(walk5_duty.Text != "" ? walk5_duty.Text : "param5"); physicalPower.PP_Walk5MileGeneral = builder.ToString(); builder.Clear(); //8.5m步行 (很快) if (walk5_fastest_base.IsChecked == true) { builder.Append(walk5_fastest_base.Content + ","); } else if (walk5_fastest_routine.IsChecked == true) { builder.Append(walk5_fastest_routine.Content + ","); } else { builder.Append("param1,"); } builder.Append(walk5_fastest_first.Text != "" ? walk5_fastest_first.Text + "," : "param2,"); builder.Append(walk5_fastest_second.Text != "" ? walk5_fastest_second.Text + "," : "param3,"); if (walk5_fastest_walk.IsChecked == true) { builder.Append(walk5_fastest_walk.Content + ","); } else if (walk5_fastest_tools.IsChecked == true) { IsCheckedTools(ref builder, walk5_fastest_tools, walk5_fastest_tools_selected); builder.Append(","); } else if (walk5_fastest_other.IsChecked == true) { builder.Append(walk5_fastest_other_content.Text.ToString() + ","); } else { builder.Append("param4,"); } builder.Append(walk5_fastest_duty.Text != "" ? walk5_fastest_duty.Text : "param5"); physicalPower.PP_Walk5MileFast = builder.ToString(); builder.Clear(); //9.10m步行 if (walk10_base.IsChecked == true) { builder.Append(walk10_base.Content + "(" + walk10_comboBox.SelectedItem.ToString() + "),"); } else if (walk10_routine.IsChecked == true) { builder.Append(walk10_routine.Content + "(" + walk10_comboBox.SelectedItem.ToString() + "),"); } else { builder.Append(walk10_comboBox.SelectedItem.ToString() + ","); } builder.Append(walk10_first.Text != "" ? walk10_first.Text + "," : "param2,"); builder.Append(walk10_second.Text != "" ? walk10_second.Text + "," : "param3,"); if (walk10_walk.IsChecked == true) { builder.Append(walk10_walk.Content + ","); } else if (walk10_tools.IsChecked == true) { IsCheckedTools(ref builder, walk10_tools, walk10_tools_selected); builder.Append(","); } else if (walk10_other.IsChecked == true) { builder.Append(walk10_other_content.Text.ToString() + ","); } else { builder.Append("param4,"); } builder.Append(walk10_duty.Text != "" ? walk10_duty.Text : "param5"); physicalPower.PP_Walk10Mile = builder.ToString(); builder.Clear(); //10.6分钟步行 builder.Append("param1,"); builder.Append(walk6_first.Text != "" ? walk6_first.Text + "," : "param2,"); builder.Append(walk6_second.Text != "" ? walk6_second.Text + "," : "param3,"); if (walk6_walk.IsChecked == true) { builder.Append(walk6_walk.Content + ","); } else if (walk6_tools.IsChecked == true) { IsCheckedTools(ref builder, walk6_tools, walk6_tools_selected); builder.Append(","); } else if (walk6_other.IsChecked == true) { builder.Append(walk6_other_content.Text.ToString() + ","); } else { builder.Append("param4,"); } builder.Append(walk6_duty.Text != "" ? walk6_duty.Text : "param5"); physicalPower.PP_Walk6Minute = builder.ToString(); builder.Clear(); //11.2分钟踏步 builder.Append("param1,"); builder.Append(step2_first.Text != "" ? step2_first.Text + "," : "param2,"); builder.Append(step2_second.Text != "" ? step2_second.Text + "," : "param3,"); if (step2_walk.IsChecked == true) { builder.Append(step2_walk.Content + ","); } else if (step2_tools.IsChecked == true) { IsCheckedTools(ref builder, step2_tools, step2_tools_selected); builder.Append(","); } else if (step2_other.IsChecked == true) { builder.Append(step2_other_content.Text.ToString() + ","); } else { builder.Append("param4,"); } builder.Append(step2_duty.Text != "" ? step2_duty.Text : "param5"); physicalPower.PP_Step2Minute = builder.ToString(); builder.Clear(); //12.2分钟抬腿 builder.Append("param1,"); builder.Append(leg2_first.Text != "" ? leg2_first.Text + "," : "param2,"); builder.Append(leg2_second.Text != "" ? leg2_second.Text + "," : "param3,"); if (leg2_stand.IsChecked == true) { builder.Append(leg2_stand.Content + ","); } else if (leg2_sit.IsChecked == true) { builder.Append(leg2_sit.Content + ","); } else { builder.Append("param4,"); } builder.Append(leg2_duty.Text != "" ? leg2_duty.Text : "param5"); physicalPower.PP_LegRaise2Minute = builder.ToString(); builder.Clear(); //13.使用者感想 TextRange text = new TextRange(user_feel.Document.ContentStart, user_feel.Document.ContentEnd); physicalPower.PP_UserMemo = text.Text.ToString(); //13.使用者感想 TextRange text1 = new TextRange(worker_feel.Document.ContentStart, worker_feel.Document.ContentEnd); physicalPower.PP_WorkerMemo = text1.Text.ToString(); logger.Debug("存储的体力评价信息:" + physicalPower.ToString()); if (new PhysicaleValuationService().AddPhysicalPower(physicalPower) == 1) { //MessageBox.Show(LanguageUtils.ConvertLanguage("已存储", "Finished storage")); MessageBoxX.Info(LanguageUtils.ConvertLanguage("已存储", "Finished storage")); this.Close(); } } catch (Exception ex) { logger.Error("保存体力评价异常"); } }