Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        private void Group_Update(object sender, RoutedEventArgs e)
        {
            if (Selected[0] == 1 && group != null)
            {
                UpdateGroupName groupUpdata = new UpdateGroupName
                {
                    Owner                 = Window.GetWindow(this),
                    ShowActivated         = true,
                    ShowInTaskbar         = false,
                    WindowStartupLocation = WindowStartupLocation.CenterScreen
                };
                //类中使用
                CustomData group = (CustomData)DataGrid2.SelectedItem;
                groupUpdata.selectedGroup = group;

                //UI中使用
                groupUpdata.GroupName.Text = group.CD_CustomName;
                groupUpdata.OldGroupName   = group.CD_CustomName;
                groupUpdata.ShowDialog();
                FlushGroup();
                Selected[0] = 0;
            }
            else
            {
                MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择更新的一行", "Please select an updated row"));
            }
        }
Ejemplo n.º 3
0
 private void Btn_Confirm(object sender, RoutedEventArgs e)
 {//MessageBox.Show(LanguageUtils.ConvertLanguage("你确认要保存更改吗", "Are you sure you want to save your changes?"), LanguageUtils.ConvertLanguage("提示:", "Tips"), MessageBoxButton.OKCancel) == MessageBoxResult.OK
     if (MessageBoxX.Question(LanguageUtils.ConvertLanguage("你确认要保存更改吗", "Are you sure you want to save your changes?")))
     {
         string textValue1 = textBox1.Text;                         //机构团体名称
         string textValue2 = textBox2.Text;                         //照片保存文档
         string textValue3 = textBox3.Text;                         //机构电话
         //string textValue4 = textBox4.Text;//版本
         string        textValue5        = textBox5.Text;           //备份
         int           comboBox1Selected = comboBox1.SelectedIndex; //机构区分被选择的index
         int           comboBox2Selected = comboBox2.SelectedIndex; //语言被选择的index
         entity.Setter setter            = new entity.Setter();
         setter.Pk_Set_Id             = Pk_Set_Id;
         setter.Set_OrganizationName  = textValue1;
         setter.Set_PhotoLocation     = textValue2;
         setter.Set_OrganizationPhone = textValue3;
         //setter.Set_Version = textValue4;
         if (textValue5.Contains(" "))
         {
             MessageBoxX.Warning(LanguageUtils.ConvertLanguage("备份路径不能含有空格", "Backup path cannot contain spaces"));
         }
         else
         {
             setter.Back_Up              = textValue5;//备份路径
             setter.Set_Version          = CommUtil.GetCurrentVersion();
             setter.Set_Language         = comboBox2Selected;
             setter.Set_OrganizationSort = comboBox1Selected.ToString();
             setterDao.UpdateSetter(setter);
             //切换语言
             LanguageUtils.SetLanguage();
             GoBack(null, null);
         }
     }
 }
Ejemplo n.º 4
0
 private void Diagnosis_Update(object sender, RoutedEventArgs e)
 {
     if (Selected[2] == 1 && diagnosis != null)
     {
         UpdateDiagnosisName diagnosisUpdata = new UpdateDiagnosisName
         {
             Owner                 = Window.GetWindow(this),
             ShowActivated         = true,
             ShowInTaskbar         = false,
             WindowStartupLocation = WindowStartupLocation.CenterScreen
         };
         //类中使用
         CustomData diagnosis = (CustomData)DataGrid4.SelectedItem;
         diagnosisUpdata.selectedDiagnosis = diagnosis;
         //UI中使用
         diagnosisUpdata.DiagnosisName.Text = diagnosis.CD_CustomName;
         diagnosisUpdata.OldDiagnosisName   = diagnosis.CD_CustomName;
         diagnosisUpdata.ShowDialog();
         FlushDiagnosis();
         Selected[2] = 0;
     }
     else
     {
         MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择更新的一行", "Please select an updated row"));
     }
 }
Ejemplo n.º 5
0
 private void Btn_Confirm(object sender, RoutedEventArgs e)
 {
     if (MessageBoxX.Question(LanguageUtils.ConvertLanguage("你确认要保存更改吗", "Are you sure you want to save your changes?")))
     {
         deviceSortDAO.UpdateDeviceSorts(DeviceSortList);
     }
 }
