From 3eeb27cb31fe13a7949b38ac0e7048735ef1394c Mon Sep 17 00:00:00 2001 From: SHM Date: Wed, 16 Apr 2025 14:36:23 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=84=B1=ED=98=84=EB=AA=A8]=20Recovery=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SystemX.Product.CP.TRA/DB/DataBaseConn.cs | 32 ++---- .../SystemX.Product.CP.TRA/MainForm.cs | 5 +- .../Subs/ConnectForm.Designer.cs | 108 +++++++++++++----- .../Subs/ConnectForm.cs | 41 ++++++- .../SystemX.Product.CP.TRA.csproj | 4 + 5 files changed, 134 insertions(+), 56 deletions(-) diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DB/DataBaseConn.cs b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DB/DataBaseConn.cs index 2c9990f..3be7765 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DB/DataBaseConn.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DB/DataBaseConn.cs @@ -69,7 +69,7 @@ namespace DataBaseConnection.Control public static Dictionary GetLongTermConn2() { return connLongTerm2; - } + } public DatabaseConnControl() { @@ -220,13 +220,7 @@ namespace DataBaseConnection.Control public static void ConnectTestListDB(string strGetConnIPAddress, int nGetConnPort = CatalogConnPort) { try - { - //conn = new SqlConnection("Data Source=200.200.200.48,1433; Initial Catalog=LSU_Trimming_4th_ALIS; User ID=Alis; Password=kefico; MultipleActiveResultSets=True;"); - //Data Source = {IP},{Port}; Initial Catalog = {SCHEMA}; User ID = {ID}; Password = {PW}; MultipleActiveResultSets=True; - //conn = new SqlConnection("Data Source=DESKTOP-5UQ1Q22;Initial Catalog=LSU_Trimming_4th_ALIS;Integrated Security=True;"); - //conn = new SqlConnection("Data Source = 125.130.37.164,1433; Initial Catalog = LSU_Trimming_4th_ALIS; User ID = Alis; Password = kefico; MultipleActiveResultSets=True;"); - //conn = new SqlConnection("Data Source = 127.0.0.1; Initial Catalog = Smart_Inhibitor_1th_ALIS; User ID = Alis; Password = kefico;"); //Integrated Security = SSPI;"); - + { SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(); if (strGetConnIPAddress.Split(',').Length == 2) @@ -247,29 +241,17 @@ namespace DataBaseConnection.Control else builder.DataSource = strGetConnIPAddress + "," + nGetConnPort.ToString(); - SqlCommand SQLCmd = new SqlCommand("spGetDBList", connMain); - SQLCmd.CommandType = CommandType.StoredProcedure; + SqlCommand SQLCmd = new SqlCommand("select name from sys.databases with(nolock) where owner_sid != 0x01;", connMain); + SQLCmd.CommandType = CommandType.Text; DbDataReader dtReader = SQLCmd.ExecuteReader(); DataTable dtResult = new DataTable(); dtResult.Load(dtReader); List list = dtResult?.AsEnumerable()?.Select(x => x.ItemArray?.First()?.ToString())?.ToList(); if (list?.Count > 0) - { - //short term - var shortTermCatalogName = list.Find(x => x.ToLower().Contains("short") && x.ToLower().Contains("json")); - if (string.IsNullOrEmpty(shortTermCatalogName) == false) - { - ShortTermCatalogName = shortTermCatalogName; - } - - //long term - var longTermCatalogName = list.FindAll(x => x.ToLower().Contains("long") && x.ToLower().Contains("json")); - if (longTermCatalogName?.Count() > 0) - { - LongTermCatalogName?.Clear(); - LongTermCatalogName.AddRange(longTermCatalogName); - } + { + LongTermCatalogName?.Clear(); + LongTermCatalogName.AddRange(list); } dtReader.Close(); diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/MainForm.cs b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/MainForm.cs index b81d1ec..6e1b5f3 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/MainForm.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/MainForm.cs @@ -243,6 +243,9 @@ namespace SystemX.Product.CP.TRA { InitializeComponent(); + barCheckItemLongTerm.Checked = true; + barCheckItemLongTerm.Enabled = false; + ConnectInfoINICtrl CCtrl = new ConnectInfoINICtrl(); UserLookAndFeel.Default.SkinName = CCtrl.GetUserTheme(); //SystemX.Product.TRA.Properties.Settings.Default["ApplicationThemeName"].ToString(); @@ -371,7 +374,7 @@ namespace SystemX.Product.CP.TRA } else { - DatabaseConnControl.ConnectTestListDB(strConnIPAddressTL, nConnPortTL); + // DatabaseConnControl.ConnectTestListDB(strConnIPAddressTL, nConnPortTL); DBConnMain = DatabaseConnControl.GetMainConn(); } diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/Subs/ConnectForm.Designer.cs b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/Subs/ConnectForm.Designer.cs index 4de1d04..27cc999 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/Subs/ConnectForm.Designer.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/Subs/ConnectForm.Designer.cs @@ -40,6 +40,9 @@ namespace SystemX.Product.ALIS.UI.Subs this.panel4 = new System.Windows.Forms.Panel(); this.label2 = new System.Windows.Forms.Label(); this.panel5 = new System.Windows.Forms.Panel(); + this.btnRefresh = new System.Windows.Forms.Button(); + this.label5 = new System.Windows.Forms.Label(); + this.comboDbList = new System.Windows.Forms.ComboBox(); this.maskedTextBoxDT1IP = new DevExpress.XtraEditors.ComboBoxEdit(); this.panel6 = new System.Windows.Forms.Panel(); this.comboBoxOverviewModel1 = new System.Windows.Forms.ComboBox(); @@ -50,6 +53,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.comboBoxOverviewModel2 = new System.Windows.Forms.ComboBox(); this.checkBoxUseDT2 = new System.Windows.Forms.CheckBox(); this.label3 = new System.Windows.Forms.Label(); + this.lbError = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.panel3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.maskedTextBoxTLIP.Properties)).BeginInit(); @@ -75,7 +79,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.labelControl1.Dock = System.Windows.Forms.DockStyle.Top; this.labelControl1.Location = new System.Drawing.Point(0, 0); this.labelControl1.Name = "labelControl1"; - this.labelControl1.Size = new System.Drawing.Size(366, 36); + this.labelControl1.Size = new System.Drawing.Size(234, 24); this.labelControl1.TabIndex = 2; this.labelControl1.Text = "Input - Access information"; // @@ -84,7 +88,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.simpleButtonOK.Appearance.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.simpleButtonOK.Appearance.Options.UseFont = true; this.simpleButtonOK.Dock = System.Windows.Forms.DockStyle.Right; - this.simpleButtonOK.Location = new System.Drawing.Point(1071, 0); + this.simpleButtonOK.Location = new System.Drawing.Point(1025, 0); this.simpleButtonOK.Name = "simpleButtonOK"; this.simpleButtonOK.Size = new System.Drawing.Size(66, 64); this.simpleButtonOK.TabIndex = 4; @@ -94,12 +98,13 @@ namespace SystemX.Product.ALIS.UI.Subs // panel1 // this.panel1.BackColor = System.Drawing.Color.Transparent; + this.panel1.Controls.Add(this.lbError); this.panel1.Controls.Add(this.simpleButtonReset); this.panel1.Controls.Add(this.simpleButtonOK); - this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel1.Location = new System.Drawing.Point(0, 396); + this.panel1.Dock = System.Windows.Forms.DockStyle.Top; + this.panel1.Location = new System.Drawing.Point(0, 314); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1137, 64); + this.panel1.Size = new System.Drawing.Size(1091, 64); this.panel1.TabIndex = 5; // // simpleButtonReset @@ -118,9 +123,9 @@ namespace SystemX.Product.ALIS.UI.Subs // this.panel2.BackColor = System.Drawing.Color.Transparent; this.panel2.Dock = System.Windows.Forms.DockStyle.Top; - this.panel2.Location = new System.Drawing.Point(0, 36); + this.panel2.Location = new System.Drawing.Point(0, 24); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(1137, 3); + this.panel2.Size = new System.Drawing.Size(1091, 3); this.panel2.TabIndex = 6; // // panel3 @@ -129,9 +134,9 @@ namespace SystemX.Product.ALIS.UI.Subs this.panel3.Controls.Add(this.maskedTextBoxTLIP); this.panel3.Controls.Add(this.panel4); this.panel3.Dock = System.Windows.Forms.DockStyle.Top; - this.panel3.Location = new System.Drawing.Point(0, 39); + this.panel3.Location = new System.Drawing.Point(0, 27); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(1137, 108); + this.panel3.Size = new System.Drawing.Size(1091, 108); this.panel3.TabIndex = 8; // // maskedTextBoxTLIP @@ -148,7 +153,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.maskedTextBoxTLIP.Properties.Appearance.Options.UseForeColor = true; this.maskedTextBoxTLIP.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); - this.maskedTextBoxTLIP.Size = new System.Drawing.Size(1137, 28); + this.maskedTextBoxTLIP.Size = new System.Drawing.Size(1091, 22); this.maskedTextBoxTLIP.TabIndex = 8; this.maskedTextBoxTLIP.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.maskedTextBoxIP_PreviewKeyDown); // @@ -159,7 +164,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.panel4.Dock = System.Windows.Forms.DockStyle.Top; this.panel4.Location = new System.Drawing.Point(0, 0); this.panel4.Name = "panel4"; - this.panel4.Size = new System.Drawing.Size(1137, 65); + this.panel4.Size = new System.Drawing.Size(1091, 65); this.panel4.TabIndex = 7; // // label2 @@ -170,7 +175,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.label2.ForeColor = System.Drawing.Color.Black; this.label2.Location = new System.Drawing.Point(0, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(1137, 51); + this.label2.Size = new System.Drawing.Size(1091, 51); this.label2.TabIndex = 9; this.label2.Text = "TestList Server"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -178,14 +183,47 @@ namespace SystemX.Product.ALIS.UI.Subs // panel5 // this.panel5.BackColor = System.Drawing.Color.Transparent; + this.panel5.Controls.Add(this.btnRefresh); + this.panel5.Controls.Add(this.label5); + this.panel5.Controls.Add(this.comboDbList); this.panel5.Controls.Add(this.maskedTextBoxDT1IP); this.panel5.Controls.Add(this.panel6); this.panel5.Dock = System.Windows.Forms.DockStyle.Top; - this.panel5.Location = new System.Drawing.Point(0, 147); + this.panel5.Location = new System.Drawing.Point(0, 135); this.panel5.Name = "panel5"; - this.panel5.Size = new System.Drawing.Size(1137, 129); + this.panel5.Size = new System.Drawing.Size(1091, 179); this.panel5.TabIndex = 9; // + // btnRefresh + // + this.btnRefresh.ForeColor = System.Drawing.Color.Black; + this.btnRefresh.Location = new System.Drawing.Point(486, 126); + this.btnRefresh.Name = "btnRefresh"; + this.btnRefresh.Size = new System.Drawing.Size(98, 23); + this.btnRefresh.TabIndex = 11; + this.btnRefresh.Text = "Refresh"; + this.btnRefresh.UseVisualStyleBackColor = true; + this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click); + // + // label5 + // + this.label5.AutoSize = true; + this.label5.ForeColor = System.Drawing.Color.Black; + this.label5.Location = new System.Drawing.Point(12, 130); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(102, 15); + this.label5.TabIndex = 10; + this.label5.Text = "Recovery DataBase"; + // + // comboDbList + // + this.comboDbList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboDbList.FormattingEnabled = true; + this.comboDbList.Location = new System.Drawing.Point(129, 125); + this.comboDbList.Name = "comboDbList"; + this.comboDbList.Size = new System.Drawing.Size(351, 23); + this.comboDbList.TabIndex = 9; + // // maskedTextBoxDT1IP // this.maskedTextBoxDT1IP.Dock = System.Windows.Forms.DockStyle.Fill; @@ -200,7 +238,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.maskedTextBoxDT1IP.Properties.Appearance.Options.UseForeColor = true; this.maskedTextBoxDT1IP.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); - this.maskedTextBoxDT1IP.Size = new System.Drawing.Size(1137, 28); + this.maskedTextBoxDT1IP.Size = new System.Drawing.Size(1091, 22); this.maskedTextBoxDT1IP.TabIndex = 8; this.maskedTextBoxDT1IP.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.maskedTextBoxIP_PreviewKeyDown); // @@ -212,7 +250,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.panel6.Dock = System.Windows.Forms.DockStyle.Top; this.panel6.Location = new System.Drawing.Point(0, 0); this.panel6.Name = "panel6"; - this.panel6.Size = new System.Drawing.Size(1137, 85); + this.panel6.Size = new System.Drawing.Size(1091, 85); this.panel6.TabIndex = 7; // // comboBoxOverviewModel1 @@ -225,7 +263,7 @@ namespace SystemX.Product.ALIS.UI.Subs "P2"}); this.comboBoxOverviewModel1.Location = new System.Drawing.Point(280, 22); this.comboBoxOverviewModel1.Name = "comboBoxOverviewModel1"; - this.comboBoxOverviewModel1.Size = new System.Drawing.Size(106, 28); + this.comboBoxOverviewModel1.Size = new System.Drawing.Size(106, 23); this.comboBoxOverviewModel1.TabIndex = 10; this.comboBoxOverviewModel1.Visible = false; // @@ -237,7 +275,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.label1.ForeColor = System.Drawing.Color.Black; this.label1.Location = new System.Drawing.Point(0, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(1137, 70); + this.label1.Size = new System.Drawing.Size(1091, 70); this.label1.TabIndex = 9; this.label1.Text = "Log Server [1]"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -248,11 +286,12 @@ namespace SystemX.Product.ALIS.UI.Subs this.panel7.BackColor = System.Drawing.Color.Transparent; this.panel7.Controls.Add(this.maskedTextBoxDT2IP); this.panel7.Controls.Add(this.panel8); - this.panel7.Dock = System.Windows.Forms.DockStyle.Top; - this.panel7.Location = new System.Drawing.Point(0, 276); + this.panel7.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel7.Location = new System.Drawing.Point(0, 384); this.panel7.Name = "panel7"; - this.panel7.Size = new System.Drawing.Size(1137, 150); + this.panel7.Size = new System.Drawing.Size(1091, 14); this.panel7.TabIndex = 10; + this.panel7.Visible = false; // // maskedTextBoxDT2IP // @@ -268,7 +307,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.maskedTextBoxDT2IP.Properties.Appearance.Options.UseForeColor = true; this.maskedTextBoxDT2IP.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); - this.maskedTextBoxDT2IP.Size = new System.Drawing.Size(1137, 28); + this.maskedTextBoxDT2IP.Size = new System.Drawing.Size(1091, 22); this.maskedTextBoxDT2IP.TabIndex = 8; this.maskedTextBoxDT2IP.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.maskedTextBoxIP_PreviewKeyDown); // @@ -281,7 +320,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.panel8.Dock = System.Windows.Forms.DockStyle.Top; this.panel8.Location = new System.Drawing.Point(0, 0); this.panel8.Name = "panel8"; - this.panel8.Size = new System.Drawing.Size(1137, 83); + this.panel8.Size = new System.Drawing.Size(1091, 83); this.panel8.TabIndex = 7; // // comboBoxOverviewModel2 @@ -294,7 +333,7 @@ namespace SystemX.Product.ALIS.UI.Subs "P2"}); this.comboBoxOverviewModel2.Location = new System.Drawing.Point(280, 21); this.comboBoxOverviewModel2.Name = "comboBoxOverviewModel2"; - this.comboBoxOverviewModel2.Size = new System.Drawing.Size(106, 28); + this.comboBoxOverviewModel2.Size = new System.Drawing.Size(106, 23); this.comboBoxOverviewModel2.TabIndex = 13; this.comboBoxOverviewModel2.Visible = false; // @@ -305,7 +344,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.checkBoxUseDT2.ForeColor = System.Drawing.Color.Black; this.checkBoxUseDT2.Location = new System.Drawing.Point(43, 23); this.checkBoxUseDT2.Name = "checkBoxUseDT2"; - this.checkBoxUseDT2.Size = new System.Drawing.Size(63, 24); + this.checkBoxUseDT2.Size = new System.Drawing.Size(45, 19); this.checkBoxUseDT2.TabIndex = 12; this.checkBoxUseDT2.Text = "Use"; this.checkBoxUseDT2.UseVisualStyleBackColor = false; @@ -318,11 +357,19 @@ namespace SystemX.Product.ALIS.UI.Subs this.label3.ForeColor = System.Drawing.Color.Black; this.label3.Location = new System.Drawing.Point(0, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(1137, 69); + this.label3.Size = new System.Drawing.Size(1091, 69); this.label3.TabIndex = 9; this.label3.Text = "Log Server [2]"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.label3.DoubleClick += new System.EventHandler(this.label3_DoubleClick); + // + // lbError + // + this.lbError.ForeColor = System.Drawing.Color.Red; + this.lbError.Location = new System.Drawing.Point(693, 25); + this.lbError.Name = "lbError"; + this.lbError.Size = new System.Drawing.Size(317, 16); + this.lbError.TabIndex = 6; + this.lbError.Text = "lbError"; // // ConnectForm // @@ -332,7 +379,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackgroundImageLayoutStore = System.Windows.Forms.ImageLayout.Stretch; this.BackgroundImageStore = global::SystemX.Product.TRA.Properties.Resources.IpAddress; - this.ClientSize = new System.Drawing.Size(1137, 460); + this.ClientSize = new System.Drawing.Size(1091, 398); this.Controls.Add(this.panel1); this.Controls.Add(this.panel7); this.Controls.Add(this.panel5); @@ -354,6 +401,7 @@ namespace SystemX.Product.ALIS.UI.Subs ((System.ComponentModel.ISupportInitialize)(this.maskedTextBoxTLIP.Properties)).EndInit(); this.panel4.ResumeLayout(false); this.panel5.ResumeLayout(false); + this.panel5.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.maskedTextBoxDT1IP.Properties)).EndInit(); this.panel6.ResumeLayout(false); this.panel7.ResumeLayout(false); @@ -386,5 +434,9 @@ namespace SystemX.Product.ALIS.UI.Subs private System.Windows.Forms.CheckBox checkBoxUseDT2; private System.Windows.Forms.ComboBox comboBoxOverviewModel1; private System.Windows.Forms.ComboBox comboBoxOverviewModel2; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.ComboBox comboDbList; + private System.Windows.Forms.Button btnRefresh; + private System.Windows.Forms.Label lbError; } } \ No newline at end of file diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/Subs/ConnectForm.cs b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/Subs/ConnectForm.cs index 6dc6ce0..5844a14 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/Subs/ConnectForm.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/Subs/ConnectForm.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Net; using System.Reflection; using System.Text; +using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows.Forms; @@ -73,6 +74,7 @@ namespace SystemX.Product.ALIS.UI.Subs { InitializeComponent(); + lbError.Text = string.Empty; //this.MinimumSize = new Size(400, 250); //this.MaximumSize = new Size(400, 250); @@ -258,6 +260,24 @@ namespace SystemX.Product.ALIS.UI.Subs private void simpleButtonOK_Click(object sender, EventArgs e) { + checkBoxUseDT2.Checked = false; + + //cpxv2 ip 아님 + if (IsValidIPv4(maskedTextBoxTLIP.Text) == false) + { + lbError.Text = "TestList Server IP Invalied"; + return; + } + + //cpxv2 ip 아님 + if (string.IsNullOrEmpty(comboDbList.Text) == true) + { + lbError.Text = "No selected Recovery DataBase"; + return; + } + + DatabaseConnControl.LongTermCatalogName.RemoveAll(x=>x != comboDbList.Text); + bSelectUseDataServer2 = checkBoxUseDT2.Checked; // nOverviewModelC1 = comboBoxOverviewModel1.SelectedIndex; @@ -319,9 +339,26 @@ namespace SystemX.Product.ALIS.UI.Subs comboBoxOverviewModel1.Visible = !comboBoxOverviewModel1.Visible; } - private void label3_DoubleClick(object sender, EventArgs e) + private void btnRefresh_Click(object sender, EventArgs e) { - comboBoxOverviewModel2.Visible = !comboBoxOverviewModel2.Visible; + if (IsValidIPv4(maskedTextBoxDT1IP.Text) == false) + { + lbError.Text = "Invalid Log Server IP Address"; + return; + } + + lbError.Text = string.Empty; + DatabaseConnControl.ConnectTestListDB(maskedTextBoxDT1IP.Text); + var dbList = DatabaseConnControl.LongTermCatalogName; + + comboDbList.Items.Clear(); + comboDbList.Items.AddRange(dbList.ToArray()); + } + + private bool IsValidIPv4(string input) + { + string pattern = @"^((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)$"; + return Regex.IsMatch(input, pattern); } } } \ No newline at end of file diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/SystemX.Product.CP.TRA.csproj b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/SystemX.Product.CP.TRA.csproj index 3ae6648..e98e6f0 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/SystemX.Product.CP.TRA.csproj +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/SystemX.Product.CP.TRA.csproj @@ -165,6 +165,7 @@ ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll @@ -211,6 +212,7 @@ ..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll @@ -234,6 +236,8 @@ ..\..\Output.SystemX\SystemX.XEFCore.dll + +