修复修改文件名的BUG

This commit is contained in:
Falcon 2024-08-02 15:17:58 +08:00
parent 62d6d6d920
commit 4f49ae9887

View File

@ -377,6 +377,7 @@ namespace CalendarNotepad
}
var item = items[0];
var fileName = item.Text;
var fileKey = item.SubItems[2].Text;
var dlgr = Interaction.InputBox($"原文件名:{fileName}",Title: "修改文件名",DefaultResponse: fileName);
if(dlgr == "") {
return;
@ -385,7 +386,7 @@ namespace CalendarNotepad
return;
}
var wd = this.WorkDayKey;
this.Db.Updateable<WorkUnitPlusFile>().Where(a => a.WorkDay == wd).SetColumns(a => a.FileName == dlgr).ExecuteCommand();
this.Db.Updateable<WorkUnitPlusFile>().Where(a => a.WorkDay == wd && a.FileKey == fileKey).SetColumns(a => a.FileName == dlgr).ExecuteCommand();
item.Text = dlgr;
MessageBox.Show("文件名修改完成");
}