Ejemplo n.º 6
0
        //按钮:输入训练结果
        private void InputTrainingResults(object sender, RoutedEventArgs e)
        {
            InputTrainingResults inputTrainingResults = new ChildWin.InputTrainingResults
            {
                Owner         = Window.GetWindow(this),
                ShowActivated = true,
                ShowInTaskbar = false,
                //WindowStartupLocation = WindowStartupLocation.CenterScreen
            };
            User user = (User)UsersInfo.SelectedItem;

            if (user == null)
            {
                MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择用户再进行操作!", "Please Select A Subject!"));
                return;
            }
            if (string.IsNullOrEmpty(user.User_Phone) || string.IsNullOrEmpty(user.User_IDCard))
            {
                MessageBoxX.Warning(LanguageUtils.ConvertLanguage("用户信息不完整!", "Subject information is incomplete!"));
                return;
            }
            inputTrainingResults.DataContext = user;
            inputTrainingResults.ShowDialog();
            Refresh_RecordFrame_Action();
        }
Ejemplo n.º 7
0
        //添加按钮的事件
        private void Btn_Insert(object sender, RoutedEventArgs e)
        {
            int count = authDAO.GetAuthCount();

            if (SetterDAO.ListAll().Count != 0)
            {//判断是否激活
                if (count < 2)
                {
                    AutherAdd addAuther = new AutherAdd
                    {
                        Owner                 = Window.GetWindow(this),
                        ShowActivated         = true,
                        ShowInTaskbar         = false,
                        WindowStartupLocation = WindowStartupLocation.CenterScreen
                    };
                    addAuther.ShowDialog();
                    FlushAuther();
                    authService.UpLoadAuth();
                }
                else
                {
                    MessageBoxX.Info(LanguageUtils.ConvertLanguage("最多只允许存在一个用户", "Only one user is allowed"));
                }
            }
            else
            {
                MessageBoxX.Info(LanguageUtils.ConvertLanguage("您没有添加权限请先激活", "You did not add permission, please activate first"));
            }
        }
Ejemplo n.º 8
0
        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();
        }
Ejemplo n.º 9
0
        //身份证号验证和查重
        private void IsIDCard(object sender, RoutedEventArgs e)
        {
            UserService userService = new UserService();

            if (!String.IsNullOrEmpty(IDCard.Text))
            {
                if (IDCard.Text.Length > 18)
                {
                    Error_Info_IDCard.Content = LanguageUtils.ConvertLanguage("请输入正确的身份证号码", "Please enter a valid ID number");
                    bubble_IDCard.IsOpen      = true;
                }
                else if ((IDCard.Text.Length == 15 || IDCard.Text.Length == 18) && !inputlimited.InputLimited.IsIDcard(IDCard.Text))
                {
                    Error_Info_IDCard.Content = LanguageUtils.ConvertLanguage("请输入正确的身份证号码", "Please enter a valid ID number");
                    bubble_IDCard.IsOpen      = true;
                }
                else
                {
                    bubble_IDCard.IsOpen = false;
                }
            }
            else
            {
                bubble_IDCard.IsOpen = false;
            }
        }
Ejemplo n.º 10
0
        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();
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 文档输出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click_OutputDocument(object sender, RoutedEventArgs e)
        {
            try
            {
                Microsoft.Win32.SaveFileDialog sfd = new Microsoft.Win32.SaveFileDialog();
                sfd.Filter = LanguageUtils.ConvertLanguage("PDF文档(*.pdf)|*.pdf", "PDF document (*.pdf)|*.pdf");
                if (is_comprehensiv.IsChecked == true)
                {
                    sfd.FileName = Current_User.User_Name + "-" + LanguageUtils.ConvertLanguage("综合报告", "Comprehensive report") + "-" + DateTime.Now.ToString("yyyyMMddHHmm") + ".pdf";
                }
                if (is_detail.IsChecked == true)
                {
                    sfd.FileName = Current_User.User_Name + "-" + LanguageUtils.ConvertLanguage("详细报告", "Detailed report") + "-" + DateTime.Now.ToString("yyyyMMddHHmm") + ".pdf";
                }
                if (is_nurse.IsChecked == true)
                {
                    sfd.FileName = Current_User.User_Name + "-" + LanguageUtils.ConvertLanguage("看护记录报告", " Care record report") + "-" + DateTime.Now.ToString("yyyyMMddHHmm") + ".pdf";
                }

                //设置默认文件类型显示顺序
                sfd.FilterIndex = 1;
                //保存对话框是否记忆上次打开的目录
                sfd.RestoreDirectory = true;
                if (sfd.ShowDialog() == true)
                {
                    text_output_document.Text = sfd.FileName;
                }
            }
            catch (Exception ex)
            {
                //Console.WriteLine("文档输出异常");
                logger.Error("文档输出异常");
            }
        }
