diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.RecoveryTool/Form1.Designer.cs b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.RecoveryTool/Form1.Designer.cs index 9eb1899..bd89d94 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.RecoveryTool/Form1.Designer.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.RecoveryTool/Form1.Designer.cs @@ -29,27 +29,29 @@ private void InitializeComponent() { this.panel1 = new System.Windows.Forms.Panel(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.btnSelectDb = new System.Windows.Forms.Button(); - this.textMdf = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.textLdf = new System.Windows.Forms.TextBox(); - this.ledMdf = new System.Windows.Forms.Panel(); - this.ledLdf = new System.Windows.Forms.Panel(); - this.btnAttach = new System.Windows.Forms.Button(); - this.lbAttachResult = new System.Windows.Forms.Label(); this.gridDB = new System.Windows.Forms.DataGridView(); this.colIndex = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colDb = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colRemove = new System.Windows.Forms.DataGridViewButtonColumn(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.textRecoveryName = new System.Windows.Forms.TextBox(); + this.lbAttachResult = new System.Windows.Forms.Label(); + this.btnAttach = new System.Windows.Forms.Button(); + this.ledLdf = new System.Windows.Forms.Panel(); + this.ledMdf = new System.Windows.Forms.Panel(); + this.label2 = new System.Windows.Forms.Label(); + this.textLdf = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.textMdf = new System.Windows.Forms.TextBox(); + this.btnSelectDb = new System.Windows.Forms.Button(); + this.btnRefresh = new System.Windows.Forms.Button(); this.panel1.SuspendLayout(); - this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gridDB)).BeginInit(); + this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // panel1 @@ -62,28 +64,9 @@ this.panel1.Size = new System.Drawing.Size(651, 547); this.panel1.TabIndex = 0; // - // groupBox1 - // - this.groupBox1.Controls.Add(this.label3); - this.groupBox1.Controls.Add(this.textRecoveryName); - this.groupBox1.Controls.Add(this.lbAttachResult); - this.groupBox1.Controls.Add(this.btnAttach); - this.groupBox1.Controls.Add(this.ledLdf); - this.groupBox1.Controls.Add(this.ledMdf); - this.groupBox1.Controls.Add(this.label2); - this.groupBox1.Controls.Add(this.textLdf); - this.groupBox1.Controls.Add(this.label1); - this.groupBox1.Controls.Add(this.textMdf); - this.groupBox1.Controls.Add(this.btnSelectDb); - this.groupBox1.Location = new System.Drawing.Point(12, 12); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(627, 163); - this.groupBox1.TabIndex = 0; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Attach"; - // // groupBox2 // + this.groupBox2.Controls.Add(this.btnRefresh); this.groupBox2.Controls.Add(this.gridDB); this.groupBox2.Location = new System.Drawing.Point(12, 181); this.groupBox2.Name = "groupBox2"; @@ -92,82 +75,6 @@ this.groupBox2.TabStop = false; this.groupBox2.Text = "Management"; // - // btnSelectDb - // - this.btnSelectDb.Location = new System.Drawing.Point(17, 25); - this.btnSelectDb.Name = "btnSelectDb"; - this.btnSelectDb.Size = new System.Drawing.Size(122, 23); - this.btnSelectDb.TabIndex = 0; - this.btnSelectDb.Text = "Select DB"; - this.btnSelectDb.UseVisualStyleBackColor = true; - this.btnSelectDb.Click += new System.EventHandler(this.btnSelectDb_Click); - // - // textMdf - // - this.textMdf.Location = new System.Drawing.Point(195, 24); - this.textMdf.Name = "textMdf"; - this.textMdf.Size = new System.Drawing.Size(379, 21); - this.textMdf.TabIndex = 1; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(152, 30); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(31, 12); - this.label1.TabIndex = 2; - this.label1.Text = "MDF"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(152, 57); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(27, 12); - this.label2.TabIndex = 4; - this.label2.Text = "LDF"; - // - // textLdf - // - this.textLdf.Location = new System.Drawing.Point(195, 51); - this.textLdf.Name = "textLdf"; - this.textLdf.Size = new System.Drawing.Size(379, 21); - this.textLdf.TabIndex = 3; - // - // ledMdf - // - this.ledMdf.BackColor = System.Drawing.Color.White; - this.ledMdf.Location = new System.Drawing.Point(580, 25); - this.ledMdf.Name = "ledMdf"; - this.ledMdf.Size = new System.Drawing.Size(41, 21); - this.ledMdf.TabIndex = 5; - // - // ledLdf - // - this.ledLdf.BackColor = System.Drawing.Color.White; - this.ledLdf.Location = new System.Drawing.Point(580, 52); - this.ledLdf.Name = "ledLdf"; - this.ledLdf.Size = new System.Drawing.Size(41, 21); - this.ledLdf.TabIndex = 6; - // - // btnAttach - // - this.btnAttach.Location = new System.Drawing.Point(154, 104); - this.btnAttach.Name = "btnAttach"; - this.btnAttach.Size = new System.Drawing.Size(467, 23); - this.btnAttach.TabIndex = 7; - this.btnAttach.Text = "Attach to SqlServer"; - this.btnAttach.UseVisualStyleBackColor = true; - this.btnAttach.Click += new System.EventHandler(this.btnAttach_Click); - // - // lbAttachResult - // - this.lbAttachResult.Location = new System.Drawing.Point(152, 133); - this.lbAttachResult.Name = "lbAttachResult"; - this.lbAttachResult.Size = new System.Drawing.Size(469, 22); - this.lbAttachResult.TabIndex = 8; - this.lbAttachResult.Text = "result"; - // // gridDB // this.gridDB.AllowUserToAddRows = false; @@ -178,10 +85,10 @@ this.colIndex, this.colDb, this.colRemove}); - this.gridDB.Location = new System.Drawing.Point(17, 34); + this.gridDB.Location = new System.Drawing.Point(17, 42); this.gridDB.Name = "gridDB"; this.gridDB.RowTemplate.Height = 23; - this.gridDB.Size = new System.Drawing.Size(590, 306); + this.gridDB.Size = new System.Drawing.Size(590, 298); this.gridDB.TabIndex = 0; this.gridDB.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.gridDB_CellContentClick); // @@ -208,6 +115,37 @@ this.colRemove.Name = "colRemove"; this.colRemove.ReadOnly = true; // + // groupBox1 + // + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.textRecoveryName); + this.groupBox1.Controls.Add(this.lbAttachResult); + this.groupBox1.Controls.Add(this.btnAttach); + this.groupBox1.Controls.Add(this.ledLdf); + this.groupBox1.Controls.Add(this.ledMdf); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.textLdf); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.textMdf); + this.groupBox1.Controls.Add(this.btnSelectDb); + this.groupBox1.Location = new System.Drawing.Point(12, 12); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(627, 163); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Attach"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.ForeColor = System.Drawing.Color.DodgerBlue; + this.label4.Location = new System.Drawing.Point(543, 84); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(64, 12); + this.label4.TabIndex = 11; + this.label4.Text = "_Recovery"; + // // label3 // this.label3.AutoSize = true; @@ -221,9 +159,95 @@ // this.textRecoveryName.Location = new System.Drawing.Point(256, 78); this.textRecoveryName.Name = "textRecoveryName"; - this.textRecoveryName.Size = new System.Drawing.Size(318, 21); + this.textRecoveryName.Size = new System.Drawing.Size(286, 21); this.textRecoveryName.TabIndex = 9; // + // lbAttachResult + // + this.lbAttachResult.Location = new System.Drawing.Point(152, 133); + this.lbAttachResult.Name = "lbAttachResult"; + this.lbAttachResult.Size = new System.Drawing.Size(469, 22); + this.lbAttachResult.TabIndex = 8; + this.lbAttachResult.Text = "result"; + // + // btnAttach + // + this.btnAttach.Location = new System.Drawing.Point(154, 104); + this.btnAttach.Name = "btnAttach"; + this.btnAttach.Size = new System.Drawing.Size(467, 23); + this.btnAttach.TabIndex = 7; + this.btnAttach.Text = "Attach to SqlServer"; + this.btnAttach.UseVisualStyleBackColor = true; + this.btnAttach.Click += new System.EventHandler(this.btnAttach_Click); + // + // ledLdf + // + this.ledLdf.BackColor = System.Drawing.Color.White; + this.ledLdf.Location = new System.Drawing.Point(580, 52); + this.ledLdf.Name = "ledLdf"; + this.ledLdf.Size = new System.Drawing.Size(41, 21); + this.ledLdf.TabIndex = 6; + // + // ledMdf + // + this.ledMdf.BackColor = System.Drawing.Color.White; + this.ledMdf.Location = new System.Drawing.Point(580, 25); + this.ledMdf.Name = "ledMdf"; + this.ledMdf.Size = new System.Drawing.Size(41, 21); + this.ledMdf.TabIndex = 5; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(152, 57); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(27, 12); + this.label2.TabIndex = 4; + this.label2.Text = "LDF"; + // + // textLdf + // + this.textLdf.Location = new System.Drawing.Point(195, 51); + this.textLdf.Name = "textLdf"; + this.textLdf.Size = new System.Drawing.Size(379, 21); + this.textLdf.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(152, 30); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(31, 12); + this.label1.TabIndex = 2; + this.label1.Text = "MDF"; + // + // textMdf + // + this.textMdf.Location = new System.Drawing.Point(195, 24); + this.textMdf.Name = "textMdf"; + this.textMdf.Size = new System.Drawing.Size(379, 21); + this.textMdf.TabIndex = 1; + // + // btnSelectDb + // + this.btnSelectDb.Location = new System.Drawing.Point(17, 25); + this.btnSelectDb.Name = "btnSelectDb"; + this.btnSelectDb.Size = new System.Drawing.Size(122, 23); + this.btnSelectDb.TabIndex = 0; + this.btnSelectDb.Text = "Select DB"; + this.btnSelectDb.UseVisualStyleBackColor = true; + this.btnSelectDb.Click += new System.EventHandler(this.btnSelectDb_Click); + // + // btnRefresh + // + this.btnRefresh.Location = new System.Drawing.Point(485, 13); + this.btnRefresh.Name = "btnRefresh"; + this.btnRefresh.Size = new System.Drawing.Size(122, 23); + this.btnRefresh.TabIndex = 1; + this.btnRefresh.Text = "Refresh"; + this.btnRefresh.UseVisualStyleBackColor = true; + this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); @@ -233,10 +257,10 @@ this.Name = "Form1"; this.Text = "DB Management Tool"; this.panel1.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.gridDB)).EndInit(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); this.ResumeLayout(false); } @@ -261,6 +285,8 @@ private System.Windows.Forms.DataGridViewButtonColumn colRemove; private System.Windows.Forms.Label label3; private System.Windows.Forms.TextBox textRecoveryName; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Button btnRefresh; } } diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.RecoveryTool/Form1.cs b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.RecoveryTool/Form1.cs index 3b1fb72..b6a784d 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.RecoveryTool/Form1.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.RecoveryTool/Form1.cs @@ -50,54 +50,65 @@ namespace SystemX.Product.CP.RecoveryTool } textMdf.Text = mdfFile; //mdf textLdf.Text = ldfFile; //ldf - } + textRecoveryName.Text = Path.GetFileNameWithoutExtension(textMdf.Text); + } } private void btnAttach_Click(object sender, EventArgs e) { string error = "success"; - if (File.Exists(mdfFile) == true) - ledMdf.BackColor = Color.Lime; - else - { - ledMdf.BackColor = Color.Red; - error = "Invalid FIle"; - } + DialogResult result = MessageBox.Show( + $"Attach DB Name: '{textRecoveryName.Text}_Recovery' 연결 하시겠습니까?", // 메시지 내용 + "Attach DB", // 타이틀 + MessageBoxButtons.YesNo, // 버튼 옵션 + MessageBoxIcon.Question // 아이콘 (선택 사항) + ); - if (File.Exists(ldfFile) == true) - ledLdf.BackColor = Color.Lime; - else + if(result == DialogResult.Yes) { - ledLdf.BackColor = Color.Red; - error = "Invalid FIle"; - } - - recoveryName = textRecoveryName.Text; - if (string.IsNullOrEmpty(recoveryName) == false) - ledLdf.BackColor = Color.Lime; - else - { - ledLdf.BackColor = Color.Red; - error = "Invalid RecoveryName"; - } - - lbAttachResult.Text = error; - if (error == "success") - { - string attachError = Attach(mdfFile, ldfFile, recoveryName); - if (string.IsNullOrEmpty(attachError) == false) + if (File.Exists(mdfFile) == true) + ledMdf.BackColor = Color.Lime; + else { - lbAttachResult.ForeColor = Color.Red; - lbAttachResult.Text = attachError; + ledMdf.BackColor = Color.Red; + error = "Invalid Mdf File"; + } + + if (File.Exists(ldfFile) == true) + ledLdf.BackColor = Color.Lime; + else + { + ledLdf.BackColor = Color.Red; + error = "Invalid Ldf File"; + } + + recoveryName = textRecoveryName.Text; + if (string.IsNullOrEmpty(recoveryName) == false) + ledLdf.BackColor = Color.Lime; + else + { + ledLdf.BackColor = Color.Red; + error = "Invalid RecoveryName"; + } + + lbAttachResult.Text = error; + if (error == "success") + { + string attachError = Attach(mdfFile, ldfFile, recoveryName); + if (string.IsNullOrEmpty(attachError) == false) + { + lbAttachResult.ForeColor = Color.Red; + lbAttachResult.Text = attachError; + } + else + lbAttachResult.ForeColor = Color.Lime; } else - lbAttachResult.ForeColor = Color.Lime; - } - else - lbAttachResult.ForeColor = Color.Red; - - SelectDBList(); + lbAttachResult.ForeColor = Color.Red; + + SelectDBList(); + } } private string Attach(string mdfFile, string ldfFile, string attachName) @@ -105,7 +116,7 @@ namespace SystemX.Product.CP.RecoveryTool string error = string.Empty; // 프로세스 설정 - string command = $" -S localhost -U alis -P Kefico!@34 -Q \"CREATE DATABASE {attachName} ON (FILENAME = '{mdfFile}'), (FILENAME = '{ldfFile}') FOR ATTACH;\""; + string command = $" -S localhost -U alis -P Kefico!@34 -Q \"CREATE DATABASE {attachName}_Recovery ON (FILENAME = '{mdfFile}'), (FILENAME = '{ldfFile}') FOR ATTACH;\""; Console.WriteLine(command); ProcessStartInfo startInfo = new ProcessStartInfo { @@ -182,7 +193,7 @@ namespace SystemX.Product.CP.RecoveryTool var connMain = new SqlConnection("server=127.0.0.1,1433;uid=alis;password=Kefico!@34;"); connMain.Open(); - SqlCommand SQLCmd = new SqlCommand("select name from sys.databases with(nolock) where owner_sid != 0x01;", connMain); + SqlCommand SQLCmd = new SqlCommand("select name from sys.databases with(nolock) where owner_sid != 0x01 and name like '%Recovery%';", connMain); SQLCmd.CommandType = CommandType.Text; DbDataReader dtReader = SQLCmd.ExecuteReader(); @@ -203,9 +214,25 @@ namespace SystemX.Product.CP.RecoveryTool if (e.ColumnIndex == 2) { var dbName = gridDB.Rows[e.RowIndex].Cells[1].Value.ToString(); - Detach(dbName); - SelectDBList(); + + DialogResult result = MessageBox.Show( + $"Attach DB Name: '{dbName}' 연결을 삭제 하시겠습니까?", // 메시지 내용 + "Detach DB", // 타이틀 + MessageBoxButtons.YesNo, // 버튼 옵션 + MessageBoxIcon.Question // 아이콘 (선택 사항) + ); + + if(result == DialogResult.Yes) + { + Detach(dbName); + SelectDBList(); + } } } + + private void btnRefresh_Click(object sender, EventArgs e) + { + SelectDBList(); + } } } diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.RecoveryTool/SystemX.Product.CP.RecoveryTool.csproj b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.RecoveryTool/SystemX.Product.CP.RecoveryTool.csproj index 4d4f4a8..e75e494 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.RecoveryTool/SystemX.Product.CP.RecoveryTool.csproj +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.RecoveryTool/SystemX.Product.CP.RecoveryTool.csproj @@ -5,7 +5,7 @@ Debug AnyCPU {287E64B3-C49B-4270-9555-3A254A14FFED} - Exe + WinExe SystemX.Product.CP.RecoveryTool SystemX.Product.CP.RecoveryTool v4.8 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 3be7765..e337dd9 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 @@ -25,6 +25,9 @@ namespace DataBaseConnection.Control public static string LongTermCatalogName = "CPXLog";*/ public static string MainCatalogName = "CPXV2"; + public static string MainDBIP = ""; + public static string LogDBIP = ""; + public static string ShortTermCatalogName = ""; public static List LongTermCatalogName = new List { "" } ; public static string SelectLongTermCatalogNameCon1 = string.Empty; @@ -123,7 +126,8 @@ namespace DataBaseConnection.Control { try { - connMain = new SqlConnection($"Data Source=localhost; Initial Catalog={MainCatalogName}; Integrated Security = SSPI; MultipleActiveResultSets=True;"); + var connectionStr = $"Server={MainDBIP}; Database={MainCatalogName}; UID={CatalogConnUID}; Password={CatalogConnPW}; MultipleActiveResultSets=True;"; + connMain = new SqlConnection($"{connectionStr}"); connMain.Open(); SqlCommand SQLCmd = new SqlCommand("spGetDBList", connMain); @@ -167,12 +171,13 @@ namespace DataBaseConnection.Control { SqlConnection connecction; - connShortTerm1 = new SqlConnection($"Data Source=localhost; Initial Catalog={ShortTermCatalogName}; Integrated Security = SSPI; MultipleActiveResultSets=True;"); // MultipleActiveResultSets=True;"); - connShortTerm1.Open(); + //connShortTerm1 = new SqlConnection($"Data Source=localhost; Initial Catalog={ShortTermCatalogName}; Integrated Security = SSPI; MultipleActiveResultSets=True;"); // MultipleActiveResultSets=True;"); + //connShortTerm1.Open(); foreach(var catalog in LongTermCatalogName) { - connLongTerm1.Add(catalog, new SqlConnection($"Data Source=localhost; Initial Catalog={catalog}; Integrated Security = SSPI; MultipleActiveResultSets=True;")); // MultipleActiveResultSets=True;"); + var connectionStr = $"Server={LogDBIP}; Database={catalog}; UID={CatalogConnUID}; Password={CatalogConnPW}; MultipleActiveResultSets=True;"; + connLongTerm1.Add(catalog, new SqlConnection($"{connectionStr}")); // MultipleActiveResultSets=True;"); if (connLongTerm1.TryGetValue(catalog, out connecction) == true) { @@ -230,7 +235,7 @@ namespace DataBaseConnection.Control builder.UserID = "Alis"; builder.Password = "Kefico!@34"; - builder.InitialCatalog = MainCatalogName; + builder.InitialCatalog = "master"; builder.MultipleActiveResultSets = true; connMain = new SqlConnection(builder.ConnectionString); diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMDetailOverview.cs b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMDetailOverview.cs index 52b0b5b..4474c43 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMDetailOverview.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMDetailOverview.cs @@ -103,7 +103,7 @@ namespace SystemX.Product.TRA.DataManager { if (SelectView == eSelectDataView.DataDocumentViewC1) { - LongTermDBConn = GetDBController.GetLongTermConn1().Where(x => x.Key.Contains(data.StartTime.Year.ToString()))?.FirstOrDefault().Value; + LongTermDBConn = GetDBController.GetLongTermConn1().FirstOrDefault().Value; if (LongTermDBConn == null) { LongTermDBConn = GetDBController.GetLongTermConn1().FirstOrDefault().Value; @@ -111,7 +111,7 @@ namespace SystemX.Product.TRA.DataManager } else if (SelectView == eSelectDataView.DataDocumentViewC2) { - LongTermDBConn = GetDBController.GetLongTermConn2().Where(x => x.Key.Contains(data.StartTime.Year.ToString()))?.FirstOrDefault().Value; + LongTermDBConn = GetDBController.GetLongTermConn2().FirstOrDefault().Value; if (LongTermDBConn == null) { LongTermDBConn = GetDBController.GetLongTermConn2().FirstOrDefault().Value; @@ -194,16 +194,16 @@ namespace SystemX.Product.TRA.DataManager switch (GetSelectInfo) { case eOverviewModelNameInfo.L: - strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; - strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; + strQuery += $"LEFT JOIN [{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; + strQuery += $"LEFT JOIN [{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; break; case eOverviewModelNameInfo.P1: - strQuery += $"LEFT JOIN [P1].[CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; - strQuery += $"LEFT JOIN [P1].[CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; + strQuery += $"LEFT JOIN [P1].[{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; + strQuery += $"LEFT JOIN [P1].[{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; break; case eOverviewModelNameInfo.P2: - strQuery += $"LEFT JOIN [P2].[CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; - strQuery += $"LEFT JOIN [P2].[CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; + strQuery += $"LEFT JOIN [P2].[{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; + strQuery += $"LEFT JOIN [P2].[{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; break; } /* @@ -325,16 +325,16 @@ namespace SystemX.Product.TRA.DataManager switch (GetSelectInfo) { case eOverviewModelNameInfo.L: - strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; - strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; + strQuery += $"LEFT JOIN [{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; + strQuery += $"LEFT JOIN [{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; break; case eOverviewModelNameInfo.P1: - strQuery += $"LEFT JOIN [P1].[CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; - strQuery += $"LEFT JOIN [P1].[CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; + strQuery += $"LEFT JOIN [P1].[{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; + strQuery += $"LEFT JOIN [P1].[{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; break; case eOverviewModelNameInfo.P2: - strQuery += $"LEFT JOIN [P2].[CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; - strQuery += $"LEFT JOIN [P2].[CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; + strQuery += $"LEFT JOIN [P2].[{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; + strQuery += $"LEFT JOIN [P2].[{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; break; } diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMOverview.cs b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMOverview.cs index 1dd7fd2..b049c06 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMOverview.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMOverview.cs @@ -116,7 +116,7 @@ namespace SystemX.Product.TRA.DataManager { if (SelectView == eSelectDataView.DataDocumentViewC1) { - LongTermDBConn = GetDBController.GetLongTermConn1().Where(x => x.Key.Contains(dtStart.Year.ToString()))?.FirstOrDefault().Value; + LongTermDBConn = GetDBController.GetLongTermConn1().FirstOrDefault().Value; if(LongTermDBConn == null) { LongTermDBConn = GetDBController.GetLongTermConn1().FirstOrDefault().Value; @@ -225,16 +225,16 @@ namespace SystemX.Product.TRA.DataManager switch(GetSelectInfo) { case eOverviewModelNameInfo.L: - strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; - strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; + strQuery += $"LEFT JOIN [{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; + strQuery += $"LEFT JOIN [{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; break; case eOverviewModelNameInfo.P1: - strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; - strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; + strQuery += $"LEFT JOIN [{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; + strQuery += $"LEFT JOIN [{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; break; case eOverviewModelNameInfo.P2: - strQuery += $"LEFT JOIN [P2].[CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; - strQuery += $"LEFT JOIN [P2].[CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; + strQuery += $"LEFT JOIN [P2].[{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; + strQuery += $"LEFT JOIN [P2].[{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; break; } /* diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMStepTrend.cs b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMStepTrend.cs index c1d19b8..17591a1 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMStepTrend.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMStepTrend.cs @@ -38,14 +38,14 @@ namespace SystemX.Product.TRA.DataManager TrendSelectView = eSelectDataView.DataDocumentViewC1; ShortTermDBConn = getDBController.GetShortTermConn1(); - LongTermDBConn = getDBController.GetLongTermConn1().Where(x=>x.Key.Contains(dtStart.Year.ToString())).First().Value; + LongTermDBConn = getDBController.GetLongTermConn1().First().Value; } else if (SelectView == eSelectDataView.DataDocumentViewC2) { TrendSelectView = eSelectDataView.DataDocumentViewC2; ShortTermDBConn = getDBController.GetShortTermConn2(); - LongTermDBConn = getDBController.GetLongTermConn2().Where(x => x.Key.Contains(dtStart.Year.ToString())).First().Value; + LongTermDBConn = getDBController.GetLongTermConn2().First().Value; } } @@ -56,14 +56,14 @@ namespace SystemX.Product.TRA.DataManager TrendSelectView = eSelectDataView.DataDocumentViewC1; ShortTermDBConn = GetDBController.GetShortTermConn1(); - LongTermDBConn = GetDBController.GetLongTermConn1().Where(x => x.Key.Contains(dtTest.Year.ToString())).First().Value; + LongTermDBConn = GetDBController.GetLongTermConn1().First().Value; } else if (TrendSelectView == eSelectDataView.DataDocumentViewC2) { TrendSelectView = eSelectDataView.DataDocumentViewC2; ShortTermDBConn = GetDBController.GetShortTermConn2(); - LongTermDBConn = GetDBController.GetLongTermConn2().Where(x => x.Key.Contains(dtTest.Year.ToString())).First().Value; + LongTermDBConn = GetDBController.GetLongTermConn2().First().Value; } DataTable dtResult = new DataTable(); diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestDetail.cs b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestDetail.cs index d311004..4098cd0 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestDetail.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestDetail.cs @@ -95,7 +95,7 @@ namespace SystemX.Product.TRA.DataManager NgHistorySelectView = eSelectDataView.DataDocumentViewC1; ShortTermDBConn = getDBController.GetShortTermConn1(); - LongTermDBConn = getDBController.GetLongTermConn1().Where(x=>x.Key.Contains(dtStart.Year.ToString())).First().Value; + LongTermDBConn = getDBController.GetLongTermConn1().First().Value; } else if (SelectView == eSelectDataView.DataDocumentViewC2) { @@ -234,13 +234,13 @@ namespace SystemX.Product.TRA.DataManager { ShortTermDBConn = DBControllers.GetShortTermConn1(); - LongTermDBConn = DBControllers.GetLongTermConn1().Where(x => x.Key.Contains(data.StartTime.Year.ToString())).First().Value; + LongTermDBConn = DBControllers.GetLongTermConn1().First().Value; } else if (NgHistorySelectView == eSelectDataView.DataDocumentViewC2) { ShortTermDBConn = DBControllers.GetShortTermConn2(); - LongTermDBConn = DBControllers.GetLongTermConn2().Where(x => x.Key.Contains(data.StartTime.Year.ToString())).First().Value; + LongTermDBConn = DBControllers.GetLongTermConn2().First().Value; } DataTable dtResult = new DataTable(); diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestHistory.cs b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestHistory.cs index 1db7348..3e8f973 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestHistory.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestHistory.cs @@ -74,7 +74,7 @@ namespace SystemX.Product.TRA.DataManager { if (SelectView == eSelectDataView.DataDocumentViewC1) { - LongTermDBConn = GetDBController.GetLongTermConn1().Where(x => x.Key.Contains(data.StartTime.Year.ToString()))?.FirstOrDefault().Value; + LongTermDBConn = GetDBController.GetLongTermConn1().FirstOrDefault().Value; if (LongTermDBConn == null) { LongTermDBConn = GetDBController.GetLongTermConn1().FirstOrDefault().Value; @@ -82,7 +82,7 @@ namespace SystemX.Product.TRA.DataManager } else if (SelectView == eSelectDataView.DataDocumentViewC2) { - LongTermDBConn = GetDBController.GetLongTermConn2().Where(x => x.Key.Contains(data.StartTime.Year.ToString()))?.FirstOrDefault().Value; + LongTermDBConn = GetDBController.GetLongTermConn2().FirstOrDefault().Value; if (LongTermDBConn == null) { LongTermDBConn = GetDBController.GetLongTermConn2().FirstOrDefault().Value; diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestNgHistory.cs b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestNgHistory.cs index 28cddd8..7a086bb 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestNgHistory.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestNgHistory.cs @@ -63,14 +63,14 @@ namespace SystemX.Product.TRA.DataManager NgHistorySelectView = eSelectDataView.DataDocumentViewC1; ShortTermDBConn = getDBController.GetShortTermConn1(); - LongTermDBConn = getDBController.GetLongTermConn1().Where(x=>x.Key.Contains(dtStart.Year.ToString())).First().Value; + LongTermDBConn = getDBController.GetLongTermConn1().First().Value; } else if (SelectView == eSelectDataView.DataDocumentViewC2) { NgHistorySelectView = eSelectDataView.DataDocumentViewC2; ShortTermDBConn = getDBController.GetShortTermConn2(); - LongTermDBConn = getDBController.GetLongTermConn2().Where(x => x.Key.Contains(dtStart.Year.ToString())).First().Value; + LongTermDBConn = getDBController.GetLongTermConn2().First().Value; } } @@ -156,13 +156,13 @@ namespace SystemX.Product.TRA.DataManager { ShortTermDBConn = DBControllers.GetShortTermConn1(); - LongTermDBConn = DBControllers.GetLongTermConn1().Where(x => x.Key.Contains(data.SearchRangeStart.Year.ToString())).First().Value; + LongTermDBConn = DBControllers.GetLongTermConn1().First().Value; } else if (NgHistorySelectView == eSelectDataView.DataDocumentViewC2) { ShortTermDBConn = DBControllers.GetShortTermConn2(); - LongTermDBConn = DBControllers.GetLongTermConn2().Where(x => x.Key.Contains(data.SearchRangeStart.Year.ToString())).First().Value; + LongTermDBConn = DBControllers.GetLongTermConn2().First().Value; } DataTable dtResult = new DataTable(); diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestSummary.cs b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestSummary.cs index 018c650..03b914a 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestSummary.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/DataManager/DMTestSummary.cs @@ -107,14 +107,14 @@ namespace SystemX.Product.TRA.DataManager TestSummarySelectView = eSelectDataView.DataDocumentViewC1; ShortTermDBConn = getDBController.GetShortTermConn1(); - LongTermDBConn = getDBController.GetLongTermConn1().Where(x=>x.Key.Contains(dtStart.Year.ToString())).First().Value; + LongTermDBConn = getDBController.GetLongTermConn1().First().Value; } else if (SelectView == eSelectDataView.DataDocumentViewC2) { TestSummarySelectView = eSelectDataView.DataDocumentViewC2; ShortTermDBConn = getDBController.GetShortTermConn2(); - LongTermDBConn = getDBController.GetLongTermConn2().Where(x => x.Key.Contains(dtStart.Year.ToString())).First().Value; + LongTermDBConn = getDBController.GetLongTermConn2().First().Value; } } @@ -329,13 +329,13 @@ namespace SystemX.Product.TRA.DataManager { ShortTermDBConn = GetDBController.GetShortTermConn1(); - LongTermDBConn = GetDBController.GetLongTermConn1().Where(x => x.Key.Contains(start.Year.ToString())).First().Value; + LongTermDBConn = GetDBController.GetLongTermConn1().First().Value; } else if (TestSummarySelectView == eSelectDataView.DataDocumentViewC2) { ShortTermDBConn = GetDBController.GetShortTermConn2(); - LongTermDBConn = GetDBController.GetLongTermConn2().Where(x => x.Key.Contains(start.Year.ToString())).First().Value; + LongTermDBConn = GetDBController.GetLongTermConn2().First().Value; } DataTable dtResult = new DataTable(); 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 6e1b5f3..29c8ff6 100644 --- a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/MainForm.cs +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/MainForm.cs @@ -365,39 +365,14 @@ namespace SystemX.Product.CP.TRA { try { - //TODO : Conn Database - if (strConnIPAddressTL == string.Empty) - { - DatabaseConnControl.ConnectTestListDB(); + DatabaseConnControl.ConnectTestListDB(); + DBConnMain = DatabaseConnControl.GetMainConn(); - DBConnMain = DatabaseConnControl.GetMainConn(); - } - else - { - // DatabaseConnControl.ConnectTestListDB(strConnIPAddressTL, nConnPortTL); - - DBConnMain = DatabaseConnControl.GetMainConn(); - } - - //Data Server 1 - if (strConnIPAddressDT1 == string.Empty) - { - DatabaseConnControl.ConnectDataDB1(); - - DBConnShortTerm1 = DatabaseConnControl.GetShortTermConn1(); - DBConnLongTerm1 = DatabaseConnControl.GetLongTermConn1(); - } - else - { - foreach (string catalog in DatabaseConnControl.LongTermCatalogName) - { - DatabaseConnControl.ConnectDataDB1(strConnIPAddressDT1, nConnPortDT1, catalog); - } - - DBConnShortTerm1 = DatabaseConnControl.GetShortTermConn1(); - DBConnLongTerm1 = DatabaseConnControl.GetLongTermConn1(); - } + DatabaseConnControl.ConnectDataDB1(); + DBConnShortTerm1 = DatabaseConnControl.GetShortTermConn1(); + DBConnLongTerm1 = DatabaseConnControl.GetLongTermConn1(); + //Data Server 2 if (bUseDataServer2) { @@ -440,7 +415,7 @@ namespace SystemX.Product.CP.TRA // CheckSqlOption(DatabaseConnControl.GetMainConn()); - CheckSqlOption(DatabaseConnControl.GetShortTermConn1()); + // CheckSqlOption(DatabaseConnControl.GetShortTermConn1()); foreach (var con in DatabaseConnControl.GetLongTermConn1()) { CheckSqlOption(con.Value); @@ -481,7 +456,7 @@ namespace SystemX.Product.CP.TRA } finally { - if (DBConnMain == null || DBConnShortTerm1 == null || DBConnLongTerm1 == null) + if (DBConnMain == null || DBConnLongTerm1 == null) { bDatabaseConnState = false; @@ -2138,8 +2113,8 @@ namespace SystemX.Product.CP.TRA $"{DMCommon.SummaryHistTable}.[ProductID], " + $"{DMCommon.SummaryHistTable}.[Result] " + $"FROM {DMCommon.SummaryHistTable} WITH(NOLOCK) " + - $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = CONVERT(NVARCHAR, {DMCommon.SummaryHistTable}.[TestListVariantNo]) " + - $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo " + + $"LEFT JOIN [{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = CONVERT(NVARCHAR, {DMCommon.SummaryHistTable}.[TestListVariantNo]) " + + $"LEFT JOIN [{DatabaseConnControl.MainCatalogName}].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo " + $"WHERE " + $"TestDT >= '{dtStart.ToString("yyyy-MM-dd HH:mm:ss")}' AND " + $"TestDT <= '{dtEnd.ToString("yyyy-MM-dd HH:mm:ss")}' AND " + diff --git a/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/Properties/licenses.licx b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/Properties/licenses.licx new file mode 100644 index 0000000..973f334 --- /dev/null +++ b/CPXV2 TRA JSON Recovery/SystemX.Product.CP.TRA/Properties/licenses.licx @@ -0,0 +1,4 @@ +DevExpress.XtraCharts.ChartControl, DevExpress.XtraCharts.v20.2.UI, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraVerticalGrid.VGridControl, DevExpress.XtraVerticalGrid.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a 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 27cc999..a7465b7 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 @@ -33,6 +33,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.labelControl1 = new DevExpress.XtraEditors.LabelControl(); this.simpleButtonOK = new DevExpress.XtraEditors.SimpleButton(); this.panel1 = new System.Windows.Forms.Panel(); + this.lbError = new System.Windows.Forms.Label(); this.simpleButtonReset = new DevExpress.XtraEditors.SimpleButton(); this.panel2 = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel(); @@ -53,7 +54,9 @@ 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.btnRefresh2 = new System.Windows.Forms.Button(); + this.label4 = new System.Windows.Forms.Label(); + this.comboDbList2 = new System.Windows.Forms.ComboBox(); this.panel1.SuspendLayout(); this.panel3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.maskedTextBoxTLIP.Properties)).BeginInit(); @@ -88,7 +91,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(1025, 0); + this.simpleButtonOK.Location = new System.Drawing.Point(825, 0); this.simpleButtonOK.Name = "simpleButtonOK"; this.simpleButtonOK.Size = new System.Drawing.Size(66, 64); this.simpleButtonOK.TabIndex = 4; @@ -102,11 +105,20 @@ namespace SystemX.Product.ALIS.UI.Subs this.panel1.Controls.Add(this.simpleButtonReset); this.panel1.Controls.Add(this.simpleButtonOK); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; - this.panel1.Location = new System.Drawing.Point(0, 314); + this.panel1.Location = new System.Drawing.Point(0, 393); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1091, 64); + this.panel1.Size = new System.Drawing.Size(891, 64); this.panel1.TabIndex = 5; // + // lbError + // + this.lbError.ForeColor = System.Drawing.Color.Red; + this.lbError.Location = new System.Drawing.Point(483, 25); + this.lbError.Name = "lbError"; + this.lbError.Size = new System.Drawing.Size(317, 16); + this.lbError.TabIndex = 6; + this.lbError.Text = "lbError"; + // // simpleButtonReset // this.simpleButtonReset.Appearance.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); @@ -125,18 +137,21 @@ namespace SystemX.Product.ALIS.UI.Subs this.panel2.Dock = System.Windows.Forms.DockStyle.Top; this.panel2.Location = new System.Drawing.Point(0, 24); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(1091, 3); + this.panel2.Size = new System.Drawing.Size(891, 3); this.panel2.TabIndex = 6; // // panel3 // this.panel3.BackColor = System.Drawing.Color.Transparent; + this.panel3.Controls.Add(this.btnRefresh2); + this.panel3.Controls.Add(this.label4); + this.panel3.Controls.Add(this.comboDbList2); 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, 27); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(1091, 108); + this.panel3.Size = new System.Drawing.Size(891, 187); this.panel3.TabIndex = 8; // // maskedTextBoxTLIP @@ -153,7 +168,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(1091, 22); + this.maskedTextBoxTLIP.Size = new System.Drawing.Size(891, 22); this.maskedTextBoxTLIP.TabIndex = 8; this.maskedTextBoxTLIP.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.maskedTextBoxIP_PreviewKeyDown); // @@ -164,7 +179,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(1091, 65); + this.panel4.Size = new System.Drawing.Size(891, 65); this.panel4.TabIndex = 7; // // label2 @@ -175,7 +190,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(1091, 51); + this.label2.Size = new System.Drawing.Size(891, 51); this.label2.TabIndex = 9; this.label2.Text = "TestList Server"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -189,9 +204,9 @@ namespace SystemX.Product.ALIS.UI.Subs 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, 135); + this.panel5.Location = new System.Drawing.Point(0, 214); this.panel5.Name = "panel5"; - this.panel5.Size = new System.Drawing.Size(1091, 179); + this.panel5.Size = new System.Drawing.Size(891, 179); this.panel5.TabIndex = 9; // // btnRefresh @@ -238,8 +253,9 @@ 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(1091, 22); + this.maskedTextBoxDT1IP.Size = new System.Drawing.Size(891, 22); this.maskedTextBoxDT1IP.TabIndex = 8; + this.maskedTextBoxDT1IP.Visible = false; this.maskedTextBoxDT1IP.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.maskedTextBoxIP_PreviewKeyDown); // // panel6 @@ -250,7 +266,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(1091, 85); + this.panel6.Size = new System.Drawing.Size(891, 85); this.panel6.TabIndex = 7; // // comboBoxOverviewModel1 @@ -261,7 +277,7 @@ namespace SystemX.Product.ALIS.UI.Subs "L", "P1", "P2"}); - this.comboBoxOverviewModel1.Location = new System.Drawing.Point(280, 22); + this.comboBoxOverviewModel1.Location = new System.Drawing.Point(82, 25); this.comboBoxOverviewModel1.Name = "comboBoxOverviewModel1"; this.comboBoxOverviewModel1.Size = new System.Drawing.Size(106, 23); this.comboBoxOverviewModel1.TabIndex = 10; @@ -275,7 +291,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(1091, 70); + this.label1.Size = new System.Drawing.Size(891, 70); this.label1.TabIndex = 9; this.label1.Text = "Log Server [1]"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -287,9 +303,9 @@ namespace SystemX.Product.ALIS.UI.Subs this.panel7.Controls.Add(this.maskedTextBoxDT2IP); this.panel7.Controls.Add(this.panel8); this.panel7.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel7.Location = new System.Drawing.Point(0, 384); + this.panel7.Location = new System.Drawing.Point(0, 473); this.panel7.Name = "panel7"; - this.panel7.Size = new System.Drawing.Size(1091, 14); + this.panel7.Size = new System.Drawing.Size(891, 14); this.panel7.TabIndex = 10; this.panel7.Visible = false; // @@ -307,7 +323,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(1091, 22); + this.maskedTextBoxDT2IP.Size = new System.Drawing.Size(891, 22); this.maskedTextBoxDT2IP.TabIndex = 8; this.maskedTextBoxDT2IP.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.maskedTextBoxIP_PreviewKeyDown); // @@ -320,7 +336,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(1091, 83); + this.panel8.Size = new System.Drawing.Size(891, 83); this.panel8.TabIndex = 7; // // comboBoxOverviewModel2 @@ -357,19 +373,42 @@ 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(1091, 69); + this.label3.Size = new System.Drawing.Size(891, 69); this.label3.TabIndex = 9; this.label3.Text = "Log Server [2]"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // lbError + // btnRefresh2 // - 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"; + this.btnRefresh2.ForeColor = System.Drawing.Color.Black; + this.btnRefresh2.Location = new System.Drawing.Point(486, 115); + this.btnRefresh2.Name = "btnRefresh2"; + this.btnRefresh2.Size = new System.Drawing.Size(98, 23); + this.btnRefresh2.TabIndex = 14; + this.btnRefresh2.Text = "Refresh"; + this.btnRefresh2.UseVisualStyleBackColor = true; + this.btnRefresh2.Click += new System.EventHandler(this.button1_Click); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.ForeColor = System.Drawing.Color.Black; + this.label4.Location = new System.Drawing.Point(12, 119); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(102, 15); + this.label4.TabIndex = 13; + this.label4.Text = "Recovery DataBase"; + this.label4.Click += new System.EventHandler(this.label4_Click); + // + // comboDbList2 + // + this.comboDbList2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboDbList2.FormattingEnabled = true; + this.comboDbList2.Location = new System.Drawing.Point(129, 114); + this.comboDbList2.Name = "comboDbList2"; + this.comboDbList2.Size = new System.Drawing.Size(351, 23); + this.comboDbList2.TabIndex = 12; + this.comboDbList2.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); // // ConnectForm // @@ -379,7 +418,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(1091, 398); + this.ClientSize = new System.Drawing.Size(891, 487); this.Controls.Add(this.panel1); this.Controls.Add(this.panel7); this.Controls.Add(this.panel5); @@ -398,6 +437,7 @@ namespace SystemX.Product.ALIS.UI.Subs this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ConnectForm_FormClosing); this.panel1.ResumeLayout(false); this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.maskedTextBoxTLIP.Properties)).EndInit(); this.panel4.ResumeLayout(false); this.panel5.ResumeLayout(false); @@ -438,5 +478,8 @@ namespace SystemX.Product.ALIS.UI.Subs private System.Windows.Forms.ComboBox comboDbList; private System.Windows.Forms.Button btnRefresh; private System.Windows.Forms.Label lbError; + private System.Windows.Forms.Button btnRefresh2; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.ComboBox comboDbList2; } } \ 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 5844a14..ab22e98 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 @@ -276,8 +276,22 @@ namespace SystemX.Product.ALIS.UI.Subs return; } - DatabaseConnControl.LongTermCatalogName.RemoveAll(x=>x != comboDbList.Text); + //cpxv2 ip 아님 + if (string.IsNullOrEmpty(comboDbList2.Text) == true) + { + lbError.Text = "No selected Recovery TestList DataBase"; + return; + } + //선택완료되면 DB닫았다가 다시열기 + DatabaseConnControl.MainCatalogName = comboDbList2.Text; + DatabaseConnControl.MainDBIP = maskedTextBoxTLIP.Text; + DatabaseConnControl.LogDBIP = maskedTextBoxTLIP.Text; + + DatabaseConnControl.ConnectTestListDB(); + + DatabaseConnControl.LongTermCatalogName.RemoveAll(x=>x != comboDbList.Text); + bSelectUseDataServer2 = checkBoxUseDT2.Checked; // nOverviewModelC1 = comboBoxOverviewModel1.SelectedIndex; @@ -341,14 +355,14 @@ namespace SystemX.Product.ALIS.UI.Subs private void btnRefresh_Click(object sender, EventArgs e) { - if (IsValidIPv4(maskedTextBoxDT1IP.Text) == false) + if (IsValidIPv4(maskedTextBoxTLIP.Text) == false) { lbError.Text = "Invalid Log Server IP Address"; return; } lbError.Text = string.Empty; - DatabaseConnControl.ConnectTestListDB(maskedTextBoxDT1IP.Text); + DatabaseConnControl.ConnectTestListDB(maskedTextBoxTLIP.Text); var dbList = DatabaseConnControl.LongTermCatalogName; comboDbList.Items.Clear(); @@ -360,5 +374,31 @@ namespace SystemX.Product.ALIS.UI.Subs 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); } + + private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) + { + + } + + private void label4_Click(object sender, EventArgs e) + { + + } + + private void button1_Click(object sender, EventArgs e) + { + if (IsValidIPv4(maskedTextBoxTLIP.Text) == false) + { + lbError.Text = "Invalid Log Server IP Address"; + return; + } + + lbError.Text = string.Empty; + DatabaseConnControl.ConnectTestListDB(maskedTextBoxTLIP.Text); + var dbList = DatabaseConnControl.LongTermCatalogName; + + comboDbList2.Items.Clear(); + comboDbList2.Items.AddRange(dbList.ToArray()); + } } } \ 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 fb52080..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 @@ -366,6 +366,7 @@ MainForm.cs + ResXFileCodeGenerator Resources.Designer.cs