Ejemplo n.º 1
0
        private void 密钥配置ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            base.CheckSystemConfiguration();
            EncryptKeyConfigFrm frm = new EncryptKeyConfigFrm();

            frm.MdiParent = this;
            frm.Show();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 检测系统配置
        /// </summary>
        protected void CheckSystemConfiguration()
        {
            if (!Common.IsExistSQLiteDB())
            {
                ShowErrorMessage("系统未检测到数据库,请联系开卷客服人员");
                return;
            }

            List <SystemConfigEntity> systemConfigList = systemConfigService.GetSystemConfigList();

            if (systemConfigList.Count == 0)
            {
                ShowErrorMessage("系统配置表不存在,请联系开卷客服人员");
                return;
            }

            //1检测客户密钥
            SystemConfigEntity systemConfig = systemConfigList.Find(item => item.SysConfigID == (int)SystemConfigs.EncryptKey);

            if (systemConfig == null)
            {
                ShowErrorMessage("系统配置表不存在客户密钥数据记录,请联系开卷客服人员");
                return;
            }
            if (string.IsNullOrEmpty(systemConfig.ExSetting01))
            {
                ShowErrorMessage("未配置客户密钥,请先配置客户密钥");
                EncryptKeyConfigFrm frm = new EncryptKeyConfigFrm();
                frm.StartPosition = FormStartPosition.CenterParent;
                frm.ShowDialog();;
            }

            //2检测FTP配置
            FtpConfigEntity ftpConfig = ftpService.GetFirstFtpInfo();

            if (ftpConfig == null)
            {
                ShowErrorMessage("未配置FTP信息,请先配置FTP数据");
                FtpConfigFrm frm = new FtpConfigFrm();
                frm.StartPosition = FormStartPosition.CenterParent;
                frm.ShowDialog();
            }
            systemConfig = systemConfigList.Find(item => item.SysConfigID == (int)SystemConfigs.FtpUpoladService);
            if (systemConfig == null)
            {
                ShowErrorMessage("系统配置表不存在FTP上传服务数据记录,请联系开卷客服人员");
                return;
            }
            if (systemConfig.Status == 1)
            {
                try
                {
                    FtpHelper.ConnectFtpServer(ftpConfig);
                }
                catch (Exception ex)
                {
                    ShowErrorMessage($"请检查FTP配置信息。错误信息[{ex.Message}]");
                    FtpConfigFrm frm = new FtpConfigFrm();
                    frm.StartPosition = FormStartPosition.CenterParent;
                    frm.ShowDialog();
                }
            }
        }