Ejemplo n.º 12
0
        // 用户自主选择照片
        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;
                }
            }
        }
Ejemplo n.º 13
0
        //按钮:更新
        private void UserUpdata(object sender, RoutedEventArgs e)
        {
            // 切换用户图片的显示,解决线程占用问题
            BitmapImage bitmap = new BitmapImage(new Uri(@"\view\images\NoPhoto.png", UriKind.Relative));

            UserPhoto.Source = bitmap;

            //检查是否选中
            if ((User)UsersInfo.SelectedItem == null)
            //if (selectUser == null)//4.7 lzh
            {
                MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择用户再进行操作!", "Please Select A Subject!"));
                // MessageBox.Show(LanguageUtils.ConvertLanguage("请选择用户再进行操作!", "Please Select A Subject!"));
                return;
            }

            UserUpdata userUpdata = new UserUpdata
            {
                Owner                 = Window.GetWindow(this),
                ShowActivated         = true,
                ShowInTaskbar         = false,
                WindowStartupLocation = WindowStartupLocation.CenterScreen
            };

            //类中使用
            User user = (User)UsersInfo.SelectedItem;

            userUpdata.SelectUser = user;
            //UI中使用
            userUpdata.selectUser.DataContext = user;
            //Console.WriteLine("123123:   " + user.User_Privateinfo);
            userUpdata.noPublicInfoText.Text = user.User_Privateinfo;
            //Console.WriteLine("123123aaaaa:   " + userUpdata.noPublicInfoText.Text);
            userUpdata.ShowDialog();

            //关闭后刷新界面
            users = userService.GetAllUsers();
            UsersInfo.ItemsSource = users;

            // 加载用户头像
            string photoUrl = CommUtil.GetUserPic() + selectUser.User_PhotoLocation;

            if (selectUser.User_PhotoLocation != null)
            {
                try
                {
                    BitmapImage b = new BitmapImage(new Uri(photoUrl, UriKind.Absolute)); //打开图片
                    UserPhoto.Source = b.Clone();                                         //将控件和图片绑定
                }
                catch (Exception ee)
                {
                }
            }
            //更新之后,刷新左下角
            Refresh_RecordFrame_Action();
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 打印预览功能
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click_Print_View(object sender, RoutedEventArgs e)
        {
            try
            {
                if (is_comprehensiv.IsChecked == true)//训练报告
                {
                    GenerateTrainReport();
                }
                else if (is_detail.IsChecked == true)//详细报告
                {
                    GenerateDetailReport();
                }
                else if (is_nurse.IsChecked == true)//看护记录报告
                {
                    GenerateNurseReport();
                }
                else
                {
                    return;
                }
            }
            catch (IOException ex)
            {
                MessageBoxX.Warning(LanguageUtils.ConvertLanguage("文件可能被占用,请关闭相关文件", "The file may be occupied. Please close the relevant file"));
                return;
            }
            catch (Exception ex)
            {
                //Console.WriteLine("生成Excel异常");
                logger.Error("生成Excel异常");
                return;
            }

            try
            {
                //打印
                PdfViewer pDF = new PdfViewer();

                if (DocumentInput_Check.IsChecked == true)
                {
                    if (text_output_document.Text != "")
                    {
                        pDF.SaveToPath = text_output_document.Text;
                    }
                }

                pDF.Left = 200;
                pDF.Top  = 10;
                pDF.Show();
            }
            catch (Exception ex)
            {
                //Console.WriteLine("打印界面展示异常");
                logger.Error("打印界面展示异常");
            }
        }
Ejemplo n.º 15
0
        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"));
            }
        }
Ejemplo n.º 16
0
 private string isEmpty(string val)
 {
     if (val == null || val.Trim() == "")
     {
         return(LanguageUtils.ConvertLanguage("未填写", "Unfilled"));
     }
     else
     {
         return(val);
     }
 }
Ejemplo n.º 17
0
        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"));
            }
        }
