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);