Example #1
0
        /// <summary>
        /// 点击一键上传之前检查文件夹
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void CheckFolderUploadToDb(string forderPath, FileManager.Model.UserModel user)
        {
            try
            {
                string dirPath = forderPath;
                if (!Directory.Exists(dirPath))
                {
                    MessageBox.Show("服务器配置路径不正确,请联系管理员处理!");
                    return;
                }

                ClearCache();

                // 获取配置信息
                Model.SystemConfig config = SystemConfigBll.GetConfig();

                // 设置数据库连接
                string conn = string.Format("server={0};uid={1};pwd={2};database={3};", config.DbAddress, config.DbUser, config.DbPassword, config.DbName);
                // 打开连接
                using (connection = new System.Data.SqlClient.SqlConnection(conn))
                {
                    // 此处查询出所有文件内容
                    DirectoryInfo rootDirInfo = new DirectoryInfo(dirPath);
                    this.textBox1.AppendText("\r\n文件夹:" + dirPath);

                    CheckFolderUploadAllToDb(rootDirInfo, 0, user.UserName, user.CurProject.ID);
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(ex.Message, ex);
            }
        }
 private void InitUiData()
 {
     // 获取配置信息
     config = BLL.SystemConfigBll.GetConfig();
     if (config != null)
     {
         int autoUpdateInterval = config.AutoUpdateInterval;
         skinTextBox_setValue.SkinTxt.Text = autoUpdateInterval.ToString();
     }
 }
 private void InitUiData()
 {
     // 获取配置信息
     config = BLL.SystemConfigBll.GetConfig();
     if (config != null)
     {
         skinTextBox_chemPath.SkinTxt.Text     = config.Chem32Path;
         skinTextBox_dominName.SkinTxt.Text    = config.Domin;
         skinTextBox_softwareName.SkinTxt.Text = config.SoftwareName;
     }
 }
        private void InitUiData()
        {
            // 获取配置信息
            config = BLL.SystemConfigBll.GetConfig();
            if (config != null)
            {
                this.skinTextBox_managerAccount.SkinTxt.Text = config.DbUser;
                this.skinTextBox_managerAddress.SkinTxt.Text = config.DbAddress;
                this.skinTextBox_managerDbName.SkinTxt.Text  = config.DbName;
                this.skinTextBox_managerPwd.SkinTxt.Text     = config.DbPassword;

                this.skinTextBox_contentAccount.SkinTxt.Text = config.DbFileContentUser;
                this.skinTextBox_contentAddress.SkinTxt.Text = config.DbFileContentAddress;
                this.skinTextBox_contentDbName.SkinTxt.Text  = config.DbFileContentName;
                this.skinTextBox_contentPwd.SkinTxt.Text     = config.DbFileContentPassword;
            }
        }