Ejemplo n.º 18
0
 //残障名称是否存在
 private void IsDiagnosis(object sender, KeyboardFocusChangedEventArgs e)
 {
     if (!diagnosisList.Contains(c3.Text) && !String.IsNullOrEmpty(c3.Text))
     {
         Error_Info_Diagnosis.Content = LanguageUtils.ConvertLanguage("不存在该残障名称", "There is no such disability name");
         bubble_Diagnosis.IsOpen      = true;
     }
     else
     {
         bubble_Diagnosis.IsOpen = false;
     }
 }
Ejemplo n.º 19
0
 //手机号验证和查重
 private void IsPhone(object sender, RoutedEventArgs e)
 {
     if (!inputlimited.InputLimited.IsHandset(phone.Text) && !String.IsNullOrEmpty(phone.Text))
     {
         Error_Info_Phone.Content = LanguageUtils.ConvertLanguage("请输入正确的手机号", "Please enter a valid phone number");
         bubble_phone.IsOpen      = true;
     }
     else
     {
         bubble_phone.IsOpen = false;
     }
 }
Ejemplo n.º 20
0
 //疾病名称是否存在
 private void IsDisease(object sender, KeyboardFocusChangedEventArgs e)
 {
     if (!diseaseList.Contains(c5.Text) && !String.IsNullOrEmpty(c5.Text))
     {
         Error_Info_disease.Content = LanguageUtils.ConvertLanguage("不存在该疾病名称", "There is no name for the disease");
         bubble_disease.IsOpen      = true;
     }
     else
     {
         bubble_disease.IsOpen = false;
     }
 }
 private void Determine(object sender, RoutedEventArgs e)
 {
     //如果不为空,赋值
     if (portName != "")
     {
         SerialPortUtil.portName = portName;
         this.Close();
     }
     else
     {
         MessageBoxX.Info(LanguageUtils.ConvertLanguage("请选择串口", "Please select the serial port"));
     }
 }
Ejemplo n.º 22
0
 //疾病名称是否存在
 private void IsDisease(object sender, RoutedEventArgs e)
 {
     Console.WriteLine(c4.Text);
     if (!diseaseList.Contains(c4.Text) && !String.IsNullOrEmpty(c4.Text))
     {
         Error_Info_disease.Content = LanguageUtils.ConvertLanguage("不存在该疾病名称", "There is no name for the disease");
         bubble_disease.IsOpen      = true;
     }
     else
     {
         bubble_disease.IsOpen = false;
     }
 }
Ejemplo n.º 23
0
 /// <summary>
 /// 备份
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BackUp(object sender, RoutedEventArgs e)
 {
     try
     {
         string DbUserName = ConfigUtil.GetEncrypt("DbUserName", "");
         string DbPassword = ConfigUtil.GetEncrypt("DbPassword", "");
         string DbUrl      = ConfigUtil.GetEncrypt("DbUrl", "");
         //指令
         string strAddress = string.Format("mysqldump -h{0} -u{1} -p{2} --default-character-set=utf8 --lock-tables --routines --force --quick ", DbUrl, DbUserName, DbPassword);
         //string strAddress = string.Format("mysqldump -h{0} -u{1} -p{2} --default-character-set=utf8 --lock-tables --routines --force --quick ", "127.0.0.1", "root", "53231323xjh");
         //数据库名称
         //string strDB = "bdl1";
         string strDB = ConfigUtil.GetEncrypt("DbName", "");
         //mysql的路径
         string mysqlPath = new SetterService().getPath() + @"\bin";
         //备份的路径(获取前端页面)
         //string filePath = System.AppDomain.CurrentDomain.BaseDirectory + @"\BackUp\";
         string filePath = textBox5.Text;
         if (!Directory.Exists(filePath))         //如果不存在就创建file文件夹                 
         {
             Directory.CreateDirectory(filePath); //创建该文件夹  
         }
         //判断是否含空格
         if (filePath.IndexOf(" ") != -1)
         {
             Console.WriteLine("保存路径中含空格");
             MessageBoxX.Warning(LanguageUtils.ConvertLanguage("备份路径不能含有空格", "Backup path cannot contain spaces"));
             return;
         }
         //执行的指令
         string cmd    = strAddress + strDB + " > " + filePath + "bdl.sql";
         string result = CommUtil.RunCmd(mysqlPath, cmd);
         //MessageBox.Show(result);
         //图片备份
         CommUtil.CopyDirectory(filePath);
         if (("mysqldump: [Warning] Using a password on the command line interface can be insecure.".Trim()).Contains(result.Trim()) ||
             ("Warning: Using a password on the command line interface can be insecure.".Trim()).Contains(result.Trim()))
         {
             MessageBoxX.Info(LanguageUtils.ConvertLanguage("数据备份成功", "Successful data backup"));
         }
         else
         {
             MessageBoxX.Error(LanguageUtils.ConvertLanguage("数据备份失败", " Data backup failed"));
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("执行sql异常,备份异常" + ex.ToString());
     }
 }
Ejemplo n.º 24
0
        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"));
            }
        }
