diff --git a/CalendarNotepad/WorkMain.cs b/CalendarNotepad/WorkMain.cs index b24fd8e..53b78a1 100644 --- a/CalendarNotepad/WorkMain.cs +++ b/CalendarNotepad/WorkMain.cs @@ -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().Where(a => a.WorkDay == wd).SetColumns(a => a.FileName == dlgr).ExecuteCommand(); + this.Db.Updateable().Where(a => a.WorkDay == wd && a.FileKey == fileKey).SetColumns(a => a.FileName == dlgr).ExecuteCommand(); item.Text = dlgr; MessageBox.Show("文件名修改完成"); }