diff --git a/插件库/Lskj.Main/FrmConfig.Designer.cs b/插件库/Lskj.Main/FrmConfig.Designer.cs index 4c3a1af..cf9cd8a 100644 --- a/插件库/Lskj.Main/FrmConfig.Designer.cs +++ b/插件库/Lskj.Main/FrmConfig.Designer.cs @@ -40,11 +40,15 @@ this.btnConnect = new DevExpress.XtraEditors.SimpleButton(); this.btnSave = new DevExpress.XtraEditors.SimpleButton(); this.btnExit = new DevExpress.XtraEditors.SimpleButton(); + this.labelControl1 = new DevExpress.XtraEditors.LabelControl(); + this.serverType = new System.Windows.Forms.ComboBox(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // groupBox1 // + this.groupBox1.Controls.Add(this.serverType); + this.groupBox1.Controls.Add(this.labelControl1); this.groupBox1.Controls.Add(this.radioOutside); this.groupBox1.Controls.Add(this.radioWithin); this.groupBox1.Controls.Add(this.txtServerNameInternal); @@ -52,16 +56,16 @@ this.groupBox1.Controls.Add(this.txtServerName); this.groupBox1.Controls.Add(this.labelControl2); this.groupBox1.Controls.Add(this.label1); - this.groupBox1.Location = new System.Drawing.Point(13, 10); + this.groupBox1.Location = new System.Drawing.Point(13, 12); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(260, 106); + this.groupBox1.Size = new System.Drawing.Size(260, 135); this.groupBox1.TabIndex = 4; this.groupBox1.TabStop = false; // // radioOutside // this.radioOutside.AutoSize = true; - this.radioOutside.Location = new System.Drawing.Point(6, 18); + this.radioOutside.Location = new System.Drawing.Point(6, 49); this.radioOutside.Name = "radioOutside"; this.radioOutside.Size = new System.Drawing.Size(73, 18); this.radioOutside.TabIndex = 12; @@ -72,7 +76,7 @@ // radioWithin // this.radioWithin.AutoSize = true; - this.radioWithin.Location = new System.Drawing.Point(6, 46); + this.radioWithin.Location = new System.Drawing.Point(6, 77); this.radioWithin.Name = "radioWithin"; this.radioWithin.Size = new System.Drawing.Size(73, 18); this.radioWithin.TabIndex = 11; @@ -83,7 +87,7 @@ // txtServerNameInternal // this.txtServerNameInternal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.txtServerNameInternal.Location = new System.Drawing.Point(85, 42); + this.txtServerNameInternal.Location = new System.Drawing.Point(85, 73); this.txtServerNameInternal.MaxLength = 50; this.txtServerNameInternal.Name = "txtServerNameInternal"; this.txtServerNameInternal.Size = new System.Drawing.Size(162, 22); @@ -92,7 +96,7 @@ // txtDBName // this.txtDBName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.txtDBName.Location = new System.Drawing.Point(85, 70); + this.txtDBName.Location = new System.Drawing.Point(85, 101); this.txtDBName.MaxLength = 50; this.txtDBName.Name = "txtDBName"; this.txtDBName.Size = new System.Drawing.Size(162, 22); @@ -101,7 +105,7 @@ // txtServerName // this.txtServerName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.txtServerName.Location = new System.Drawing.Point(85, 15); + this.txtServerName.Location = new System.Drawing.Point(85, 46); this.txtServerName.MaxLength = 50; this.txtServerName.Name = "txtServerName"; this.txtServerName.Size = new System.Drawing.Size(162, 22); @@ -109,7 +113,7 @@ // // labelControl2 // - this.labelControl2.Location = new System.Drawing.Point(12, 74); + this.labelControl2.Location = new System.Drawing.Point(12, 105); this.labelControl2.Name = "labelControl2"; this.labelControl2.Size = new System.Drawing.Size(60, 14); this.labelControl2.TabIndex = 5; @@ -126,7 +130,7 @@ // btnConnect // this.btnConnect.Cursor = System.Windows.Forms.Cursors.Hand; - this.btnConnect.Location = new System.Drawing.Point(23, 122); + this.btnConnect.Location = new System.Drawing.Point(23, 153); this.btnConnect.Name = "btnConnect"; this.btnConnect.Size = new System.Drawing.Size(62, 23); this.btnConnect.TabIndex = 8; @@ -136,7 +140,7 @@ // btnSave // this.btnSave.Cursor = System.Windows.Forms.Cursors.Hand; - this.btnSave.Location = new System.Drawing.Point(108, 122); + this.btnSave.Location = new System.Drawing.Point(108, 153); this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(62, 23); this.btnSave.TabIndex = 9; @@ -146,20 +150,36 @@ // btnExit // this.btnExit.Cursor = System.Windows.Forms.Cursors.Hand; - this.btnExit.Location = new System.Drawing.Point(191, 122); + this.btnExit.Location = new System.Drawing.Point(191, 153); this.btnExit.Name = "btnExit"; this.btnExit.Size = new System.Drawing.Size(62, 23); this.btnExit.TabIndex = 10; this.btnExit.Text = "退出"; this.btnExit.Click += new System.EventHandler(this.btnExit_Click); // + // labelControl1 + // + this.labelControl1.Location = new System.Drawing.Point(12, 22); + this.labelControl1.Name = "labelControl1"; + this.labelControl1.Size = new System.Drawing.Size(60, 14); + this.labelControl1.TabIndex = 13; + this.labelControl1.Text = "数据库类型"; + // + // serverType + // + this.serverType.FormattingEnabled = true; + this.serverType.Location = new System.Drawing.Point(85, 19); + this.serverType.Name = "serverType"; + this.serverType.Size = new System.Drawing.Size(162, 22); + this.serverType.TabIndex = 14; + // // FrmConfig // this.Appearance.BackColor = System.Drawing.SystemColors.Control; this.Appearance.Options.UseBackColor = true; this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(285, 170); + this.ClientSize = new System.Drawing.Size(285, 190); this.Controls.Add(this.btnExit); this.Controls.Add(this.btnSave); this.Controls.Add(this.btnConnect); @@ -171,25 +191,4 @@ this.Name = "FrmConfig"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "数据库连接配置"; - this.Load += new System.EventHandler(this.FrmConfig_Load); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.Label label1; - private DevExpress.XtraEditors.LabelControl labelControl2; - private DevExpress.XtraEditors.SimpleButton btnConnect; - private System.Windows.Forms.TextBox txtDBName; - private System.Windows.Forms.TextBox txtServerName; - private DevExpress.XtraEditors.SimpleButton btnSave; - private DevExpress.XtraEditors.SimpleButton btnExit; - private System.Windows.Forms.TextBox txtServerNameInternal; - private System.Windows.Forms.RadioButton radioOutside; - private System.Windows.Forms.RadioButton radioWithin; - } -} \ No newline at end of file + this.Load += new Syste \ No newline at end of file diff --git a/插件库/Lskj.Main/FrmConfig.cs b/插件库/Lskj.Main/FrmConfig.cs index e303e1b..184e708 100644 --- a/插件库/Lskj.Main/FrmConfig.cs +++ b/插件库/Lskj.Main/FrmConfig.cs @@ -65,7 +65,10 @@ namespace Lskj.Main try { DBConfig.Instance.ReadConfig(true); - this.txtServerName.Text = DBConfig.Instance.ServerName; + serverType.Items.Add("SqlServer"); + serverType.Items.Add("达梦数据库"); + serverType.SelectedValue = DBConfig.Instance.ServerType; + this.txtServerName.Text = DBConfig.Instance.ServerName; this.txtServerNameInternal.Text = DBConfig.Instance.InternalNetworkAddress; this.txtDBName.Text = DBConfig.Instance.DataBase; @@ -169,11 +172,12 @@ namespace Lskj.Main /// if set to true [is save]. private void ConnectServer(bool isSave = false) { - + string dbName = this.txtDBName.Text.Trim(); string internalNetworkAddress = this.txtServerNameInternal.Text.Trim(); string externalNetworkAddress = this.txtServerName.Text.Trim(); bool internalNetwork = radioWithin.Checked; + string serverTypeValue = serverType.Text + ""; string serverName = internalNetwork ? internalNetworkAddress : externalNetworkAddress; if (string.IsNullOrWhiteSpace(serverName)) @@ -192,6 +196,7 @@ namespace Lskj.Main DBConfig.Instance.InternalNetworkAddress = internalNetworkAddress; DBConfig.Instance.IsInternalNetwork = internalNetwork; DBConfig.Instance.ExternalNetworkAddress = externalNetworkAddress; + DBConfig.Instance.ServerType = serverTypeValue; DBConfig.Instance.Connection = ""; DBConfig.Instance.dephiConnection = ""; @@ -200,4 +205,4 @@ namespace Lskj.Main { if (DBConfig.Instance.CreateConnection()) { - if (Del \ No newline at end of file + //if (DelphiHelpe \ No newline at end of file diff --git a/插件库/Lskj.Main/FrmConfigLocal.cs b/插件库/Lskj.Main/FrmConfigLocal.cs index e9849ee..e3b7bc8 100644 --- a/插件库/Lskj.Main/FrmConfigLocal.cs +++ b/插件库/Lskj.Main/FrmConfigLocal.cs @@ -251,4 +251,34 @@ namespace Lskj.Main DBConfig.Instance.WriteConfig("LocalLastIP", this.txtIP.Text); DBConfig.Instance.WriteConfig("LocalLastPort", this.txtPort.Text); DBConfig.Instance.WriteConfig("LocalLastPortName", this.txtZTName.Text); - t \ No newline at end of file + this.DialogResult = DialogResult.OK; + this.Close(); + } + else + { + MessageUtil.Show("请设置账套名!"); + } + } + else + { + MessageUtil.Show(ResourceKeys.ConnectSuccess); + } + } + else + { + MessageUtil.Show(ResourceKeys.ConnectFault); + } + } + else + { + MessageUtil.Show(ResourceKeys.ConnectFault); + } + //IniHelper.Write("SystemResources.ini", "FrmConfigFlag", "1"); + } + catch (Exception) + { + MessageUtil.Show(ResourceKeys.ConnectFault); + } + } + } +}