Ejemplo n.º 25
0
            /// <summary>
            /// 从字符串中截取第一个参数值
            /// </summary>
            /// <param name="value"></param>
            /// <returns></returns>
            private string SubstringParams(string value)
            {
                int    startIndex = value.IndexOf(",") + 1;
                int    endIndex   = value.IndexOf(",", startIndex);
                string result     = value.Substring(startIndex, endIndex - startIndex);

                if (result.Contains("param"))
                {
                    return(LanguageUtils.ConvertLanguage("未填写", "Unfilled"));
                }
                else
                {
                    return(result);
                }
            }
Ejemplo n.º 26
0
 public MainWindow()
 {
     InitializeComponent();
     //bigDataOfficer = new BigDataOfficer(12);
     // 初始化摄像头
     Camera_CB.ItemsSource = MultimediaUtil.VideoInputNames;
     if (MultimediaUtil.VideoInputNames.Length > 0)
     {
         Camera_CB.SelectedIndex = 0;//第0个摄像头为默认摄像头
     }
     else
     {
         MessageBox.Show(LanguageUtils.ConvertLanguage("电脑没有安装任何可用摄像头", "The computer doesn't install any available cameras"));
         //System.Windows.MessageBox.Show("电脑没有安装任何可用摄像头");
     }
 }
Ejemplo n.º 27
0
 private void Diagnosis_Delete(object sender, RoutedEventArgs e)
 {
     if (Selected[2] == 1)
     {
         if (MessageBoxX.Question(LanguageUtils.ConvertLanguage("你确认要删除所选项吗", "Do you want to delete the selected item?")))
         {
             customDataDAO.DeleteCustomDataByPrimaryKey(diagnosis.Pk_CD_Id);//在数据库中删除
             FlushDiagnosis();
             Selected[2] = 0;
         }
     }
     else
     {
         MessageBoxX.Warning(LanguageUtils.ConvertLanguage("请选择删除的一行", "Please select an delete row"));
     }
 }
Ejemplo n.º 28
0
 //删除按钮的事件
 private void Btn_Delete(object sender, RoutedEventArgs e) //单击删除按钮触发事件
 {
     if (selected == 1)
     {
         if (MessageBoxX.Question(LanguageUtils.ConvertLanguage("你确认要删除所选项吗", "Do you want to delete the selected item?")))
         {
             authDAO.DeleteByPrimaryKey(auther);//在数据库中删除
             FlushAuther();
             selected = 0;
         }
     }
     else
     {
         MessageBoxX.Info(LanguageUtils.ConvertLanguage("请选择删除的一行", "Please select an delete row"));
     }
 }
Ejemplo n.º 29
0
        //结束时间
        private void end_date_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            //时间范围 - 开始时间
            DateTime endTime   = Convert.ToDateTime(end_date.Text);
            DateTime?startTime = getDateByStr(start_date.Text);

            if (startTime != null)
            {
                if (DateTime.Compare(endTime, (DateTime)startTime) < 0)
                {
                    MessageBoxX.Warning(LanguageUtils.ConvertLanguage("终止时间不能小于起始时间", "The termination time cannot be less than the start time"));
                }
            }

            datalist.DataContext = listBeansByStartToEndTime(startTime, endTime);
        }
Ejemplo n.º 30
0
        private bool VerifyFileMd5(string fileName)
        {
            Thread.Sleep(1000);
            var  md5   = Utility.GetFileMD5(fileName);
            bool lagel = String.Equals(UpdateInfo.FileMd5, md5, StringComparison.CurrentCultureIgnoreCase);

            if (!lagel)
            {
                StatusDescription = LanguageUtils.ConvertLanguage(language, "更新失败,更新文件MD5码不一致!", " Update failed, update file MD5 code is inconsistent!");
                Loger.Print("Update file MD5 inconsistent. ");
                Directory.Delete(UpdateInfo.TempPath, true);;
                return(false);
            }

            return(true);
        }