SVN r1182
SVN-Revision: r1182
This commit is contained in:
Generated
+33
-34
@@ -40,11 +40,15 @@
|
|||||||
this.btnConnect = new DevExpress.XtraEditors.SimpleButton();
|
this.btnConnect = new DevExpress.XtraEditors.SimpleButton();
|
||||||
this.btnSave = new DevExpress.XtraEditors.SimpleButton();
|
this.btnSave = new DevExpress.XtraEditors.SimpleButton();
|
||||||
this.btnExit = 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.groupBox1.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// groupBox1
|
// groupBox1
|
||||||
//
|
//
|
||||||
|
this.groupBox1.Controls.Add(this.serverType);
|
||||||
|
this.groupBox1.Controls.Add(this.labelControl1);
|
||||||
this.groupBox1.Controls.Add(this.radioOutside);
|
this.groupBox1.Controls.Add(this.radioOutside);
|
||||||
this.groupBox1.Controls.Add(this.radioWithin);
|
this.groupBox1.Controls.Add(this.radioWithin);
|
||||||
this.groupBox1.Controls.Add(this.txtServerNameInternal);
|
this.groupBox1.Controls.Add(this.txtServerNameInternal);
|
||||||
@@ -52,16 +56,16 @@
|
|||||||
this.groupBox1.Controls.Add(this.txtServerName);
|
this.groupBox1.Controls.Add(this.txtServerName);
|
||||||
this.groupBox1.Controls.Add(this.labelControl2);
|
this.groupBox1.Controls.Add(this.labelControl2);
|
||||||
this.groupBox1.Controls.Add(this.label1);
|
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.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.TabIndex = 4;
|
||||||
this.groupBox1.TabStop = false;
|
this.groupBox1.TabStop = false;
|
||||||
//
|
//
|
||||||
// radioOutside
|
// radioOutside
|
||||||
//
|
//
|
||||||
this.radioOutside.AutoSize = true;
|
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.Name = "radioOutside";
|
||||||
this.radioOutside.Size = new System.Drawing.Size(73, 18);
|
this.radioOutside.Size = new System.Drawing.Size(73, 18);
|
||||||
this.radioOutside.TabIndex = 12;
|
this.radioOutside.TabIndex = 12;
|
||||||
@@ -72,7 +76,7 @@
|
|||||||
// radioWithin
|
// radioWithin
|
||||||
//
|
//
|
||||||
this.radioWithin.AutoSize = true;
|
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.Name = "radioWithin";
|
||||||
this.radioWithin.Size = new System.Drawing.Size(73, 18);
|
this.radioWithin.Size = new System.Drawing.Size(73, 18);
|
||||||
this.radioWithin.TabIndex = 11;
|
this.radioWithin.TabIndex = 11;
|
||||||
@@ -83,7 +87,7 @@
|
|||||||
// txtServerNameInternal
|
// txtServerNameInternal
|
||||||
//
|
//
|
||||||
this.txtServerNameInternal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
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.MaxLength = 50;
|
||||||
this.txtServerNameInternal.Name = "txtServerNameInternal";
|
this.txtServerNameInternal.Name = "txtServerNameInternal";
|
||||||
this.txtServerNameInternal.Size = new System.Drawing.Size(162, 22);
|
this.txtServerNameInternal.Size = new System.Drawing.Size(162, 22);
|
||||||
@@ -92,7 +96,7 @@
|
|||||||
// txtDBName
|
// txtDBName
|
||||||
//
|
//
|
||||||
this.txtDBName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
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.MaxLength = 50;
|
||||||
this.txtDBName.Name = "txtDBName";
|
this.txtDBName.Name = "txtDBName";
|
||||||
this.txtDBName.Size = new System.Drawing.Size(162, 22);
|
this.txtDBName.Size = new System.Drawing.Size(162, 22);
|
||||||
@@ -101,7 +105,7 @@
|
|||||||
// txtServerName
|
// txtServerName
|
||||||
//
|
//
|
||||||
this.txtServerName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
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.MaxLength = 50;
|
||||||
this.txtServerName.Name = "txtServerName";
|
this.txtServerName.Name = "txtServerName";
|
||||||
this.txtServerName.Size = new System.Drawing.Size(162, 22);
|
this.txtServerName.Size = new System.Drawing.Size(162, 22);
|
||||||
@@ -109,7 +113,7 @@
|
|||||||
//
|
//
|
||||||
// labelControl2
|
// 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.Name = "labelControl2";
|
||||||
this.labelControl2.Size = new System.Drawing.Size(60, 14);
|
this.labelControl2.Size = new System.Drawing.Size(60, 14);
|
||||||
this.labelControl2.TabIndex = 5;
|
this.labelControl2.TabIndex = 5;
|
||||||
@@ -126,7 +130,7 @@
|
|||||||
// btnConnect
|
// btnConnect
|
||||||
//
|
//
|
||||||
this.btnConnect.Cursor = System.Windows.Forms.Cursors.Hand;
|
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.Name = "btnConnect";
|
||||||
this.btnConnect.Size = new System.Drawing.Size(62, 23);
|
this.btnConnect.Size = new System.Drawing.Size(62, 23);
|
||||||
this.btnConnect.TabIndex = 8;
|
this.btnConnect.TabIndex = 8;
|
||||||
@@ -136,7 +140,7 @@
|
|||||||
// btnSave
|
// btnSave
|
||||||
//
|
//
|
||||||
this.btnSave.Cursor = System.Windows.Forms.Cursors.Hand;
|
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.Name = "btnSave";
|
||||||
this.btnSave.Size = new System.Drawing.Size(62, 23);
|
this.btnSave.Size = new System.Drawing.Size(62, 23);
|
||||||
this.btnSave.TabIndex = 9;
|
this.btnSave.TabIndex = 9;
|
||||||
@@ -146,20 +150,36 @@
|
|||||||
// btnExit
|
// btnExit
|
||||||
//
|
//
|
||||||
this.btnExit.Cursor = System.Windows.Forms.Cursors.Hand;
|
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.Name = "btnExit";
|
||||||
this.btnExit.Size = new System.Drawing.Size(62, 23);
|
this.btnExit.Size = new System.Drawing.Size(62, 23);
|
||||||
this.btnExit.TabIndex = 10;
|
this.btnExit.TabIndex = 10;
|
||||||
this.btnExit.Text = "退出";
|
this.btnExit.Text = "退出";
|
||||||
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
|
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
|
// FrmConfig
|
||||||
//
|
//
|
||||||
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||||
this.Appearance.Options.UseBackColor = true;
|
this.Appearance.Options.UseBackColor = true;
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
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.btnExit);
|
||||||
this.Controls.Add(this.btnSave);
|
this.Controls.Add(this.btnSave);
|
||||||
this.Controls.Add(this.btnConnect);
|
this.Controls.Add(this.btnConnect);
|
||||||
@@ -171,25 +191,4 @@
|
|||||||
this.Name = "FrmConfig";
|
this.Name = "FrmConfig";
|
||||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
this.Text = "数据库连接配置";
|
this.Text = "数据库连接配置";
|
||||||
this.Load += new System.EventHandler(this.FrmConfig_Load);
|
this.Load += new Syste
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -65,7 +65,10 @@ namespace Lskj.Main
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
DBConfig.Instance.ReadConfig(true);
|
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.txtServerNameInternal.Text = DBConfig.Instance.InternalNetworkAddress;
|
||||||
this.txtDBName.Text = DBConfig.Instance.DataBase;
|
this.txtDBName.Text = DBConfig.Instance.DataBase;
|
||||||
|
|
||||||
@@ -169,11 +172,12 @@ namespace Lskj.Main
|
|||||||
/// <param name="isSave">if set to <c>true</c> [is save].</param>
|
/// <param name="isSave">if set to <c>true</c> [is save].</param>
|
||||||
private void ConnectServer(bool isSave = false)
|
private void ConnectServer(bool isSave = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
string dbName = this.txtDBName.Text.Trim();
|
string dbName = this.txtDBName.Text.Trim();
|
||||||
string internalNetworkAddress = this.txtServerNameInternal.Text.Trim();
|
string internalNetworkAddress = this.txtServerNameInternal.Text.Trim();
|
||||||
string externalNetworkAddress = this.txtServerName.Text.Trim();
|
string externalNetworkAddress = this.txtServerName.Text.Trim();
|
||||||
bool internalNetwork = radioWithin.Checked;
|
bool internalNetwork = radioWithin.Checked;
|
||||||
|
string serverTypeValue = serverType.Text + "";
|
||||||
string serverName = internalNetwork ? internalNetworkAddress : externalNetworkAddress;
|
string serverName = internalNetwork ? internalNetworkAddress : externalNetworkAddress;
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(serverName))
|
if (string.IsNullOrWhiteSpace(serverName))
|
||||||
@@ -192,6 +196,7 @@ namespace Lskj.Main
|
|||||||
DBConfig.Instance.InternalNetworkAddress = internalNetworkAddress;
|
DBConfig.Instance.InternalNetworkAddress = internalNetworkAddress;
|
||||||
DBConfig.Instance.IsInternalNetwork = internalNetwork;
|
DBConfig.Instance.IsInternalNetwork = internalNetwork;
|
||||||
DBConfig.Instance.ExternalNetworkAddress = externalNetworkAddress;
|
DBConfig.Instance.ExternalNetworkAddress = externalNetworkAddress;
|
||||||
|
DBConfig.Instance.ServerType = serverTypeValue;
|
||||||
DBConfig.Instance.Connection = "";
|
DBConfig.Instance.Connection = "";
|
||||||
DBConfig.Instance.dephiConnection = "";
|
DBConfig.Instance.dephiConnection = "";
|
||||||
|
|
||||||
@@ -200,4 +205,4 @@ namespace Lskj.Main
|
|||||||
{
|
{
|
||||||
if (DBConfig.Instance.CreateConnection())
|
if (DBConfig.Instance.CreateConnection())
|
||||||
{
|
{
|
||||||
if (Del
|
//if (DelphiHelpe
|
||||||
@@ -251,4 +251,34 @@ namespace Lskj.Main
|
|||||||
DBConfig.Instance.WriteConfig("LocalLastIP", this.txtIP.Text);
|
DBConfig.Instance.WriteConfig("LocalLastIP", this.txtIP.Text);
|
||||||
DBConfig.Instance.WriteConfig("LocalLastPort", this.txtPort.Text);
|
DBConfig.Instance.WriteConfig("LocalLastPort", this.txtPort.Text);
|
||||||
DBConfig.Instance.WriteConfig("LocalLastPortName", this.txtZTName.Text);
|
DBConfig.Instance.WriteConfig("LocalLastPortName", this.txtZTName.Text);
|
||||||
t
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user