From 570b50f33c406e3b8c1e4f91c2aace9546cefda1 Mon Sep 17 00:00:00 2001 From: Alessandro Magistroni <65421435+AMagistroni@users.noreply.github.com> Date: Tue, 7 Sep 2021 20:08:40 +0200 Subject: [PATCH] Modified file name error --- SqlSchemaCompare.WindowsForm/MainForm.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SqlSchemaCompare.WindowsForm/MainForm.cs b/SqlSchemaCompare.WindowsForm/MainForm.cs index a6c4480..318f8c7 100644 --- a/SqlSchemaCompare.WindowsForm/MainForm.cs +++ b/SqlSchemaCompare.WindowsForm/MainForm.cs @@ -224,7 +224,7 @@ private void BtnCreateUpdateFile_Click(object sender, EventArgs e) if (File.Exists(txtUpdateSchemaFile.Text)) File.Delete(txtUpdateSchemaFile.Text); - var errorFile = GetErrorFileName(); + var errorFile = GetErrorFileName("_errorsUpdateSchema"); if (File.Exists(errorFile)) File.Delete(errorFile); @@ -251,11 +251,11 @@ private void BtnCreateUpdateFile_Click(object sender, EventArgs e) } } - private string GetErrorFileName() + private string GetErrorFileName(string suffix) { var indexDot = txtUpdateSchemaFile.Text.LastIndexOf('.'); if (indexDot > 0) - return $"{txtUpdateSchemaFile.Text.Substring(0, indexDot)}_errorsUpdateSchema.{txtUpdateSchemaFile.Text.Substring(indexDot + 1)}"; + return $"{txtUpdateSchemaFile.Text.Substring(0, indexDot)}{suffix}.{txtUpdateSchemaFile.Text.Substring(indexDot + 1)}"; else return $"{txtUpdateSchemaFile.Text}_errors"; } @@ -276,7 +276,7 @@ private void BtnLoadSchema_Click(object sender, EventArgs e) if (!MandatoryFieldArePresent()) return; - var errorFile = GetErrorFileName(); + var errorFile = GetErrorFileName("_errorsLoadSchema"); if (File.Exists(errorFile)) File.Delete(errorFile);