260511_01_ENH: 테스트 파일 실제로 돌려가며 오류 내용 수정

This commit is contained in:
2026-05-11 16:24:45 +09:00
parent b501332f06
commit c652d4ad43
7 changed files with 104 additions and 57 deletions

View File

@@ -55,20 +55,20 @@ namespace Keps.WinForms.Forms
private void BtnFolder_Click(object sender, EventArgs e)
{
// 초기 디렉터리는 _txtFolder의 값(폴더이거나 파일이면 그 폴더) 또는 _appBasePath
// 초기 디렉터리는 _txtFile의 값(폴더이거나 파일이면 그 폴더) 또는 _appBasePath
string initialDir = _appBasePath;
if (!string.IsNullOrWhiteSpace(_txtFolder.Text))
if (!string.IsNullOrWhiteSpace(_txtFile.Text))
{
try
{
if (Directory.Exists(_txtFolder.Text))
if (Directory.Exists(_txtFile.Text))
{
initialDir = _txtFolder.Text;
initialDir = _txtFile.Text;
}
else
{
var dir = Path.GetDirectoryName(_txtFolder.Text);
var dir = Path.GetDirectoryName(_txtFile.Text);
if (!string.IsNullOrWhiteSpace(dir) && Directory.Exists(dir))
initialDir = dir;
}
@@ -79,12 +79,12 @@ namespace Keps.WinForms.Forms
}
}
// FolderBrowserDialog는 SelectedPath로 초기 경로를 설정
_folderDialog.SelectedPath = initialDir;
_fileDialog.InitialDirectory = initialDir;
_fileDialog.FileName = string.Empty;
if (_folderDialog.ShowDialog(this) == DialogResult.OK)
if (_fileDialog.ShowDialog(this) == DialogResult.OK)
{
_txtFolder.Text = _folderDialog.SelectedPath;
_txtFile.Text = _fileDialog.FileName;
}
}
@@ -102,13 +102,13 @@ namespace Keps.WinForms.Forms
return;
}
if (string.IsNullOrWhiteSpace(_txtFolder.Text) || !Directory.Exists(_txtFolder.Text))
if (string.IsNullOrWhiteSpace(_txtFile.Text) || !File.Exists(_txtFile.Text))
{
MessageBox.Show(this, "엑셀 폴더를 선택하세요.", "확인", MessageBoxButtons.OK, MessageBoxIcon.Warning);
MessageBox.Show(this, "엑셀 파일을 선택하세요.", "확인", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
string folderPath = _txtFolder.Text;
string filePath = _txtFile.Text;
string electionName = _cmbElection.SelectedItem.ToString();
ToggleState(false);
@@ -125,7 +125,7 @@ namespace Keps.WinForms.Forms
{
await Task.Run(() =>
{
_excelImportService.Import(folderPath, electionName, ImportMode.Real, progress);
_excelImportService.Import(filePath, electionName, ImportMode.Real, progress);
});
_lblMain.Text = "완료";